1. 24 Jan, 2013 1 commit
  2. 23 Jan, 2013 2 commits
  3. 22 Jan, 2013 1 commit
  4. 17 Jan, 2013 2 commits
  5. 19 Dec, 2012 2 commits
  6. 14 Dec, 2012 1 commit
  7. 11 Dec, 2012 11 commits
  8. 09 Dec, 2012 1 commit
  9. 08 Dec, 2012 2 commits
  10. 04 Dec, 2012 10 commits
    • Dan Nicholson's avatar
      Only strip duplicate arguments when they appear consecutively · 9adfd9eb
      Dan Nicholson authored
      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)
    • Dan Nicholson's avatar
      Output -l and other Libs flags in the order they appear · 5b6ec1b6
      Dan Nicholson authored
      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)
    • Dan Nicholson's avatar
      Keep Libs and Cflags together to maintain ordering · 9bf6277b
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Output -L Libs flags before other Libs flags · 05f319d3
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Pass around flags types instead of function pointers · 28c64684
      Dan Nicholson authored
      This makes the code uglier in the short term, but prepares for using
      merged lists of Cflags and Libs in one go.
    • Dan Nicholson's avatar
      Limit merging of packages and flags to path or dependency order · 75a95f6f
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Unify string list stripping functions and operate on list in place · 8f354125
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Cleanup prototypes for list operating functions · d0e4ba89
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Sort -other Libs and Cflags by package order instead of path order · e0d3ce93
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Fix one hash table optimization to use key=value · 43f20b96
      Dan Nicholson authored
      Commit 428335e2 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.
  11. 03 Dec, 2012 6 commits
    • Dan Nicholson's avatar
      Optimize hash table when usage is only as a set · 428335e2
      Dan Nicholson authored
      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:
    • Dan Nicholson's avatar
      Remove duplicate string list elements in place · a7b46580
      Dan Nicholson authored
      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
    • Dan Nicholson's avatar
      Start from end of package lists when processing Requires · 360a614a
      Dan Nicholson authored
      Prior to commit 6ecf318c, 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
      6ecf318c, 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.
    • Dan Nicholson's avatar
      Traverse list backwards instead of copying and reversing · be455b79
      Dan Nicholson authored
      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.
    • Dan Nicholson's avatar
      Remove duplicate packages after resolving requires · 42836226
      Dan Nicholson authored
      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).
    • Dan Nicholson's avatar
      Convert to doubly-linked GList · e8086bc5
      Dan Nicholson authored
      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.
  12. 30 Nov, 2012 1 commit
    • Dan Nicholson's avatar
      Always use --static test results for indirect depencency results · d6337ec9
      Dan Nicholson authored
      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.