summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update NEWS and bump version for releasepkg-config-0.28Dan Nicholson2013-01-242-1/+32
|
* Fix srcdir != builddir error in check-debugDan Nicholson2013-01-231-1/+1
| | | | | Another fix for the fragile check-debug test where a message about adding to the pkg-config path expected '.' to be the srcdir.
* Remove $host-pkg-config when uninstallingDan Nicholson2013-01-231-0/+2
| | | | | Fixes an error from distcheck about files left in the destdir after uninstalling.
* Merge branch 'flag-order-fixes'Dan Nicholson2013-01-229-265/+198
|\
| * Only strip duplicate arguments when they appear consecutivelyflag-order-fixesDan Nicholson2012-12-043-39/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * Output -l and other Libs flags in the order they appearDan Nicholson2012-12-045-34/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * Keep Libs and Cflags together to maintain orderingDan Nicholson2012-12-043-102/+112
| | | | | | | | | | | | Instead of splitting to -l/-L/other and -I/other, keep the args together and mark each argument with its type. Then we can maintain order all the way through.
| * Output -L Libs flags before other Libs flagsDan Nicholson2012-12-047-25/+25
| | | | | | | | | | | | | | 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.
| * Pass around flags types instead of function pointersDan Nicholson2012-12-041-80/+46
| | | | | | | | | | This makes the code uglier in the short term, but prepares for using merged lists of Cflags and Libs in one go.
| * Limit merging of packages and flags to path or dependency orderDan Nicholson2012-12-041-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the get_multi_merged functions since there are only two valid ways to do the merging of packages and flags. 1. Packages are sorted by their position in the pkg-config path and then duplicate flags are stripped from the beginning of the list. This pertains to -I and -L flags. 2. Packages are sorted by dependency with most required last and then duplicate flags are stripped from the end of the list. This ensures that flags that come from packages required by multiple others come later in the output. This applies to all non-L/I flags.
| * Unify string list stripping functions and operate on list in placeDan Nicholson2012-12-041-37/+20
| | | | | | | | | | | | There were two string list stripping functions, when the only difference was to operate from the beginning or end of the list. Also, the function was copying the list and operating on that unnecessarily.
| * Cleanup prototypes for list operating functionsDan Nicholson2012-12-041-13/+18
| | | | | | | | | | Instead of having a list as an out parameter when it they have no elements, just return the list to the caller. Cleans up some code a bit.
| * Sort -other Libs and Cflags by package order instead of path orderDan Nicholson2012-12-043-15/+14
| | | | | | | | | | | | | | | | 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.
* | Use the standard pkg-config macros to check for glibDan Nicholson2013-01-171-13/+9
| | | | | | | | | | | | | | | | | | By using our PKG_CHECK_MODULES from our in-tree pkg.m4, the check for glib will be done the same way pkg-config is used everywhere else. This includes the usage of AC_PATH_TOOL in PKG_PROG_PKG_CONFIG, which will check for $host-pkg-config when --host is set during configure. Freedesktop #59435 (https://bugs.freedesktop.org/show_bug.cgi?id=59435)
* | Greatly simplify circular Requires checkingDan Nicholson2013-01-162-4/+4
| | | | | | | | | | | | | | Instead of keeping of list of packages in the current Requires chain and searching it repeatedly, just mark each package as part of the chain or not. This nearly cuts in half the time on a particularly rough torture test I have.
* | Extend default system library path for libdirs other than lib64Mike Frysinger2012-12-191-4/+5
| | | | | | | | | | | | | | When the basename of the libdir is lib64, we currently add the paths /usr/lib64:/lib64 to the generic system library path of /usr/lib:/lib. Extend this coverage to other valid ABIs that use libdirs such as lib32 or libx32.
* | Add root /lib* directories to the default -L pathsDan Nicholson2012-12-192-3/+3
| | | | | | | | | | | | | | Avoids outputting -L/lib, which the linker will search in implicitly like -L/usr/lib. Freedesktop #58363 (https://bugs.freedesktop.org/show_bug.cgi?id=58363)
* | Include PKG_CHECK_VAR macro for reading variables in .pc filesDavid Michael2012-12-142-0/+22
| | | | | | | | Freedesktop #48098 (https://bugs.freedesktop.org/show_bug.cgi?id=48098)
* | Fix handling of --print/silence-errors for all output optionsDan Nicholson2012-12-112-22/+18
| | | | | | | | | | | | | | | | | | | | The intention was that errors would be printed for all output options besides --exists and --atleast/exact/max-version, which are intended to operate silently. Since want_exists is always set for these latter options, we can simply use that as the condition and catch all other output options automatically. Freedesktop #54390 (https://bugs.freedesktop.org/show_bug.cgi?id=54390)
* | Enforce that only the first --atleast/exact/max-version option honoredDan Nicholson2012-12-113-2/+14
| | | | | | | | | | | | This provides the user with output matching the behavior of the code. When multiple --atleast/exact/max-version options are supplied, only the first will be honored.
* | Imply --exists when --atleast/exact/max-version passedDan Nicholson2012-12-113-21/+49
| | | | | | | | | | | | | | | | The --atleast/exact/max-version help description implied that it would return as --exists does. However, this would only occur if no other output options were set. Freedesktop #54389 (https://bugs.freedesktop.org/show_bug.cgi?id=54389)
* | Explicitly set --exists as the default optionDan Nicholson2012-12-113-4/+12
| | | | | | | | | | | | | | | | This happened basically by accident before when "pkg-config foo" was run because the code wouldn't find any options set and just fall through to the end after processing the package arguments. However, it would act differently in that Requires.private was only enabled with an explicit --exists.
* | Enforce exclusive output optionsDan Nicholson2012-12-112-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, any output option (e.g., --version or --libs) will be set as valid and what's output is at the mercy of the order of the output handling code in main(). However, most combinations of output would make no sense to be used together. For example, mixing --modversion and --print-provides provides no way to differentiate between the output from the options. Further, mixing --variable and --cflags currently causes an error because there's no space separating the option outputs. Instead, keep track of when an output option has been set and ignore subsequent output options. There are currently two exceptions: 1. Any combination of --cflags* and --libs* are allowed. 2. Both --print-requires and --print-requires-private can be used together as the user may just not care which is private. Freedesktop #54391 (https://bugs.freedesktop.org/show_bug.cgi?id=54391)
* | Use flags for --cflags/--libs optionsDan Nicholson2012-12-111-47/+19
| | | | | | | | | | | | With the output options gathered in a callback, we can be more clever with the --cflags/--libs options and set the flags mask straight off without using the intermediate booleans.
* | Handle output mode options in callbackDan Nicholson2012-12-111-31/+77
| | | | | | | | | | This will provide one function to handle all the various options the user could supply sanely.
* | Convert ints used as bools to gbooleansDan Nicholson2012-12-114-27/+27
| | | | | | | | | | This matches the GOption documentation that G_OPTION_ARG_NONE should use a gboolean.
* | Split out package processing to separate function to cleanup mainDan Nicholson2012-12-111-99/+89
| | | | | | | | | | | | The code handling processing of the packages from the command line was in an awkward block in main. Split it out to a separate function to keep main mostly about output.
* | Cleanup local variable declarationsDan Nicholson2012-12-111-100/+101
| | | | | | | | | | | | Having the option entries within main and requiring the option variables to be static is just wrong. Just declare them at file scope like every other program does.
* | Fix hardcoded version if check-debugDan Nicholson2012-12-111-1/+1
| |
* | Update README.win32 to reflect current pkg-config behaviorDan Nicholson2012-12-081-29/+16
| | | | | | | | Freedesktop #54427 (https://bugs.freedesktop.org/show_bug.cgi?id=54427)
* | Document PKG*INSTALLDIR autoconf macros in manpageDan Nicholson2012-12-081-0/+15
| | | | | | | | Freedesktop #54463 (https://bugs.freedesktop.org/show_bug.cgi?id=54463)
* | Allow ~ through unescapedMichaƂ Sawicz2012-12-084-3/+24
|/ | | | freedesktop #57078 (https://bugs.freedesktop.org/show_bug.cgi?id=57078)
* Fix one hash table optimization to use key=valueDan Nicholson2012-12-041-1/+1
| | | | | | Commit 428335e changed some hash tables to be used as sets where the key equals the value since glib has some optimization for that. Unfortunately, the package list stripping table wasn't fixed corectly.
* Optimize hash table when usage is only as a setDan Nicholson2012-12-031-6/+6
| | | | | | | | | When searching for duplicate strings in the output list, a hash table is used to keep track of which strings have been seen. This usage as a set can be optimized as described in the documentation to not allocate or free the hash table values: http://developer.gnome.org/glib/stable/glib-Hash-Tables.html#glib-Hash-Tables.description
* Remove duplicate string list elements in placeDan Nicholson2012-12-031-43/+26
| | | | | | Similar to the removal of duplicate packages, this can be more efficient if we don't build a new list and instead just remove the elements in place.
* Start from end of package lists when processing RequiresDan Nicholson2012-12-034-32/+26
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Traverse list backwards instead of copying and reversingDan Nicholson2012-12-031-7/+2
| | | | | | Walking a GSList backwards involved copying and reversing it so that the the original list could remain undisturbed. This is wasteful with a GList where we can just start at the end of the list and work backwards.
* Remove duplicate packages after resolving requiresDan Nicholson2012-12-033-5/+47
| | | | | | | | | 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).
* Convert to doubly-linked GListDan Nicholson2012-12-035-161/+161
| | | | | | | | Using a doubly-linked list allows it to be easily traversed in both directions and makes removing nodes in place much simpler. This adds an extra pointer to each node and associated manipulation during any list processing, but this trade seems acceptable over the repeated hacks to work with singly-linked lists.
* Always use --static test results for indirect depencency resultsDan Nicholson2012-11-294-25/+31
| | | | | | | 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.
* Use standard GSList functions to merge package listsDan Nicholson2012-11-291-11/+3
| | | | | | Using the GSList functions instead of manually adjusting the list pointers seems safer and allows an easier path to using another glib list type if necessary.
* Add a gtk testcase to provide something with complex interactionsDan Nicholson2012-11-2828-2/+406
| | | | | | | | 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.
* Test stripping of duplicate flagsDan Nicholson2012-11-284-1/+40
| | | | | | | 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.
* Test ordering of flags based on package depth and pathDan Nicholson2012-11-2811-1/+301
| | | | | | | | 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.
* Remove extra spaces from list debugging outputDan Nicholson2012-11-281-6/+4
| | | | | Also, make pre- and post-sorting output aligned to easily ordering differences.
* Use package filename rather than Name in debuggingDan Nicholson2012-11-281-12/+12
| | | | | | | The Package key member corresponds to the module filename with the .pc stripped off while the name member corresponds to the Name field in the .pc file. The latter is almost never used in practice and just makes debugging more difficult.
* Allow all combinations of --cflags and --libs variantsDan Nicholson2012-11-037-143/+184
| | | | | | | | | 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)
* Remove pkg-config.in scriptDan Nicholson2012-10-311-306/+0
| | | | | | | A relic from the past, the pkg-config.in script exists from a time when pkg-config was implemented as a shell script. This time is long since gone and the script is far different than the C implementation. Find it in git if you want to see how a shell script once did pkg-config.
* Move --print-variables handling after --exists for consistencyDan Nicholson2012-10-301-16/+15
| | | | | | | | | The --print-variables output is inconsistent with other printing options when --exists is supplied or not. Move the handling after --exists like --print-requires and others requiring a valid package list so that --exists is given it takes priority and exits early. Freedesktop #54384 (https://bugs.freedesktop.org/show_bug.cgi?id=54384)
* Nest copying and merging of flags to avoid repeated traversalsDan Nicholson2012-10-301-18/+34
| | | | | | | | | | | When merging the flags from all the packages together, each flags list was being copied and then concatenated to then end of the combined list. This was extremely inefficient because it caused the combined list to be traversed multiple times to find the end. Instead, nest the copying and merging of the flags together so the last element is always tracked and can easily be appended to. Freedesktop #54716 (https://bugs.freedesktop.org/show_bug.cgi?id=54716)