Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
5.2 KiB

  1. Protocol Buffers - Google's data interchange format
  2. Copyright 2008 Google Inc.
  3. http://code.google.com/apis/protocolbuffers/
  4. C++ Installation - Unix
  5. =======================
  6. To build and install the C++ Protocol Buffer runtime and the Protocol
  7. Buffer compiler (protoc) execute the following:
  8. $ ./configure
  9. $ make
  10. $ make check
  11. $ make install
  12. If "make check" fails, you can still install, but it is likely that
  13. some features of this library will not work correctly on your system.
  14. Proceed at your own risk.
  15. "make install" may require superuser privileges.
  16. For advanced usage information on configure and make, see INSTALL.txt.
  17. ** Hint on install location **
  18. By default, the package will be installed to /usr/local. However,
  19. on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH.
  20. You can add it, but it may be easier to just install to /usr
  21. instead. To do this, invoke configure as follows:
  22. ./configure --prefix=/usr
  23. If you already built the package with a different prefix, make sure
  24. to run "make clean" before building again.
  25. ** Compiling dependent packages **
  26. To compile a package that uses Protocol Buffers, you need to pass
  27. various flags to your compiler and linker. As of version 2.2.0,
  28. Protocol Buffers integrates with pkg-config to manage this. If you
  29. have pkg-config installed, then you can invoke it to get a list of
  30. flags like so:
  31. pkg-config --cflags protobuf # print compiler flags
  32. pkg-config --libs protobuf # print linker flags
  33. pkg-config --cflags --libs protobuf # print both
  34. For example:
  35. c++ my_program.cc my_proto.pb.cc `pkg-config --cflags --libs protobuf`
  36. Note that packages written prior to the 2.2.0 release of Protocol
  37. Buffers may not yet integrate with pkg-config to get flags, and may
  38. not pass the correct set of flags to correctly link against
  39. libprotobuf. If the package in question uses autoconf, you can
  40. often fix the problem by invoking its configure script like:
  41. configure CXXFLAGS="$(pkg-config --cflags protobuf)" \
  42. LIBS="$(pkg-config --libs protobuf)"
  43. This will force it to use the correct flags.
  44. If you are writing an autoconf-based package that uses Protocol
  45. Buffers, you should probably use the PKG_CHECK_MODULES macro in your
  46. configure script like:
  47. PKG_CHECK_MODULES([protobuf], [protobuf])
  48. See the pkg-config man page for more info.
  49. If you only want protobuf-lite, substitute "protobuf-lite" in place
  50. of "protobuf" in these examples.
  51. ** Note for cross-compiling **
  52. The makefiles normally invoke the protoc executable that they just
  53. built in order to build tests. When cross-compiling, the protoc
  54. executable may not be executable on the host machine. In this case,
  55. you must build a copy of protoc for the host machine first, then use
  56. the --with-protoc option to tell configure to use it instead. For
  57. example:
  58. ./configure --with-protoc=protoc
  59. This will use the installed protoc (found in your $PATH) instead of
  60. trying to execute the one built during the build process. You can
  61. also use an executable that hasn't been installed. For example, if
  62. you built the protobuf package for your host machine in ../host,
  63. you might do:
  64. ./configure --with-protoc=../host/src/protoc
  65. Either way, you must make sure that the protoc executable you use
  66. has the same version as the protobuf source code you are trying to
  67. use it with.
  68. ** Note for Solaris users **
  69. Solaris 10 x86 has a bug that will make linking fail, complaining
  70. about libstdc++.la being invalid. We have included a work-around
  71. in this package. To use the work-around, run configure as follows:
  72. ./configure LDFLAGS=-L$PWD/src/solaris
  73. See src/solaris/libstdc++.la for more info on this bug.
  74. ** Note for HP C++ Tru64 users **
  75. To compile invoke configure as follows:
  76. ./configure CXXFLAGS="-O -std ansi -ieee -D__USE_STD_IOSTREAM"
  77. Also, you will need to use gmake instead of make.
  78. C++ Installation - Windows
  79. ==========================
  80. If you are using Microsoft Visual C++, see vsprojects/readme.txt.
  81. If you are using Cygwin or MinGW, follow the Unix installation
  82. instructions, above.
  83. Binary Compatibility Warning
  84. ============================
  85. Due to the nature of C++, it is unlikely that any two versions of the
  86. Protocol Buffers C++ runtime libraries will have compatible ABIs.
  87. That is, if you linked an executable against an older version of
  88. libprotobuf, it is unlikely to work with a newer version without
  89. re-compiling. This problem, when it occurs, will normally be detected
  90. immediately on startup of your app. Still, you may want to consider
  91. using static linkage. You can configure this package to install
  92. static libraries only using:
  93. ./configure --disable-shared
  94. Java and Python Installation
  95. ============================
  96. The Java and Python runtime libraries for Protocol Buffers are located
  97. in the java and python directories. See the README file in each
  98. directory for more information on how to compile and install them.
  99. Note that both of them require you to first install the Protocol
  100. Buffer compiler (protoc), which is part of the C++ package.
  101. Usage
  102. =====
  103. The complete documentation for Protocol Buffers is available via the
  104. web at:
  105. http://code.google.com/apis/protocolbuffers/