pkg-config v0.26 released

Anders F Björklund afb at users.sourceforge.net
Sun Sep 25 03:44:59 PDT 2011


Stuart Ambler wrote:

> http://developer.gnome.org/glib/2.28/glib-building.html says pkg-config is
> needed to build glib.

Actually you don't need pkg-config, if you set all the variables...

  ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
  ZLIB_LIBS   linker flags for ZLIB, overriding pkg-config
  PCRE_CFLAGS C compiler flags for PCRE, overriding pkg-config
  PCRE_LIBS   linker flags for PCRE, overriding pkg-config
  DBUS1_CFLAGS
              C compiler flags for DBUS1, overriding pkg-config
  DBUS1_LIBS  linker flags for DBUS1, overriding pkg-config

Then again pkg-config is even used during configure of pkg-config!
It's supposed to give an error if not, but error itself is broken:
https://bugs.freedesktop.org/show_bug.cgi?id=39646 (syntax error)

the error is: "pkg-config and glib-2.0 not found, please set
               GLIB_CFLAGS and GLIB_LIBS to the correct values"


For pkg-config 0.25 it would build a static glib automatically,
but for pkg-config 0.26 you need to build one yourself first...
And then set GLIB_CFLAGS and GLIB_LIBS to where you built it,
including the libiconv and libintl dependencies that it needs.

You'll end up with something like this, for pkg-config itself:

PKG_CONFIG_PATH="$PWD/glib-$GLIB_VER:$PKG_CONFIG_PATH" \
PKG_CONFIG=false \
GLIB_CFLAGS="-I$PWD/glib-$GLIB_VER -I$PWD/glib-$GLIB_VER/glib" \
GLIB_LIBS="$PWD/glib-$GLIB_VER/glib/libglib-2.0.la" \
./configure

Assuming that you build glib-$GLIB_VER in the same directory.
Then PC will build the same as 0.25, only twice as big or so...


I have mine installed under /opt/pkgconfig, for Mac OS X:

/opt/pkgconfig
├── bin
│   └── pkg-config
├── lib
│   └── pkgconfig
└── share
    ├── aclocal
    │   └── pkg.m4
    ├── doc
    │   └── pkg-config
    │       └── pkg-config-guide.html
    ├── man
    │   └── man1
    │       └── pkg-config.1
    └── pkgconfig

Then I set $PKG_CONFIG and $PKG_CONFIG_PATH, when using it.
(system has /usr/lib/pkgconfig and /usr/X11/lib/pkgconfig)

Packages will be at http://sourceforge.net/projects/macpkg/

--anders



More information about the pkg-config mailing list