Commit graph

513 commits

Author SHA1 Message Date
Tollef Fog Heen
d97db4fae4 Update URL for bug reporting
Fixes: #64
2021-01-24 20:42:36 +01:00
Tollef Fog Heen
eb866ade77 Spelling and grammar in pkg.m4
Fixes: #27
2020-04-21 20:52:02 +02:00
Tollef Fog Heen
1f81c8004b Fix spelling of rra's name 2020-04-21 20:50:40 +02:00
Tollef Fog Heen
350515e885 Use https for developer.gnome.org URL 2020-04-21 20:49:00 +02:00
Tollef Fog Heen
834ecc2f58 Update bug reporting URL to point to gitlab 2020-04-21 20:48:43 +02:00
Ting-Wei Lan
38936b2b2a Call setlocale in main function
If setlocale isn't called, GNU gettext will try to convert translated
text to ASCII because the default locale is C. It isn't always possible
and it causes question marks to be shown on FreeBSD.
2019-06-23 22:37:54 +08:00
Philip Withnall
2ad16fa7ac pkg: Make ordering of output from print_package_list() deterministic
The iteration order of GHashTable changed in GLib 2.59, which broke the
check-print-options test, as it relied on a fixed output order from the
--list-all argument to pkg-config.

Fix that by making print_package_list() output in alphabetical order by
Package.key; and update the test to match. This should work with older
and newer versions of GLib.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-03 13:04:38 +01:00
Dan Nicholson
2dd2b19944 parse: Don't emit unknown keyword warning for Libs.private
Requires.private and Libs.private are skipped unless --static is in use.
However, the parser was checking for Libs.private and this option in a
single conditional unlike Requires.private. This was making the check
fall through to the else and emit an "Unknown keyword" debug message
when --static was not used. This was harmless but not true.

https://bugs.freedesktop.org/show_bug.cgi?id=99770
2017-04-07 09:17:28 -05:00
Dan Nicholson
edf8e6f0ea Update to 0.29.2 2017-03-20 12:05:36 -05:00
Dan Nicholson
677e924875 pkg.m4: Bump the serial number for release
There aren't any significant changes here, but this will cause aclocal
to get the latest version.
2017-03-20 12:03:09 -05:00
Dan Nicholson
df6e4b6cf1 pkg: Check INCLUDE environment variable for MSVC
On Windows builds when --msvc-syntax is in use, add paths in the INCLUDE
environment variable to the system include search path and ignore the
various GCC environment variables. See
https://msdn.microsoft.com/en-us/library/73f9s62w.aspx for details.

https://bugs.freedesktop.org/show_bug.cgi?id=94729
2017-03-20 11:34:02 -05:00
Dan Nicholson
1dfe95b8b8 check: Add test for system flags pruning
Test that pkg-config respects the various environment variables that
override the system flags handling.

https://bugs.freedesktop.org/show_bug.cgi?id=94729
2017-03-20 11:06:00 -05:00
Dan Nicholson
309c1787a1 Ignore automake's compile wrapper 2017-03-20 10:05:16 -05:00
Dan Nicholson
d5d8074893 Respect sysroot for -isystem and -idirafter
Treat -isystem and -idirafter as -I Cflags since they control the
compiler search path. Adjust the sysroot handling so that the arguments
to these options have the sysroot prefixed. However, leave them out of the
system Cflags handling since these directives are explicitly trying to
adjust the compiler's system header search behavior.

The special-flags test case output needs adjustment since all the flags
are now considered -I flags and come out in the order specified in the
pc file.

https://bugs.freedesktop.org/show_bug.cgi?id=97337
2017-03-20 07:13:23 -05:00
Dan Nicholson
7707d2ff33 check: Include special-flags in sysroot test
Make sure that the sysroot behavior works right when we have non-I/L
flags to consider.

https://bugs.freedesktop.org/show_bug.cgi?id=97337
2017-03-20 07:13:23 -05:00
Dan Nicholson
a737256219 check: Add more flags to the special-flags test
Make sure that all the flag types are covered so that the ordering
between them is being tested.

