Blame README

Packit db3073
pkg-config is a script to make putting together all the build
Packit db3073
flags when compiling/linking a lot easier.
Packit db3073
Packit db3073
Report bugs at http://bugzilla.freedesktop.org/
Packit db3073
Packit db3073
To use pkg-config, do something like the following in your configure.ac
Packit db3073
Packit db3073
    PKG_CHECK_MODULES([GNOME], [gtk > 1.2.8 gnomeui >= 1.2.0])
Packit db3073
Packit db3073
This puts the neccesary include flags to compile/link something against
Packit db3073
libgnomeui and all its dependencies in $(GNOME_CFLAGS), and the -L/-l flags
Packit db3073
for linking in $(GNOME_LIBS).
Packit db3073
Packit db3073
Users can define the PKG_CONFIG environment variable to point at the
Packit db3073
right one, or if they cross-compile and have a correctly named pkg-config
Packit db3073
(eg. arm-linux-pkg-config) in their PATH that will be used in preference.
Packit db3073
Packit db3073
Users can also define the GNOME_CFLAGS and GNOME_LIBS environment variables
Packit db3073
if they think they know better, pkg-config will not be called if they do
Packit db3073
that.
Packit db3073
Packit db3073
The "gtk > 1.2.8" part is only neccesary if you want to specifically check
Packit db3073
if libgtk is version 1.2.8 or higher. Otherwise, the flags for gtk
Packit db3073
will be included automatically, since libgnomeui depends on gtk.
Packit db3073
So you could just say:
Packit db3073
Packit db3073
     PKG_CHECK_MODULES([GNOME], [gnomeui])
Packit db3073
Packit db3073
for any version of gnomeui.
Packit db3073
Packit db3073
For more info, there's even a man page, try 'man pkg-config'
Packit db3073
Packit db3073
Building
Packit db3073
========
Packit db3073
pkg-config depends on glib.  Note that glib build-depends on pkg-config,
Packit db3073
but you can just set the corresponding environment variables (ZLIB_LIBS,
Packit db3073
ZLIB_CFLAGS are the only needed ones when this is written) to build it.
Packit db3073
Packit db3073
pkg-config also either needs an earlier version of itself to find glib
Packit db3073
or you need to set GLIB_CFLAGS and GLIB_LIBS to the correct values for
Packit db3073
where it's installed in your system.
Packit db3073
Packit db3073
If this requirement is too cumbersome, a bundled copy of a recent glib
Packit db3073
stable release is included. Pass --with-internal-glib to configure to
Packit db3073
use this copy.
Packit db3073
Packit db3073
If you're cross-compiling and you need to build the bundled glib, refer
Packit db3073
to the glib documentation for cross-compiling glib. In short, this will
Packit db3073
require setting some autoconf cache variables in cases where glib would
Packit db3073
need to run a program to determine the correct value. See the glib
Packit db3073
documentation:
Packit db3073
Packit db3073
http://developer.gnome.org/glib/stable/glib-cross-compiling.html
Packit db3073
Packit db3073
If you need to use the bundled glib on Mac OS X, you'll most likely need
Packit db3073
to build for a single architecture rather than as a universal binary.
Packit db3073
This is because glib (as of version 2.32) does not support building for
Packit db3073
multiple architectures out of the box. The glib2 from MacPorts or
Packit db3073
Homebrew may be available as a universal binary and usable for
Packit db3073
pkg-config as described above. Nothing in pkg-config itself precludes
Packit db3073
being built as a universal binary.