A few of the options in configure.ac were poorly quoted or didn't have
messages matching the typical autoconf style. PKG_CONFIG_FIND_PC_PATH
also had no reason to exist since it was used once immediately after its
definition.
With the conversion to GOption and g_shell_parse_argv, pkg-config has no
remaining usage of popt. Stop linking to libpopt and removed the bundled
sources.
Fixes Freedesktop #5326, #31700, #44843
Use glib's GOption instead of popt for command line option
handling. The APIs and output are very similar. A couple minor
differences are:
* The callback for handling --define-variable is associated only with
that option where popt was just leaving the argument and then it was
handled in a generic callback.
* Remaining arguments after option parsing are in argc/argv while they
are collected through poptGetArg with popt.
* GOption does not provide the short --usage summary.
This also works around bugs in the command line option handling with
the ancient internal popt.
Glib's g_shell_parse_argv offers basically a 1:1 replacement for
poptParseArgvString except that you have to free all the elements of
the array explicitly.
From the LFS mailing list looking into why check-cmd-options fails using
the bundled popt:
poptGetNextOption, after it invokes the callback for
--define-variable=a=b (the operation of which sets the longArg local
variable), does not reset longArg to NULL. So on the next time through
its loop (after invoking the --define-variable callback, before invoking
the --atleast-pkgconfig-version callback), on line 389 of popt.c, sets
con->os->nextArg to longArg (the old "a=b" string). What it should do
is set nextArg to nextCharArg (the next item on the command line). This
happens if longArg is NULL.
http://linuxfromscratch.org/pipermail/lfs-dev/2011-September/065065.html
Freedesktop #9584
Since there's no DIST_CONFIGURE_FLAGS, the best we can do to not require
glib's configure to always be run is to error on dist when we haven't
configured --with-internal-glib. This is a hack, but I think it's
slightly nicer than overriding dist and re-running configure with
different options than were specified by the user.
The glib configure script takes a long time to run, so we want to avoid
it in the default case where we're using the system's glib.
Unfortunately, that means we can't add it unconditionally to
DIST_SUBDIRS since distclean will not always find Makefiles when it
descends into glib.
Make glib only be part of DIST_SUBDIRS when we've configured it. This
will require a different hack to make sure dist always includes glib.
This reverts commit 1860fc8036.
distclean breaks if glib is in DIST_SUBDIRS but we haven't actually
generated the glib Makefiles by running glib's configure.
The code for --exact/atleast/max-version was taking a different path
than the handling of operators like =/>=/<=. Make the long option
versions override the operators and take place during the standard
package checking stage. This also means that --print-errors is
respected.
Fixes Freedesktop #8653
Some distros and users have unusual installation needs that don't
conform to the standard $libdir/pkgconfig and $datadir/pkgconfig
pathways. Help packagers support these users with the macros
PKG_INSTALLDIR and PKG_NOARCH_INSTALLDIR. These are simple macros that
provide the configure parameters --with-pkgconfigdir and
--with-noarch-pkgconfigdir to allow users to override the standard
locations.
Freedesktop #48743
We want to distribute the glib subdir, but we want to avoid configuring
it for the default build case where the system glib is used. Override
the standard dist target so that we can reconfigure with
--with-internal-glib if necessary. I think the target should be
compatible with the original dist.
This is pretty hacky and may need to be reverted if it breaks dist.
It's nice to say that glib is a base library and you should have it
installed to build pkg-config, but it makes bootstrapping pkg-config
really annoying since it introduces a circular dependency.
Let's be nice to our users and bundle a copy to avoid this situation.
The default is still to use the system's glib, but the internal copy
can be used by passing --with-internal-glib to configure. The latest
stable copy of glib is included and will be updated periodically with
their stable releases.
The top level autogen.sh is running recursively through glib. If this
becomes an issue, we can switch autoreconf to --no-recursive and then
descend to glib and run its autogen.sh script.
Since this is default off, its integration will probably not be tested
often. Therefore, it's forcefully turned on during distcheck to make
sure to test it out before distributing a tarball.
We just want to be able to build glib from the within the pkg-config
tree. Everything else is just extra weight and is better used from an
actual glib checkout. Unnecessary files include:
* documentation
* translations
* tests
* ChangeLogs
* non-autotools win32 build files
* various other build and/or internal files
Add a snapshot of the current stable version of glib, glib-2.32.0. Since
we only need the glib library, a lot of files are removed. See the
README and update-glib.sh files in glib-patches for details.
Grab a snapshot of a tag from a local glib checkout, remove a bunch of
files and apply some patches. The idea is to make the snapshot of glib
be repeatable.
The DW and EW roff macros had been used to suppress warnings around the
documentation on the now removed Windows registry keys. These macro
definitions are unneeded and cause problems with older groff and nroff
versions. Numerous patches exist around the web to remove them. I
confirmed this with an old nroff from the Heirloom project.
Fixes Freedesktop #5214
It might be useful to write something like
sdkflags=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`
in configure.ac macros. Unfortunately, this will be blocked because
'PKG_CONFIG_SYSROOT' is a forbidden m4 pattern.
This patch extends the list of allowed pattern by the names of
documented pkg-config environment variables.
Avoids Msys path mangling that turns *nix paths (such as /usr/include) into
DOS-style absolute paths (such as c:/mingw/msys/1.0/include).
Allows mingw-built pkg-config to pass check-cflags.
Instead of hard-coding /usr/include, we now use the environment variable
PKG_CONFIG_SYSTEM_INCLUDE_PATH, defaulting to the argument of
./configure --with-system-include-path, which in turn defaults to
/usr/include.
Similarly, PKG_CONFIG_SYSTEM_LIBRARY_PATH defaults to /usr/lib or
/usr/lib:/usr/lib64 as appropriate.
(As currently implemented, this causes a behaviour change on Win32 -
the option -I/usr/include will now be filtered out.)
The intended usage is for Debian to configure pkg-config with
--with-system-include-path=/usr/include/$(DEB_HOST_GNU_TYPE):/usr/include
and the corresponding library path, for multiarch support
(<http://bugs.debian.org/482884>).
Based on work by Colin Walters <walters@verbum.org>
--exists no longer does a full depth traversal, which means we need to
pay attention to the exit status when calling pkg-config --libs and
--cflags. If those fail, we run with --cflags and --libs to get the
error message before printing it out.
Fixes Freedesktop #36039