https://bugs.freedesktop.org/show_bug.cgi?id=97337
2017-03-20 07:13:23 -05:00
Dan Nicholson
64cbed9884 glib: Fix bundled build with GCC 6
Backport two patches from upstream glib to handle -Wformat-nonliteral
included by default with GCC 6. Ideally the snapshot should be updated,
but this fix the issue until that happens.

https://bugs.freedesktop.org/show_bug.cgi?id=95326
2017-03-20 06:01:57 -05:00
Dan Nicholson
325ddf2f4b man: Document PKG_PROG_PKG_CONFIG conditional issue there
The issue of PKG_PROG_PKG_CONFIG being run first from a conditional
affects more than PKG_CHECK_MODULES and PKG_CHECK_EXISTS since
PKG_PROG_PKG_CONFIG is AC_REQUIRE'd from many other macros. Describe the
issue completely in the PKG_PROG_PKG_CONFIG section.
2017-03-20 06:51:27 -05:00
Dan Nicholson
99ef6fd55a man: Fix PKG_CHECK_EXISTS comment about PKG_PROG_PKG_CONFIG
The sentence is clearly referring to the issue of running
PKG_PROG_PKG_CONFIG from outside of a conditional. Thanks to Reuben
Thomas for the suggestion.

https://bugs.freedesktop.org/show_bug.cgi?id=99885
2017-03-20 06:48:14 -05:00
Peter Eisentraut
f88710d3e1 m4: Fix indentation
The pkg-config source code is full of weird whitespace, the sort that
git diff --check would complain about. Attached is a small patch that
cleans this up in pkg.m4 so that it doesn't propagate into other
packages.

https://bugs.freedesktop.org/show_bug.cgi?id=99522
2017-03-19 12:50:16 -05:00
Dan Nicholson
7f4afa0214 man: Put valid make syntax in the example
Use backquotes for substitution in the Makefile example as using the $()
form of command substitution would actually use make's variable
substitution and fail. Thanks to joerg.strebel@gmail.com for the report.

https://bugs.freedesktop.org/show_bug.cgi?id=98011
2017-03-19 12:47:50 -05:00
Russ Allbery
3b96e7434c Make PKG_CHECK_MODULES report the module name instead of the variable prefix
In Autoconf output from PKG_CHECK_MODULES in pkg.m4, the "checking for"
message refers to the first argument of PKG_CHECK_MODULES, the variable
prefix, instead of the second argument, the module being checked for.

