Update to 0.28
[platform/upstream/pkg-config.git] / README
1 pkg-config is a script to make putting together all the build
2 flags when compiling/linking a lot easier.
3
4 Report bugs at http://bugzilla.freedesktop.org/
5
6 To use pkg-config, do something like the following in your configure.ac
7
8     PKG_CHECK_MODULES([GNOME], [gtk > 1.2.8 gnomeui >= 1.2.0])
9
10 This puts the neccesary include flags to compile/link something against
11 libgnomeui and all its dependencies in $(GNOME_CFLAGS), and the -L/-l flags
12 for linking in $(GNOME_LIBS).
13
14 Users can define the PKG_CONFIG environment variable to point at the
15 right one, or if they cross-compile and have a correctly named pkg-config
16 (eg. arm-linux-pkg-config) in their PATH that will be used in preference.
17
18 Users can also define the GNOME_CFLAGS and GNOME_LIBS environment variables
19 if they think they know better, pkg-config will not be called if they do
20 that.
21
22 The "gtk > 1.2.8" part is only neccesary if you want to specifically check
23 if libgtk is version 1.2.8 or higher. Otherwise, the flags for gtk
24 will be included automatically, since libgnomeui depends on gtk.
25 So you could just say:
26
27      PKG_CHECK_MODULES([GNOME], [gnomeui])
28
29 for any version of gnomeui.
30
31 For more info, there's even a man page, try 'man pkg-config'
32
33 Building
34 ========
35 pkg-config depends on glib.  Note that glib build-depends on pkg-config,
36 but you can just set the corresponding environment variables (ZLIB_LIBS,
37 ZLIB_CFLAGS are the only needed ones when this is written) to build it.
38
39 pkg-config also either needs an earlier version of itself to find glib
40 or you need to set GLIB_CFLAGS and GLIB_LIBS to the correct values for
41 where it's installed in your system.
42
43 If this requirement is too cumbersome, a bundled copy of a recent glib
44 stable release is included. Pass --with-internal-glib to configure to
45 use this copy.
46
47 If you're cross-compiling and you need to build the bundled glib, refer
48 to the glib documentation for cross-compiling glib. In short, this will
49 require setting some autoconf cache variables in cases where glib would
50 need to run a program to determine the correct value. See the glib
51 documentation:
52
53 http://developer.gnome.org/glib/stable/glib-cross-compiling.html
54
55 If you need to use the bundled glib on Mac OS X, you'll most likely need
56 to build for a single architecture rather than as a universal binary.
57 This is because glib (as of version 2.32) does not support building for
58 multiple architectures out of the box. The glib2 from MacPorts or
59 Homebrew may be available as a universal binary and usable for
60 pkg-config as described above. Nothing in pkg-config itself precludes
61 being built as a universal binary.