| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pkg-config strips all duplicate arguments from the flag output string.
This is done for 2 reasons:
1. When a package shows up twice in the final package list after
resolving all Requires, stripping was used to ensure it's flags only
showed up once at the correct location.
2. An optimization so that the output string is not excessively long.
Since commit c6ec7869, 1. is no longer necessary as the final package
list only contains each package once. 2. causes problems when applied
too aggressively since some arguments have different semantics depending
on the prior or subsequent arguments.
To keep a bit of optimization, the stripping is reduced to only removing
consecutive duplicate arguments. This should ensure that the semantics
are kept intact while removing obviously unnecessary arguments.
The drawback is that some arguments will now appear multiple times in
the output when they previously would have only appeared once. Here we
have to rely on the tools using these arguments to handle the duplicates
appropriately since there is no way for pkg-config to encode all the
semantics of those arguments. Another thing that can help this situation
is if pkg-config is used for all packages in the Requires chain so that
the Libs/Cflags of each package only pertain to itself and don't encode
the compiling/linking rules of a 3rd party package.
Freedesktop #16101 (https://bugs.freedesktop.org/show_bug.cgi?id=16101)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Often other Libs flags have semantics that are based on their context
with -l arguments. For example, the GNU linker options
-Bdynamic/-Bstatic pertain only to the objects or link options that
follow them. So, a valid link command containing these options would get
mangled by pkg-config since it separates -l flags from others..
-Bdynamic -la -Bstatic -lb -> -Bdynamic -Bstatic -la -lb
Instead, output -l and other Libs flags in a single pass so they mantain
their ordering.
Freedesktop #19950 (https://bugs.freedesktop.org/show_bug.cgi?id=19950)
|
|
|
|
|
|
|
| |
Outputting other Libs flags such as -Wl,foo just prior to the -l Libs
flags gives a better chance the --libs output will be correct. This
should be no change in the usage of the output since pkg-config
currently groups all flag types together.
|
|
|
|
|
|
|
|
| |
For some flags, pkg-config will sort them by the depth of their .pc path
before outputting. The idea is that flags from a deeper path should come
earlier in the command line. This makes sense for -L and -I flags, but
not for generic linker and compiler flags. For these flags and -l flags,
it makes sense to sort them only by package order.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to commit 6ecf318, the resolved list of required packages was
built in an appending way where each package on the command line or in
Requires would appear in the list in the order they appeared. With
6ecf318, that list building was changed to prepending, which had a
subtle change on the resolved order.
For example, suppose package a has "Requires: b c d". Previously, the
list would be built as a->b->c->d by appending each as they were
encountered. Now, the list is built by walking all the way down the
dependency chain for each package in a depth first manner and prepending
packages while unwinding. This would result in the package ilst being
a->d->c->b. This same effect happens with the command line packages
where previously requesting packages x and y would create a package list
of x->y and now produces a list of y->x.
While technically these should be the same since there are no
interdependencies, it's causes flags to be output in different order
than previously in pkg-config. This can be seen most readily in the
check-gtk test.
Instead, operate on the package lists backwards when building the
resolved package list.
|
|
|
|
|
|
|
|
|
| |
Makes the resolved package list be correctly serialized with each
package only appearing once. This provides more consistency between the
various flag outputs by ensuring that the flags from each package are
only grabbed once. This makes a difference since the duplicate flag
stripping happens from the end of the output (-l) or the beginning of
the output (-L/-I/other).
|
|
|
|
|
|
|
| |
Often the expected results for the indirect dependency tests fell behind
because it's not a typical test scenario. However, since the results are
always the same as --static, they can just use the same results and the
test can be run conditionally without --static based on configuration.
|
|
|
|
|
|
|
|
| |
The pkg-config testsuite has pretty good coverage of the implementation,
but it lacks a complex case that tests the interactions of non-trivial
.pc files. gtk is a very common package that meets this goal. This is a
snapshot from my F16 system, and it should provide a good way to see how
changes in the implementation regress a real world case.
|
|
|
|
|
|
|
| |
pkg-config aggressively strips all duplicate arguments from the final
output it builds. This is not only and optimization, but it also allows
the flag ordering to work correctly when a package on the command line
is required by another on the command line.
|
|
|
|
|
|
|
|
| |
The current tests are good at checking whether gathering the Cflags or
Libs from one or two packages works correctly, but they don't check the
sorting algorithm much at all. In particular, the interactions between
the package order in the Requires chain and in the path can make the
sorting of the flags subtly different.
|
|
|
|
|
|
|
|
|
| |
Use a bitmask to keep track of what Libs/Cflags to output. This makes it
simple to handle any combination of --cflags and --libs option variants.
A lot of excess code is removed in the process as all the flags options
can now be carried around in a single variable.
Freedesktop #54388 (https://bugs.freedesktop.org/show_bug.cgi?id=54388)
|
|
|
|
|
|
|
|
| |
Apparently g_hash_table_foreach doesn't check for NULL input, so make
sure we don't call it to print the variables if the variable list is
empty.
Freedesktop #54721
|
|
|
|
|
|
|
|
|
|
|
| |
After the packages are parsed, pkg-config recurses through all the
required packages to generate one list. Before descending another level,
check to see if the package has already been handled and skip it. This
allows packages to require each other circularly by breaking the loop.
A test has been added resolving a two level deep circular dependency.
Freedesktop #7331
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
recursive_fill_list() is used to order Requires and Requires.private,
but it relied on fill_one_level() to make the list adjustments as it
descended the package tree. There were two issues with this approach:
1. It added all the dependencies from a package immediately rather than
descending through each dependency first. This made it sort of mix
between depth- and breadth-first resolving.
2. It did not add the requested package to the list, forcing the caller
to add it.
This simplifies the code so that it descends all the way to the least
dependent package and prepends them as it unwinds. This ensures the
ordering will be sorted from most dependent to least dependent package.
Ordering of -l flags is corrected by a later sorting, but this fixes
ordering on non-l flags. Add a new test specifically for non-l Libs
flags.
Freedesktop #34504
|
|
|
|
|
| |
Verification of versions in Requires and friends happens differently
than the version comparison for command-line packages.
|
|
|
|
|
|
| |
Make sure that the --*-only-* variants of --cflags and --libs do the
right thing. This should probably be extended to cover a chain of
packages to get the ordering right, but this is good for now.
|
| |
|
|
|
|
|
| |
This might be a little fragile, but it makes sure to exercise the
debug_spew function.
|
|
|
|
|
|
|
| |
Test the usage of -uninstalled packages with two .pc files: inst.pc and
inst-uninstalled.pc. pkg-config should prefer the -uninstalled version
unless PKG_CONFIG_DISABLE_UNINSTALLED is set. It should also use the
default value of pc_top_builddir unless PKG_CONFIG_TOP_BUILD_DIR is set.
|
|
|
|
|
| |
Checks that pkg-config prepends PKG_CONFIG_SYSROOT_DIR to -I and -L when
they don't point to system directories.
|
|
|
|
|
| |
Test that --version prints the current version and
--atleast-pkgconfig-version validates it.
|
|
|
|
|
| |
Make the --print-requires and --print-requires-private tests actually
resolve Requires and output a specific version test.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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 "$@".
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This ensures that the make shows FAIL in case one test fails and a
subsequent one succeeds.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
No functional change, but makes things a little cleaner.
|
|
|
|
| |
Otherwise tests won't pass when running in MSYS.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
$(foo) is used for make escapes, so allow them through.
Freedesktop #33920
|
|
|
|
|
|
|
|
|
| |
The ancient bundled popt mishandles some cases of option parsing.
http://lists.freedesktop.org/archives/pkg-config/2010-March/000508.html
Add a test program to exercise it. This should encourage people to use
an external popt until we have a better fix.
|
| |
|
|
|
|
| |
Make sure we don't run into the bug fixed by 6a27c57 again.
|
| |
|
| |
|
|
|
|
| |
Various small fixes to make distcheck pass
|
|
|
|
|
|
|
|
| |
Allow paths and other components to contain shell metacharacters, but
escape them on output. White space has to be escaped in the input
files using quotes or backslashes
Freedesktop.org #3571
|
|
|
|
|
|
| |
Don't split -idirafter from its argument.
Fixes Freedesktop #23480
|
| |
|
|
|
|
|
|
| |
* check/check-missing, check/check-libs,
check/check-requires-private: Handle the case of indirect being
enabled correctly in checks.
|
|
|
|
|
|
| |
* check/common, check/config.sh.in, check/Makefile.am,
configure.in: Make it possible to check for configure variables in
the check scripts. So far, only direct/indirect is exposed.
|
|
|
|
|
|
| |
* pkg.[ch], main.c, check/check-missing: Don't recurse Requires at
all unless we need to. Add check. Again, thanks to Loïc Minier
for most of the idea and the implementation.
|
|
|
|
|
|
|
|
| |
* pkg.[ch], parse.[ch], main.c, check/Makefile.am,
check/check-missing, check/missing-requires-private.pc:
Skip Requires.private unless we need to look at them for cflags.
Add test case. Thanks to Loïc Minier for most of the idea and the
implementation. Debian #475031
|
|
|
|
| |
* check/common: Run all tests in the C locale
|