This results in strange output (like ALL CAPS module names) in various
packages. And when probing for modules, one can't always use a variable
prefix that matches the module name (since ‘-’ and other characters
aren't allowed in variable names), so the Autoconf output is going to
refer to something odd.

The status output should reference the module name being probed for,
both because it looks nicer and because, when debugging problems, this
references the actual thing being probed for on the system, rather than
an internal implementation detail.

Signed-off-by: Guillem Jover <guillem@hadrons.org>

https://bugs.freedesktop.org/show_bug.cgi?id=98334
2017-03-19 09:56:25 -05:00
Dan Nicholson
c424a4cf37 man: Document system search path environment variables
None of the environment variables affecting the system include and
library paths were documented. This includes the pkg-config specific
variables like PKG_CONFIG_SYSTEM_INCLUDE_PATH as well as the GCC
variables like C_INCLUDE_PATH.

https://bugs.freedesktop.org/show_bug.cgi?id=99224
2017-03-19 09:37:22 -05:00
v4hn
4ade8fc901 pkg: Include CPATH in header search path
Look for the CPATH environment variable when constructing the -I header
search path like GCC does. See
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html.

https://bugs.freedesktop.org/show_bug.cgi?id=99224
2017-03-19 09:13:59 -05:00
Marco Diego Aurélio Mesquita
c53385b5db Optimization to load only needed .pc files
Currently pkg-config scans all .pc files from the search path during
initialization. That makes some of the code simpler and works fine when
there are not many .pc files on the system. When there are a lot of .pc
files, then this represents a lot of wasted effort.

Rework the package gathering so that it happens as needed. To support
the --list-all mode, the scanning at initialization can still be done.

https://bugs.freedesktop.org/show_bug.cgi?id=98215
2016-12-22 13:29:12 -06:00
Ross Burton
a38d5c58a1 pkg.m4.in: use correct comments for aclocal serial
aclocal requires that serial numbers are on a line commented out with hashes not
dnl, so change the commenting style on the first two lines.

https://bugs.freedesktop.org/show_bug.cgi?id=97615
2016-09-06 09:24:53 -07:00
Dan Nicholson
bbbdab4c60 Don't override empty prefix setting
If the original prefix setting is empty, skip prepending the redefined
prefix to other variables. This works the same as if the pc file doesn't
have a prefix variable at all.

https://bugs.freedesktop.org/show_bug.cgi?id=97453-empty
2016-08-30 09:41:54 -07:00
Matan Nassau
091722179b autogen: consider configure error 2016-08-22 15:08:43 -07:00
Dan Nicholson
983052ddf8 Remove unused package_list_strip_duplicates
After 908cdd0, there are no more duplicates in the package list and this
function is unused.
2016-08-22 14:36:50 -07:00
Matthew Hanna
908cdd062a Improve performance of package list expansion
Adds a hash table to the package list expansion to avoid iterating over
the children of package nodes that have already been visited. Without
this, the expansion is exponential. For library sets with a high degree
of dependency, iteration over the tree with revisiting results, in
practice, in significant slow down at best and pkg-config failure due to
memory exhaustion at worst. The resulting algorithm is equivalent to a
topological sort.
2016-08-22 14:34:30 -07:00
Dan Nicholson
87152c05be Update to 0.29.1 2016-03-01 11:40:15 -08:00
Dan Nicholson
753f0ba1e9 glib: Fix OSX build with internal glib
In the last internal glib update, the glib configure script changed the
OSX framework flags from the form of "-framework Foo" to
"-Wl,framework,Foo". Unfortunately, libtool only understands the prior
form and doesn't include the appropriate -framework flags in the
libglib-2.0.la file. This ultimately causes pkg-config to fail to link
properly:

Undefined symbols for architecture x86_64:
  "_CFRelease", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFStringGetCString", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFStringGetCStringPtr", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFStringGetLength", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFURLCopyFileSystemPath", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_CFURLCreateFromFSRef", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_FSFindFolder", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
  "_kCFAllocatorSystemDefault", referenced from:
      _find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
ld: symbol(s) not found for architecture x86_64

Upstream has fixed this by including the new style -framework flags in
the glib-2.0.pc file. We can't use that here as we're bootstrapping
pkg-config itself. Rather than work around this with an OSX platform
check in pkg-config's configure, carry a downstream patch to revert
glib's configure to using the old format.

https://bugs.freedesktop.org/show_bug.cgi?id=92902
2016-03-01 11:28:35 -08:00
Dan Nicholson
5164b9dbab Revert "Quote pc_path virtual variable"
This reverts commit a6e8749ada. With the
--variable output only being unquoted when it appears needed, this can
return to being a normally defined value.

https://bugs.freedesktop.org/show_bug.cgi?id=93284
2016-02-26 08:56:52 -08:00
Dan Nicholson
a3e58e7d4d check: More thoroughly test variable usage
Add some more tests for handling unusual variables such as those that
are quoted or that contain shell characters. This should help make the
--variable output more reliable in the future.

https://bugs.freedesktop.org/show_bug.cgi?id=93284
2016-02-26 08:56:52 -08:00
Dan Nicholson
1c564a3583 Only unquote --variable when it appears quoted
The change to unquote values in the --variable output broke users that
had shell special characters in the variable. Instead, only unquote if
the value starts with " or '. A larger fix to do a full unquote, split
and escaping like --cflags/--libs is possible, but that might break the
old semantics even further.

Add a new function, parse_package_variable(), to handle that logic.

https://bugs.freedesktop.org/show_bug.cgi?id=93284
2016-02-26 08:56:52 -08:00
Dan Nicholson
e6d33fb129 Revert "Unquote values of requested variables"
This reverts commit 50c2867f4a.
g_shell_quote doesn't match the quoting behavior of pkg-config when the
same variables are output via --cflags and similar.

https://bugs.freedesktop.org/show_bug.cgi?id=93284
2016-02-26 08:52:25 -08:00
Dan Nicholson
8d19fad1a0 Also match -Wl,-framework for OSX framework
Freedesktop #1278 (https://bugs.freedesktop.org/show_bug.cgi?id=1278)
2016-01-29 14:44:34 -08:00
Alexander Larsson
ae0a8b1ad5 Allow overriding package variables with env vars
pkg-config allows a way to override package variables through the
--define-prefix interface, but this is very cumbersome to do in a global
way since it always needs to be passed on the command line and the
override cannot be scoped to a single packge.

Allow overriding package variables using environment variables of the
form PKG_CONFIG_$PACKAGE_$VARIABLE. For example, setting
PKG_CONFIG_GLADEUI_2_0_CATALOGDIR will override the variable
"catalogdir" in the "gladeui-2.0" package.

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2016-01-29 14:32:24 -08:00
Alexander Larsson
9ef2d3475d Pass key into parse_package_key so it can be set early
We will need this to properly pick up environment-overridden
per-package vairables.

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2016-01-29 14:25:21 -08:00
Chun-wei Fan
52baea8489 README.win32: Add info on building with MSVC 2015-10-28 08:39:10 -07:00
Chun-wei Fan
5f70074d46 build: Add NMake makefiles for Visual Studio builds
This adds a set of NMake Makefiles that can be used to build pkg-config on
Windows using Visual Studio.  Note that, since the Visual Studio builds of
GLib does not use pkg-config, this NMake Makefile set does not support the
build of the bundled GLib sources, instead, having GLib built beforehand
is required.
2015-10-26 09:16:56 -07:00
Chun-wei Fan
1ed336759f build: Add a pre-configure config.h template for MSVC builds
This adds a pre-configured config.h(.win32.in) that can be used for builds
on Visual Studio, where autotools is normally not available, so that we
can build pkg-config on Visual Studio.
2015-10-26 09:16:27 -07:00
Chun-wei Fan
56061ef3ef build: Split Out Source Listing
Move the source listing into another Makefile module so that it can be
shared with other Makefile-based build mechanisms.
2015-10-26 09:15:53 -07:00
Chun-wei Fan
dd57ff3547 pkg.c: Port from dirent to GDir
Port the code to use the GDir APIs from dirent so that we don't have to
depend on a dirent implementation on platforms that do not have it, such
as Visual Studio, so that it is possible to build pkg-config out of the
box on any platform that is supported by GLib (and the bundled GLib).
2015-10-26 09:15:53 -07:00
Dan Nicholson
5914edfe96 Update to 0.29 2015-09-26 21:14:47 -07:00
Dan Nicholson
56c9d85369 m4: Change all comment markers to dnl
Using # leaves the comments within the generated configure file, which
is just unnecessary bloat since no one would read the generated
configure file for the documentation of the macros.
2015-09-26 21:08:45 -07:00
Dan Nicholson
5e786130a5 m4: Add Since releases and cleanup comments
Note which release each macro was added in and cleanup the comments to
be more consistent between them.
2015-09-26 20:58:25 -07:00
Dan Nicholson
d5c6358eda m4: Update serial to 11
This was determined by counting the number of changes to pkg.m4 since
the initial serial number was added. The trailing comment is also
updated to have the version number substituted.
2015-09-26 19:56:40 -07:00
Dan Nicholson
b51cd2165d m4: Add PKG_PREREQ version checking macro
While PKG_PROG_PKG_CONFIG checks the version of pkg-config available at
build time, it doesn't check the version of the pkg-config macros being
used. PKG_PREREQ (like AC_PREREQ or LT_PREREQ) can be used to check the
version of the macros in use when configure is being generated by the
developer.

https://bugs.freedesktop.org/show_bug.cgi?id=89267
2015-09-26 15:02:36 -07:00
Dan Nicholson
7e8b0bf6d9 m4: Process pkg.m4 through AC_CONFIG_FILES
Currently there are no substitutions needed in pkg.m4, but this will
allow autoconf values such as the package version to be included.
2015-09-26 15:01:37 -07:00