Commit graph

312 commits

Author SHA1 Message Date
Dan Nicholson
fd77d7690b Remove unneeded checks for setresuid & setreuid
These were used in the popt code a long time ago. pkg-config has no need
to be checking your uid.
2012-05-29 17:17:16 -07:00
Dan Nicholson
dfd03ae23e Use g_alloca instead of fooling around with platforms ourselves
Glib has been providing a g_alloca wrapper that handles all the platform
specifics since at least glib-1.3. Use it.
2012-05-29 16:41:17 -07:00
Dan Nicholson
5c219ca67d Makefile cleanup
No functional change, but makes things a little cleaner.
2012-05-23 05:47:26 -07:00
Javier Jardón
7a8cc77163 Update autotools configuration
Replace deprecated macros and use the new libtool syntax. The required
versions of the tools have been bumped up to match the versions of the
bundled glib. This was effectively the requirement, anyway. The new
required autotools versions are:

autoconf-2.62 (released 2008-04-08)
automake-1.11 (released 2009-05-17)
libtool-2.2 (released 2008-03-01)

Also use silent rules to quiet the build a bit.

Freedesktop #34382
2012-05-23 05:45:20 -07:00
Dan Nicholson
d575f1e5ea Remove unneeded acconfig.h, suppressing warnings from autoheader
acconfig.h was being used to undefine some macros, but these aren't
actually used anywhere in the pkg-config code. I suspect this was a
holdover from when glib-1 was used internally. glib does define some
similar macros, but that code is all self-contained there and not
anything we need to worry about in pkg-config.
2012-05-22 05:46:16 -07:00
LRN
7ac6f32625 Don't use deprecated glib function to construct path on win32
g_win32_get_package_installation_subdirectory() has been deprecated
since GLib 2.18 and in recent (2.31) GLib versions disabled entirely by
default. This patch replaces usage of that function by
g_win32_get_package_installation_directory_of_module() and
g_build_filename(). Use the new functions and rework the code a bit so
it leaks less memory.

g_win32_get_package_installation_directory_of_module() is supported
since GLib 2.16. The minimal GLib version is bumped accordingly.

Freedesktop #45742
2012-05-21 21:08:49 -07:00
Dan Nicholson
b87359cc9b Kill unused result variable
Gets rid of a compiler warning.
2012-05-18 09:44:49 -07:00
LRN
a80fbc5200 Fix win32 README
A simple documentation fix (reflecting the fact that pkg-config is not
being built against glib-1.2 anymore).
2012-05-18 09:14:08 -07:00
LRN
d415d91713 Fix test --define-variable invocation to avoid MSYS path mangling
Otherwise tests won't pass when running in MSYS.
2012-05-18 09:14:08 -07:00
Dan Nicholson
ee1737eb41 Clean up some of the autoconf usage
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.
2012-05-15 02:44:14 -07:00
Dan Nicholson
cfaffdc570 glib: Remove check for FAM only needed in GIO
One less thing for people to worry about with bundled glib.
2012-05-14 16:09:39 -07:00
Dan Nicholson
ad561f6163 Document cross-compiling with the bundled glib
Freedesktop #11464
2012-05-14 16:09:29 -07:00
Dan Nicholson
e2e118ec32 Ease glib cross-compiling requirements
Since we're building only glib, we don't need any of the auxiliary
tools.
2012-05-14 15:57:12 -07:00
Dan Nicholson
5c2675eb81 Don't --enable-maintainer-mode from autogen.sh
Maintainer mode was removed some time ago, so setting it from autogen.sh
has no effect.
2012-05-14 14:51:25 -07:00
Dan Nicholson
fd4d40b94e Drop popt usage and remove unused popt sources
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
2012-05-14 14:19:10 -07:00
Dan Nicholson
e91ab1009a Convert to GOption for command line option parsing
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.
2012-05-14 14:19:10 -07:00
Dan Nicholson
02d99c6ab1 Use glib to parse argv strings instead of 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.
2012-05-14 14:19:10 -07:00
Dan Nicholson
e8e6ee258e Make sure glib really doesn't need the gdb script
Fixes distcheck.
2012-05-14 14:18:36 -07:00
Bryan Kadzban
e512071cae popt: Reset long argument handling before iterating to next argument
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
2012-05-10 09:28:55 -07:00
Dan Nicholson
5745e1ba08 glib: Keep a few more programs from being installed or generated 2012-05-10 09:08:18 -07:00
Dan Nicholson
c34906923f Make sure dist is only run --with-internal-glib
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.
2012-05-10 08:40:11 -07:00
Dan Nicholson
64647b10a9 Conditionally add glib to DIST_SUBDIRS to fix distclean
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.
2012-05-10 08:23:08 -07:00
Dan Nicholson
fb458a87b9 Revert "Make sure glib subdir is configure before dist"
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.
2012-05-10 08:16:14 -07:00
Dan Nicholson
b32156ab2b glib: Update snapshot to 2.32.2
A libelf pkg-config check creeped in, but it's only used in gio so we
can remove the libelf check completely.
2012-05-10 08:14:11 -07:00
Dan Nicholson
bde0ffb444 Document a couple more pkg-config options 2012-05-10 07:56:34 -07:00
Lawrence A. Murakami
e10eee3c00 Fix errors in man page source cause missing content
Freedesktop #29011
2012-05-10 06:02:17 -07:00
Dan Nicholson
a83a14c291 Unify handling of operator and command line option version checking
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
2012-05-10 05:51:35 -07:00
Dan Nicholson
5fc77a96b7 Add autoconf macros to help packagers install .pc files
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
2012-05-10 05:34:49 -07:00
Dieter Verfaillie
79c768aadf Revert "Print out \r\n on windows, not just \n"
This reverts commit 25e8ca84ac. This was
working around a bug with mingw/msys shell which seems to be fixed now.

