~ubuntu-branches/ubuntu/raring/protobuf/raring

« back to all changes in this revision

Viewing changes to README.txt

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2010-02-11 11:13:19 UTC
  • mfrom: (2.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100211111319-zdn8hmw0gh8s4cf8
Tags: 2.2.0a-0.1ubuntu1
* Merge from Debian testing.
* Remaining Ubuntu changes:
  - Don't use python2.4.
* Ubuntu changes dropped:
  - Disable death tests on Itanium, fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
  If you already built the package with a different prefix, make sure
34
34
  to run "make clean" before building again.
35
35
 
 
36
** Compiling dependent packages **
 
37
 
 
38
  To compile a package that uses Protocol Buffers, you need to pass
 
39
  various flags to your compiler and linker.  As of version 2.2.0,
 
40
  Protocol Buffers integrates with pkg-config to manage this.  If you
 
41
  have pkg-config installed, then you can invoke it to get a list of
 
42
  flags like so:
 
43
 
 
44
    pkg-config --cflags protobuf         # print compiler flags
 
45
    pkg-config --libs protobuf           # print linker flags
 
46
    pkg-config --cflags --libs protobuf  # print both
 
47
 
 
48
  For example:
 
49
 
 
50
    c++ my_program.cc my_proto.pb.cc `pkg-config --cflags --libs protobuf`
 
51
 
 
52
  Note that packages written prior to the 2.2.0 release of Protocol
 
53
  Buffers may not yet integrate with pkg-config to get flags, and may
 
54
  not pass the correct set of flags to correctly link against
 
55
  libprotobuf.  If the package in question uses autoconf, you can
 
56
  often fix the problem by invoking its configure script like:
 
57
 
 
58
    configure CXXFLAGS="$(pkg-config --cflags protobuf)" \
 
59
              LIBS="$(pkg-config --libs protobuf)"
 
60
 
 
61
  This will force it to use the correct flags.
 
62
 
 
63
  If you are writing an autoconf-based package that uses Protocol
 
64
  Buffers, you should probably use the PKG_CHECK_MODULES macro in your
 
65
  configure script like:
 
66
 
 
67
    PKG_CHECK_MODULES([protobuf], [protobuf])
 
68
 
 
69
  See the pkg-config man page for more info.
 
70
 
 
71
  If you only want protobuf-lite, substitute "protobuf-lite" in place
 
72
  of "protobuf" in these examples.
 
73
 
36
74
** Note for cross-compiling **
37
75
 
38
76
  The makefiles normally invoke the protoc executable that they just