Re: circular dependency between glib and pkg-config

Thanks, Allin.  Glib's ./configure --help mentions environment variables

  PKG_CONFIG  path to pkg-config utility
              directories to add to pkg-config's search path
              path overriding pkg-config's built-in search path
  ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
  ZLIB_LIBS   linker flags for ZLIB, overriding pkg-config
  CXXCPP      C++ preprocessor
  PCRE_CFLAGS C compiler flags for PCRE, overriding pkg-config
  PCRE_LIBS   linker flags for PCRE, overriding pkg-config
              C compiler flags for DBUS1, overriding pkg-config
  DBUS1_LIBS  linker flags for DBUS1, overriding pkg-config

which could lead one to believe that ZLIB isn't the only thing that could
matter; and it doesn't
say that pkg-config is not needed if these variables are present.  It does
say pkg-config is required.

I think it should be possible for someone unfamiliar with either package
to build glib from source after reading INSTALL, before installing
pkg-config.  Either that, or to install pkg-config before installing glib
- whichever way the maintainers of the two packages can agree on.  INSTALL
doesn't give instructions on this, and I think it should.  I don't think
it should be necessary to search the web or read what's in configure,
Makefile, etc.

I'm not posting these messages to get glib or pkg-config built; I managed
to do that some days ago.  According to my notes and a couple of
experiments just now, once I got the various pieces of software other than
pkg-config that glib wanted, built and installed, and set PATH, CPATH, and
LIBRARY_PATH to their locations (which weren't in the former PATH or the
places the compiler or linker normally look), it was possible to build
glib without pkg-config.  I installed glib, too, into those non-standard
locations, having used --prefix= for ./configure.  Then, after setting
GLIB_CFLAGS and GLIB_LIBS (the latter with -L and -l options for the
linker), it was possible to build pkg-config.  I didn't need to do
anything special about zlib, which was already on the system.

However I had to discover this by trial and error, not by reading INSTALL.
 I've learned a number of interesting and useful things from the journey,
which I don't regret at all, but don't think people should be required to
to more than read INSTALL just in order to build from source.

Thanks again.

> On Tue, 27 Sep 2011, Stuart Ambler wrote:
>> It seems that the pkg-config README in [Ryan Lortie's]
>> message tried to address that, but sorry, I didn't see what
>> zlib had to do with the dependency of glib on pkg-config.
>> ("To build pkg-config, you need glib installed already.
>> Note that glib build-depends on pkg-config, but you can just
>> set the corresponding environment variables (ZLIB_LIBS,
>> ZLIB_CFLAGS are the only needed ones when this is written)
>> to build it.")
> Presumably the point is that zlib is the only prerequisite
> library that is handled by pkg-config in the glib build (as in
> pkg-config --libs zlib, pkg-config --cflags zlib). The effect
> of the calls to pkg-config is to define ZLIB_LIBS and
> ZLIB_CFLAGS, but these could equally well be set manually.
> Allin Cottrell

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]