Freedesktop #17053
2012-05-05 10:49:58 -07:00
Dan Nicholson
6485a160fe Document building with the internal glib copy 2012-04-21 12:52:58 -07:00
Dan Nicholson
1860fc8036 Make sure glib subdir is configure before dist
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.
2012-04-21 12:48:24 -07:00
Dan Nicholson
c74da521af Use a bundled glib2 to avoid circular dependency
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.
2012-04-21 12:46:32 -07:00
Dan Nicholson
75755ba614 glib: Avoid pkg-config usage in bundled library
The whole exercise of carrying an internal copy of glib to avoid the
circular dependency is moot if it's still using pkg-config.
2012-04-21 12:46:32 -07:00
Dan Nicholson
2664821630 glib: Don't build GRegex or distribute pcre
In order to avoid the bundled pcre in our bundled glib, just remove and
disable the GRegex API. We don't currently need this in pkg-config
anyway.
2012-04-21 12:46:32 -07:00
Dan Nicholson
9ea8a68ccd glib: Set automake to foreign so it doesn't bomb on missing files 2012-04-21 12:46:32 -07:00
Dan Nicholson
f8d5ff5d29 glib: Don't install anything from the bundled library
All we want is the libglib.la convenience library. The -version-info is
removed since it causes warnings.
2012-04-21 12:46:32 -07:00
Dan Nicholson
7c54f7ca1e glib: Remove as many unneeded files as possible
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
2012-04-21 12:46:31 -07:00
Dan Nicholson
c23f6a6ef3 glib: Bundle snapshot of glib-2.0
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.
2012-04-21 12:46:31 -07:00
Dan Nicholson
9961b85d2a glib: Add a script to take a snapshot of glib-2.0
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.
2012-04-21 12:46:31 -07:00
Dan Nicholson
c96d5e3172 Remove unused roff macros causing problems on old groff/nroff
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
2012-04-16 17:14:53 -07:00
Tollef Fog Heen
b93f795848 Fix typo in configure.ac which led to confusing error messages from configure 2011-09-20 08:50:51 +02:00
Tollef Fog Heen
cbc7eec2e5 Document how to build with circular build-deps.
Freedesktop #37266
2011-05-16 21:47:38 +02:00
Tollef Fog Heen
1d1d7ce414 Drop AM_MAINTAINER_MODE 2011-05-15 14:32:10 +02:00
Tollef Fog Heen
097eaeb70e Run distcheck against installed popt 2011-05-15 14:32:02 +02:00
Tollef Fog Heen
85662d26ba Document changes for 0.26, bump version 2011-05-15 14:24:19 +02:00
Enrico Scholz
4939bdb9a6 Allow documented environment variables in autoconf
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.
2011-05-15 14:20:17 +02:00
Tollef Fog Heen
b02c40bca4 Only treat real files (or symlinks to real files) as .pc files
Ignore any dangling symlinks.  Thanks to Ciaran Anscomb for patch
inspiration.

Fixes Freedesktop #23922
2011-05-15 14:08:21 +02:00
Tollef Fog Heen
beb55100ea Ignore emacs backup files 2011-05-15 11:06:50 +02:00
Tollef Fog Heen
7c45ef3c84 Drop dead code 2011-05-15 11:05:42 +02:00
Tollef Fog Heen
1363621467 Document specifying paths to .pc files
Thanks to Binki for the patch

Freedesktop #32622
2011-05-15 10:34:01 +02:00