Commit graph

344 commits

Author SHA1 Message Date
Dan Nicholson
aba2c047cf check: Enhance --print-requires tests
Make the --print-requires and --print-requires-private tests actually
resolve Requires and output a specific version test.
2012-10-02 05:51:22 -07:00
Dan Nicholson
0e6ea44d68 check: Check path handling
Add a test for pkg-config's path handling. The first test covers
PKG_CONFIG_PATH, and the second covers the built-in path. For this one
we need to unset the PKG_CONFIG_LIBDIR that normally is set during the
tests. Since we can't rely on the contents of the default path, we just
check to see that the built-in path matches what was specified in
configure. To do this, we need to add a bunch of variables to config.sh
so the variable resolves. These variables don't need to be exported,
though.
2012-10-02 05:51:22 -07:00
Dan Nicholson
c7e12356bc check: Exercise all printing options
Add tests for checking the output of various options that print
information. For --list-all, a subdirectory with only two packages has
been added so that its output doesn't change when more test packages are
added to the check directory.
2012-09-29 09:57:46 -07:00
Dan Nicholson
31a9f900e1 check: Test --define-variable corner cases 2012-09-29 09:09:30 -07:00
Dan Nicholson
397d414a6a check: Pass args to test function instead of setting in variable
The run_test shell function was running pkg-config with arguments stored
in an environment variable. This has problems when trying to pass shell
special characters with the proper escaping. Instead, pass the arguments
to the test where they can maintain correct formatting through use of
the special variable "$@".
2012-09-29 08:50:57 -07:00
Dan Nicholson
e68baa7463 Add optional usage of gcov for test coverage
Use gcov to find how much code coverage our current testing gets. This
can be enabled by passing --with-gcov to configure and running "make
gcov". This is limited to gcc. Here's a run from the current code (for
some reason, gcov insists on profiling gstring.h).

/usr/bin/gcov pkg.h pkg.c parse.h parse.c main.c
File 'pkg.c'
Lines executed:73.16% of 611
pkg.c:creating 'pkg.c.gcov'

File '/usr/include/glib-2.0/glib/gstring.h'
Lines executed:100.00% of 6
/usr/include/glib-2.0/glib/gstring.h:creating 'gstring.h.gcov'

File 'parse.c'
Lines executed:79.67% of 492
parse.c:creating 'parse.c.gcov'

File 'main.c'
Lines executed:57.34% of 293
main.c:creating 'main.c.gcov'
2012-09-28 05:45:37 -07:00
Dan Nicholson
a35c3fc95e Update news and bump version for release 2012-08-24 06:03:54 -07:00
Dan Nicholson
1baefdf7d6 Discourage repeated usage of VARIABLE-PREFIX in PKG_CHECK_MODULES
When the VARIABLE-PREFIX tag is used more than once in PKG_CHECK_MODULES
it can result in later runs reporting success without actually running
pkg-config. This is because PKG_CHECK_MODULES looks for FOO_CFLAGS and
FOO_LIBS from the environment as a way to allow users to override the
test. PKG_CHECK_MODULES also sets these variables, though, and
subsequent calls will simply use these values.

Although there are legitimate ways to use the same VARIABLE-PREFIX
(e.g., they're all under conditionals meaning only one will be used),
document that repeated usage is not recommended.

Freedesktop #3550
2012-08-22 11:35:13 -07:00
Dan Nicholson
617963c55e glib: Update snapshot to 2.32.4
This gets us to the latest stable release for glib and probably a good
stopping point for a while since the 2.32 series seems to be slowing
down.
2012-08-22 05:53:32 -07:00
Dan Nicholson
f8978af7bf glib: Really force static only building
Making --enable-static --disable-shared the default fixes most cases,
but build environments often pass --enable-shared --disable-static for
all autotooled projects. Force static building by setting the
appropriate variables as if they've come from the command line
parameters.
2012-08-21 06:32:16 -07:00
John Stumpo
f57fafe1d1 Escape spaces in autodetected ${prefix} values on Windows
Without this, if the new ${prefix} path contains spaces, they are not
properly quoted in pkg-config's output. Besides the problems this causes
with things using the output, this also causes nonsensical results when
pkg-config splits such options to combine equal options.
2012-08-21 05:49:07 -07:00
Dan Nicholson
78b419a3df Specify pkg-config to test with from make
By specifying the pkg-config to use for testing from make, we can easily
control its path and add the .exe extension for Windows. It also allows
easy testing of another pkg-config from make:

  make check TESTS_PKG_CONFIG=/usr/bin/pkg-config
2012-08-19 08:49:58 -07:00
Dan Nicholson
305913a6b1 Handle POSIX shell for tests in configure and Makefile
Although the trick of finding a POSIX shell in the system PATH works
fine most of the time, it has some drawbacks.

* The commands must be copied into every test script.
* The scripts are always forced to re-execute themselves.
* There's no guarantee the sh found in `getconf PATH` is a POSIX shell
  and there's no way to override it.

Move the handling of this shell to configure where we can detect it
once. This gives preference to bash and ksh since they're typically
POSIX compatible. It also uses the current PATH with the getconf PATH at
the end which should allow things to work on platforms where getconf
might not be available like mingw/msys.

By specifying the shell in TESTS_ENVIRONMENT, automake will run each
script with this shell and we can drop the re-exec dance.
2012-08-19 08:03:00 -07:00
Dan Nicholson
4bce8b46b2 Exit on errors for check-missing like others
This ensures that the make shows FAIL in case one test fails and a
subsequent one succeeds.
2012-08-19 07:34:35 -07:00
Dan Nicholson
cf9089f5ec glib: Fix static usage of glib on win32
When glib is built static, the threads and clock code are not
initialized since DllMain is never run. Instead, initialize them from
the glib constructor.

https://bugzilla.gnome.org/show_bug.cgi?id=678387
2012-08-17 11:37:04 -07:00
Dan Nicholson
f0e821fed2 glib: Remove usage of gettext/libintl/iconv
pkg-config doesn't use message translation, so there's no need to build
it into the bundled glib. Furthermore, when not using glibc, this drags
in extra dependencies on gettext, libintl and iconv. Remove their usage
in two steps:

1. Don't include libintl.h directly from code. glibintl.h
conditionalizes the include of libintl.h based on the ENABLE_NLS define
and creates fallback macros when it's unwanted.

2. Remove the usage of the gettext macros in glib's configure.ac. This
ensures that the unwanted dependencies aren't searched for. Two defines
are kept around to keep the code happy.
2012-08-17 09:03:55 -07:00
Dan Nicholson
51468f2a9b Ignore patch backup files
When reapplying the glib patches we often end up with .orig files when
the hunks have moved. Any backup suffix is possible, but this is the
default from patch(1).
2012-08-17 08:18:40 -07:00
Dan Nicholson
b168e4f843 Ignore generated config.cache files 2012-08-17 08:16:16 -07:00
Dan Nicholson
f95579d268 glib: Ensure only static build is performed
Since we're going to use glib as a convenience library, we need to make
sure it builds as if --enable-static was passed. This only matters on
Windows where a couple extra macros are defined and the DLL machinery is
disabled.
2012-08-17 08:12:49 -07:00
Dan Nicholson
58b6b2d995 glib: Don't install charset.alias file
On non-glibc systems a charset.alias file is installed, but we don't
need this for our purposes.
2012-08-16 09:36:16 -07:00
Dan Nicholson
8bdf2df690 Ignore Windows executables 2012-08-16 09:30:03 -07:00
Dan Nicholson
a870b63b31 Document failure to build internal glib as OS X universal binary
GLib out of the box does not support being built for multiple arches.
This means pkg-config using the internal glib can't be built as a
universal binary on OS X. Document this and available workarounds.

Freedesktop #52032
2012-08-14 16:39:47 -07:00
Dan Nicholson
7178b2e041 glib: Remove check for tracing support
If dtrace or systemtap is installed glib will enable tracing
automatically. Remove the check to always disable tracing.

Freedesktop #53493
2012-08-14 15:16:35 -07:00
Dan Nicholson
40dc57fb41 glib: Don't install m4 macros
Freedesktop #52031
2012-08-13 20:40:27 -07:00
Dan Nicholson
234da3983b Update NEWS and bump version for 0.27 2012-07-11 05:28:10 -07:00
Dan Nicholson
3ead3dfb78 Enable Requires and Requires.private for --exists
Prior to pkg-config 0.24, --exists honored Requires and
Requires.private. This was regressed in commits 02d5ae3f and 669bfe2e,
which split the handling of Requires and Requires.private out more
correctly for other options. This adds exists to the group of options
that enable the Requires functionality.

Freedesktop #43149
2012-07-11 05:24:23 -07:00
Dan Nicholson
a077e02430 Make check-missing test more explicit with --exists
Currently the check-missing passes the packages on the command line with
no options prior to running through --cflags/--libs, etc. Make this more
explicitly pass --exists since this is a much more common operation
performed from PKG_CHECK_MODULES.

The expected result of 0 when Requires or Requires.private is missing is
a regression from pre-0.24 pkg-config.
2012-07-11 05:24:23 -07:00
Dan Nicholson
6c27d5051b glib: Restore gettext with libintl support
Until the needed surgery is done to remove gettext support from the
internal glib (since pkg-config doesn't need it), make sure that libintl
is linked in when necessary.
2012-06-04 15:21:25 -07:00
Dan Nicholson
533de22bae Add a configure message about internal glib to tip people off 2012-06-04 11:01:03 -07:00
Dan Nicholson
c47c09177f glib: Update snapshot to 2.32.3
There doesn't appear to be any changes in the code pkg-config uses. Just
keeping in sync.
2012-06-04 09:08:33 -07:00
Dan Nicholson
d11df7ffe0 Ensure test search path is confined to check directory
If only PKG_CONFIG_PATH is set when running the tests, we'll still pick
up packages from the system default path. By overriding that with
PKG_CONFIG_LIBDIR and unsetting PKG_CONFIG_PATH, the path is forced to
the check directory.
2012-05-30 05:49:14 -07:00
Dan Nicholson
5345892b8e Always use g_free when allocating memory from glib 2012-05-29 17:17:55 -07:00
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