Hello community,

here is the log from the commit of package pkg-config for openSUSE:Factory 
checked in at 2017-05-18 20:37:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pkg-config (Old)
 and      /work/SRC/openSUSE:Factory/.pkg-config.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pkg-config"

Thu May 18 20:37:06 2017 rev:33 rq:494083 version:0.29.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/pkg-config/pkg-config.changes    2017-03-21 
22:43:54.950566621 +0100
+++ /work/SRC/openSUSE:Factory/.pkg-config.new/pkg-config.changes       
2017-05-18 20:37:24.523652498 +0200
@@ -1,0 +2,23 @@
+Tue Apr 25 10:28:49 UTC 2017 - dims...@opensuse.org
+
+- Update to version 0.29.2:
+  + Improved pkg-config's recursive package list expansion
+    performance.
+  + Handle an empty prefix setting correctly when --define-prefix
+    is used (fdo#97453).
+  + Lazily load pc files instead of reading all available pc files
+    during initialization (fdo#98215).
+  + Check the CPATH environment variable when determining system
+    include paths like GCC does. Document the system search path
+    behavior (fdo#99224).
+  + Make PKG_CHECK_MODULES show the module list rather than the
+    variable prefix in configure output (fdo#98334).
+  + Fix bundled glib build with GCC 6 (fdo#98334).
+  + Handle -isystem and -idirafter when PKG_CONFIG_SYSROOT_DIR is
+    set (fdo#97337).
+  + Check the INCLUDE environment variable when determining system
+    include paths on Windows builds when --msvc-syntax is used
+    (fdo#94729).
+- Drop pkg-config-gdate-fix.patch: fixed upstream.
+
+-------------------------------------------------------------------

Old:
----
  pkg-config-0.29.1.tar.gz
  pkg-config-gdate-fix.patch

New:
----
  pkg-config-0.29.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pkg-config.spec ++++++
--- /var/tmp/diff_new_pack.OaPl6W/_old  2017-05-18 20:37:25.155563322 +0200
+++ /var/tmp/diff_new_pack.OaPl6W/_new  2017-05-18 20:37:25.155563322 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           pkg-config
-Version:        0.29.1
+Version:        0.29.2
 Release:        0
 Summary:        A library management system
 License:        GPL-2.0+
@@ -31,8 +31,6 @@
 # pkg-config has a virtual internal pkg-config.pc file, so we should provide it
 Provides:       pkgconfig(pkg-config) = %{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-# PATCH-FIX-UPSTREAM pkg-config-gdate-fix.patch mli...@suse.cz -- Fix build 
with GCC 7
-Patch0:         pkg-config-gdate-fix.patch
 
 %description
 The pkg-config program is used to retrieve information about installed
@@ -41,7 +39,6 @@
 
 %prep
 %setup -q
-%patch0 -p1
 
 %build
 %configure\

++++++ pkg-config-0.29.1.tar.gz -> pkg-config-0.29.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/NEWS new/pkg-config-0.29.2/NEWS
--- old/pkg-config-0.29.1/NEWS  2016-03-01 20:40:10.000000000 +0100
+++ new/pkg-config-0.29.2/NEWS  2017-03-20 18:01:42.000000000 +0100
@@ -1,3 +1,25 @@
+pkg-config 0.29.2
+=================
+
+- Improved pkg-config's recursive package list expansion performance.
+  Thanks to Matthew Hanna for the fix.
+- Handle an empty prefix setting correctly when --define-prefix is used.
+  (#97453)
+- Lazily load pc files instead of reading all available pc files during
+  initialization. Thanks to Marco Diego Aurélio Mesquita for the fix.
+  (#98215)
+- Check the CPATH environment variable when determining system include
+  paths like GCC does. Document the system search path behavior. Thanks
+  to v4hn for the fix. (#99224)
+- Make PKG_CHECK_MODULES show the module list rather than the variable
+  prefix in configure output. Thanks to Russ Albery for the fix.
+  (#98334)
+- Fix bundled glib build with GCC 6. (#98334)
+- Handle -isystem and -idirafter when PKG_CONFIG_SYSROOT_DIR is set.
+  (#97337)
+- Check the INCLUDE environment variable when determining system include
+  paths on Windows builds when --msvc-syntax is used. (#94729)
+
 pkg-config 0.29.1
 =================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/Makefile.am 
new/pkg-config-0.29.2/check/Makefile.am
--- old/pkg-config-0.29.1/check/Makefile.am     2016-02-26 17:56:52.000000000 
+0100
+++ new/pkg-config-0.29.2/check/Makefile.am     2017-03-20 17:34:23.000000000 
+0100
@@ -29,6 +29,8 @@
        check-relocatable \
        check-variable-override \
        check-variables \
+       check-dependencies \
+       check-system-flags \
        $(NULL)
 
 EXTRA_DIST = \
@@ -98,8 +100,22 @@
        gtk/xproto.pc \
        gtk/xrender.pc \
        tilde.pc \
+       pkgconfig/empty-prefix.pc \
        pkgconfig/prefixdef.pc \
        pkgconfig/prefixdef-expanded.pc \
        pcfiledir.pc \
        variables.pc \
+       dependencies/a_dep_c.pc \
+       dependencies/b_dep_c.pc \
+       dependencies/c_dep.pc \
+       dependencies/d_dep_e_f.pc \
+       dependencies/d_dep_f_e.pc \
+       dependencies/e_dep_g_f.pc \
+       dependencies/f_dep_g.pc \
+       dependencies/g_dep.pc \
+       dependencies/h_dep_k_i_j.pc \
+       dependencies/i_dep_k_j.pc \
+       dependencies/j_dep_k.pc \
+       dependencies/k_dep.pc \
+       system.pc \
        $(NULL)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/Makefile.in 
new/pkg-config-0.29.2/check/Makefile.in
--- old/pkg-config-0.29.1/check/Makefile.in     2016-03-01 20:43:17.000000000 
+0100
+++ new/pkg-config-0.29.2/check/Makefile.in     2017-03-20 18:05:52.000000000 
+0100
@@ -96,7 +96,7 @@
        check-requires-version check-print-options check-path \
        check-sysroot check-uninstalled check-debug check-gtk \
        check-tilde check-relocatable check-variable-override \
-       check-variables
+       check-variables check-dependencies check-system-flags
 subdir = check
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/pkg.m4.in \
@@ -353,10 +353,24 @@
        gtk/xproto.pc \
        gtk/xrender.pc \
        tilde.pc \
+       pkgconfig/empty-prefix.pc \
        pkgconfig/prefixdef.pc \
        pkgconfig/prefixdef-expanded.pc \
        pcfiledir.pc \
        variables.pc \
+       dependencies/a_dep_c.pc \
+       dependencies/b_dep_c.pc \
+       dependencies/c_dep.pc \
+       dependencies/d_dep_e_f.pc \
+       dependencies/d_dep_f_e.pc \
+       dependencies/e_dep_g_f.pc \
+       dependencies/f_dep_g.pc \
+       dependencies/g_dep.pc \
+       dependencies/h_dep_k_i_j.pc \
+       dependencies/i_dep_k_j.pc \
+       dependencies/j_dep_k.pc \
+       dependencies/k_dep.pc \
+       system.pc \
        $(NULL)
 
 all: all-am
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/check-dependencies 
new/pkg-config-0.29.2/check/check-dependencies
--- old/pkg-config-0.29.1/check/check-dependencies      1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/check-dependencies      2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,44 @@
+#! /bin/sh
+
+# These tests check the evaluation of the 'recursive_fill_list' function to
+# verify that for any package s that depends on t, that the library defined by
+# package s occurs before that of package t
+
+set -e
+
+. ${srcdir}/common
+
+export PKG_CONFIG_PATH
+PKG_CONFIG_PATH="${srcdir}/dependencies"
+
+# Shared dependency test.
+RESULT="-la_dep_c -lb_dep_c -lc_dep"
+run_test --libs a_dep_c b_dep_c
+run_test --libs c_dep a_dep_c b_dep_c
+run_test --libs a_dep_c c_dep b_dep_c
+run_test --libs a_dep_c b_dep_c c_dep
+
+# Redundancy test.
+#
+# Redundancy on the input line should not pass through.
+RESULT="-la_dep_c -lb_dep_c -lc_dep"
+run_test --libs a_dep_c a_dep_c b_dep_c
+run_test --libs b_dep_c a_dep_c b_dep_c
+
+# Diamond pattern test.
+#
+# One dependency of d depends on the other.
+# Both dependencies of d depend on g
+RESULT="-ld_dep_e_f -le_dep_g_f -lf_dep_g -lg_dep"
+run_test --libs d_dep_e_f
+RESULT="-ld_dep_f_e -le_dep_g_f -lf_dep_g -lg_dep"
+run_test --libs d_dep_f_e
+
+# Nested inclusion.
+#
+# Each package depends on all downsteam packages.
+RESULT="-lh_dep_k_i_j -li_dep_k_j -lj_dep_k -lk_dep"
+run_test --libs h_dep_k_i_j
+run_test --libs h_dep_k_i_j i_dep_k_j
+run_test --libs i_dep_k_j h_dep_k_i_j
+run_test --libs k_dep j_dep_k i_dep_k_j h_dep_k_i_j
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/check-relocatable 
new/pkg-config-0.29.2/check/check-relocatable
--- old/pkg-config-0.29.1/check/check-relocatable       2016-01-24 
22:51:38.000000000 +0100
+++ new/pkg-config-0.29.2/check/check-relocatable       2017-03-19 
15:53:45.000000000 +0100
@@ -44,3 +44,10 @@
     RESULT="-I/reloc/include -L/reloc/lib -lfoo"
     run_test --dont-define-prefix --cflags --libs $pkg
 done
+
+# Test prefix redefinition for .pc files with an empty prefix. In this
+# case, there should be no prefix adjustment to the other variables. The
+# result should be the same regardless of prefix redefinition.
+RESULT="-I/some/path/include -L/some/path/lib -lfoo"
+run_test --define-prefix --cflags --libs empty-prefix
+run_test --dont-define-prefix --cflags --libs empty-prefix
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/check-special-flags 
new/pkg-config-0.29.2/check/check-special-flags
--- old/pkg-config-0.29.1/check/check-special-flags     2016-02-26 
17:52:25.000000000 +0100
+++ new/pkg-config-0.29.2/check/check-special-flags     2017-03-20 
13:14:08.000000000 +0100
@@ -4,8 +4,8 @@
 
 . ${srcdir}/common
 
-RESULT="-isystem /system1 -idirafter /after1 -idirafter /after2 -isystem 
/system2 -I/foo -I/bar"
+RESULT="-g -ffoo -I/foo -isystem /system1 -idirafter /after1 -I/bar -idirafter 
/after2 -isystem /system2"
 run_test --cflags special-flags
 
-RESULT="-framework Foo -lsimple -framework Bar -Wl,-framework -Wl,Baz"
+RESULT="-L/foo -L/bar -framework Foo -lsimple -framework Bar -Wl,-framework 
-Wl,Baz"
 run_test --libs special-flags
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/check-sysroot 
new/pkg-config-0.29.2/check/check-sysroot
--- old/pkg-config-0.29.1/check/check-sysroot   2016-01-24 22:51:38.000000000 
+0100
+++ new/pkg-config-0.29.2/check/check-sysroot   2017-03-20 13:14:08.000000000 
+0100
@@ -30,3 +30,9 @@
 
 RESULT="-L$root/sysroot/public-dep/lib -lpublic-dep"
 run_test --libs public-dep
+
+RESULT="-g -ffoo -I$root/sysroot/foo -isystem $root/sysroot/system1 -idirafter 
$root/sysroot/after1 -I$root/sysroot/bar -idirafter $root/sysroot/after2 
-isystem $root/sysroot/system2"
+run_test --cflags special-flags
+
+RESULT="-L$root/sysroot/foo -L$root/sysroot/bar -framework Foo -lsimple 
-framework Bar -Wl,-framework -Wl,Baz"
+run_test --libs special-flags
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/check-system-flags 
new/pkg-config-0.29.2/check/check-system-flags
--- old/pkg-config-0.29.1/check/check-system-flags      1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/check-system-flags      2017-03-20 
17:34:23.000000000 +0100
@@ -0,0 +1,66 @@
+#! /bin/sh
+
+set -e
+
+. ${srcdir}/common
+
+# Override the system paths in case pkg-config was built with something
+# that doesn't match the test pc file
+PKG_CONFIG_SYSTEM_INCLUDE_PATH=/usr/include
+if [ "$native_win32" = yes ]; then
+    PKG_CONFIG_SYSTEM_LIBRARY_PATH="/usr/lib;/lib"
+else
+    PKG_CONFIG_SYSTEM_LIBRARY_PATH=/usr/lib:/lib
+fi
+export PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH
+
+RESULT=""
+run_test --cflags system
+
+RESULT="-lsystem"
+run_test --libs system
+
+# Make sure that the full paths come out when the *_ALLOW_SYSTEM_*
+# variables are set
+RESULT="-I/usr/include"
+PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 run_test --cflags system
+
+RESULT="-L/usr/lib -lsystem"
+PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 run_test --libs system
+
+# Set the system paths to something else and test that the output
+# contains the full paths
+PKG_CONFIG_SYSTEM_INCLUDE_PATH=/foo/include
+PKG_CONFIG_SYSTEM_LIBRARY_PATH=/foo/lib
+
+RESULT="-I/usr/include"
+run_test --cflags system
+
+RESULT="-L/usr/lib -lsystem"
+run_test --libs system
+
+# Now check that the various GCC environment variables also update the
+# system include path
+for var in CPATH C_INCLUDE_PATH CPP_INCLUDE_PATH; do
+    RESULT=""
+    eval $var=/usr/include run_test --cflags system
+
+    # Make sure these are not skipped in --msvc-syntax mode
+    if [ "$native_win32" = yes ]; then
+        RESULT="-I/usr/include"
+        eval $var=/usr/include run_test --cflags --msvc-syntax system
+    fi
+done
+
+# Check that the various MSVC environment variables also update the
+# system include path when --msvc-syntax is in use
+for var in INCLUDE; do
+    RESULT="-I/usr/include"
+    eval $var=/usr/include run_test --cflags system
+
+    # Make sure these are skipped in --msvc-syntax mode
+    if [ "$native_win32" = yes ]; then
+        RESULT=""
+        eval $var=/usr/include run_test --cflags --msvc-syntax system
+    fi
+done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/a_dep_c.pc 
new/pkg-config-0.29.2/check/dependencies/a_dep_c.pc
--- old/pkg-config-0.29.1/check/dependencies/a_dep_c.pc 1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/a_dep_c.pc 2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -la_dep_c
+Requires: c_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/b_dep_c.pc 
new/pkg-config-0.29.2/check/dependencies/b_dep_c.pc
--- old/pkg-config-0.29.1/check/dependencies/b_dep_c.pc 1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/b_dep_c.pc 2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lb_dep_c
+Requires: c_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/c_dep.pc 
new/pkg-config-0.29.2/check/dependencies/c_dep.pc
--- old/pkg-config-0.29.1/check/dependencies/c_dep.pc   1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/c_dep.pc   2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,9 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lc_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/d_dep_e_f.pc 
new/pkg-config-0.29.2/check/dependencies/d_dep_e_f.pc
--- old/pkg-config-0.29.1/check/dependencies/d_dep_e_f.pc       1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/d_dep_e_f.pc       2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -ld_dep_e_f
+Requires: e_dep_g_f f_dep_g
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/d_dep_f_e.pc 
new/pkg-config-0.29.2/check/dependencies/d_dep_f_e.pc
--- old/pkg-config-0.29.1/check/dependencies/d_dep_f_e.pc       1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/d_dep_f_e.pc       2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -ld_dep_f_e
+Requires: f_dep_g e_dep_g_f
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/e_dep_g_f.pc 
new/pkg-config-0.29.2/check/dependencies/e_dep_g_f.pc
--- old/pkg-config-0.29.1/check/dependencies/e_dep_g_f.pc       1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/e_dep_g_f.pc       2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -le_dep_g_f
+Requires: f_dep_g g_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/f_dep_g.pc 
new/pkg-config-0.29.2/check/dependencies/f_dep_g.pc
--- old/pkg-config-0.29.1/check/dependencies/f_dep_g.pc 1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/f_dep_g.pc 2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lf_dep_g
+Requires: g_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/g_dep.pc 
new/pkg-config-0.29.2/check/dependencies/g_dep.pc
--- old/pkg-config-0.29.1/check/dependencies/g_dep.pc   1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/g_dep.pc   2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lg_dep
+Requires:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/h_dep_k_i_j.pc 
new/pkg-config-0.29.2/check/dependencies/h_dep_k_i_j.pc
--- old/pkg-config-0.29.1/check/dependencies/h_dep_k_i_j.pc     1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/h_dep_k_i_j.pc     2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lh_dep_k_i_j
+Requires: k_dep i_dep_k_j j_dep_k
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/i_dep_k_j.pc 
new/pkg-config-0.29.2/check/dependencies/i_dep_k_j.pc
--- old/pkg-config-0.29.1/check/dependencies/i_dep_k_j.pc       1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/i_dep_k_j.pc       2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -li_dep_k_j
+Requires: k_dep j_dep_k
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/j_dep_k.pc 
new/pkg-config-0.29.2/check/dependencies/j_dep_k.pc
--- old/pkg-config-0.29.1/check/dependencies/j_dep_k.pc 1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/j_dep_k.pc 2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lj_dep_k
+Requires: k_dep
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/dependencies/k_dep.pc 
new/pkg-config-0.29.2/check/dependencies/k_dep.pc
--- old/pkg-config-0.29.1/check/dependencies/k_dep.pc   1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/dependencies/k_dep.pc   2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=/path2
+exec_prefix=${prefix}
+libdir="${exec_prefix}/lib"
+includedir="${prefix}/include"
+
+Name: Dependencies test.
+Description: Test package for testing dependency order.
+Version: 1.0.0
+Libs: -lk_dep
+Requires:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/pkgconfig/empty-prefix.pc 
new/pkg-config-0.29.2/check/pkgconfig/empty-prefix.pc
--- old/pkg-config-0.29.1/check/pkgconfig/empty-prefix.pc       1970-01-01 
01:00:00.000000000 +0100
+++ new/pkg-config-0.29.2/check/pkgconfig/empty-prefix.pc       2017-03-19 
15:53:45.000000000 +0100
@@ -0,0 +1,10 @@
+prefix=
+libdir=/some/path/lib
+includedir=/some/path/include
+
+Name: Empty prefix redefinition test
+Description: Test pkg-config empty prefix redefinition
+Version: 1.0.0
+Requires:
+Libs: -L${libdir} -lfoo
+Cflags: -I${includedir}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/special-flags.pc 
new/pkg-config-0.29.2/check/special-flags.pc
--- old/pkg-config-0.29.1/check/special-flags.pc        2016-02-26 
17:52:25.000000000 +0100
+++ new/pkg-config-0.29.2/check/special-flags.pc        2017-03-20 
13:14:08.000000000 +0100
@@ -7,5 +7,5 @@
 Description: Dummy pkgconfig test package for testing pkgconfig
 Version: 1.0.0
 Requires:
-Libs: -framework Foo -lsimple -framework Bar -Wl,-framework -Wl,Baz
-Cflags: -I/foo -isystem /system1 -idirafter /after1 -I/bar -idirafter /after2 
-isystem /system2
+Libs: -L/foo -framework Foo -lsimple -L/bar -framework Bar -Wl,-framework 
-Wl,Baz
+Cflags: -I/foo -g -isystem /system1 -idirafter /after1 -ffoo -I/bar -idirafter 
/after2 -isystem /system2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/check/system.pc 
new/pkg-config-0.29.2/check/system.pc
--- old/pkg-config-0.29.1/check/system.pc       1970-01-01 01:00:00.000000000 
+0100
+++ new/pkg-config-0.29.2/check/system.pc       2017-03-20 17:34:23.000000000 
+0100
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: System library
+Description: Test package
+Version: 1.0.0
+Libs: -L${libdir} -lsystem
+Cflags: -I${includedir}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/config.h.win32 
new/pkg-config-0.29.2/config.h.win32
--- old/pkg-config-0.29.1/config.h.win32        2016-03-01 20:43:19.000000000 
+0100
+++ new/pkg-config-0.29.2/config.h.win32        2017-03-20 18:07:57.000000000 
+0100
@@ -69,7 +69,7 @@
 #define PACKAGE_NAME "pkg-config"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "pkg-config 0.29.1"
+#define PACKAGE_STRING "pkg-config 0.29.2"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "pkg-config"
@@ -78,13 +78,13 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "0.29.1"
+#define PACKAGE_VERSION "0.29.2"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "0.29.1"
+#define VERSION "0.29.2"
 
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/configure 
new/pkg-config-0.29.2/configure
--- old/pkg-config-0.29.1/configure     2016-03-01 20:43:16.000000000 +0100
+++ new/pkg-config-0.29.2/configure     2017-03-20 18:05:51.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pkg-config 0.29.1.
+# Generated by GNU Autoconf 2.69 for pkg-config 0.29.2.
 #
 # Report bugs to 
<https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config>.
 #
@@ -591,8 +591,8 @@
 # Identity of this package.
 PACKAGE_NAME='pkg-config'
 PACKAGE_TARNAME='pkg-config'
-PACKAGE_VERSION='0.29.1'
-PACKAGE_STRING='pkg-config 0.29.1'
+PACKAGE_VERSION='0.29.2'
+PACKAGE_STRING='pkg-config 0.29.2'
 
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config'
 PACKAGE_URL=''
 
@@ -1354,7 +1354,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pkg-config 0.29.1 to adapt to many kinds of systems.
+\`configure' configures pkg-config 0.29.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1424,7 +1424,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pkg-config 0.29.1:";;
+     short | recursive ) echo "Configuration of pkg-config 0.29.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1556,7 +1556,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pkg-config configure 0.29.1
+pkg-config configure 0.29.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1925,7 +1925,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pkg-config $as_me 0.29.1, which was
+It was created by pkg-config $as_me 0.29.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2795,7 +2795,7 @@
 
 # Define the identity of the package.
  PACKAGE='pkg-config'
- VERSION='0.29.1'
+ VERSION='0.29.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -13536,7 +13536,7 @@
 Report bugs to <bug-libt...@gnu.org>."
 
 lt_cl_version="\
-pkg-config config.lt 0.29.1
+pkg-config config.lt 0.29.2
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -14539,6 +14539,9 @@
 _ACEOF
 
 
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 12 (pkg-config-@VERSION@)
+
 
 
 
@@ -14710,8 +14713,8 @@
 fi
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
-$as_echo_n "checking for GLIB... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= 2.16" >&5
+$as_echo_n "checking for glib-2.0 >= 2.16... " >&6; }
 
 if test -n "$GLIB_CFLAGS"; then
     pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
@@ -14751,7 +14754,7 @@
 
 
 if test $pkg_failed = yes; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -14769,7 +14772,7 @@
 
        as_fn_error $? "Either a previously installed pkg-config or \"glib-2.0 
>= 2.16\" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the 
correct values or pass --with-internal-glib to configure to use the bundled 
copy." "$LINENO" 5
 elif test $pkg_failed = untried; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
        as_fn_error $? "Either a previously installed pkg-config or \"glib-2.0 
>= 2.16\" could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to the 
correct values or pass --with-internal-glib to configure to use the bundled 
copy." "$LINENO" 5
 else
@@ -15413,7 +15416,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pkg-config $as_me 0.29.1, which was
+This file was extended by pkg-config $as_me 0.29.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15479,7 +15482,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-pkg-config config.status 0.29.1
+pkg-config config.status 0.29.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/configure.ac 
new/pkg-config-0.29.2/configure.ac
--- old/pkg-config-0.29.1/configure.ac  2016-03-01 20:38:54.000000000 +0100
+++ new/pkg-config-0.29.2/configure.ac  2017-03-20 18:01:54.000000000 +0100
@@ -1,6 +1,6 @@
 AC_PREREQ([2.62])
 AC_INIT([pkg-config],
-        [0.29.1],
+        [0.29.2],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config],
         [pkg-config])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/glib/glib/gdate.c 
new/pkg-config-0.29.2/glib/glib/gdate.c
--- old/pkg-config-0.29.1/glib/glib/gdate.c     2016-01-24 22:51:38.000000000 
+0100
+++ new/pkg-config-0.29.2/glib/glib/gdate.c     2017-03-20 12:57:39.000000000 
+0100
@@ -2439,6 +2439,9 @@
  *
  * Returns: number of characters written to the buffer, or 0 the buffer was 
too small
  */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+
 gsize     
 g_date_strftime (gchar       *s, 
                  gsize        slen, 
@@ -2549,3 +2552,5 @@
   return retval;
 #endif
 }
+
+#pragma GCC diagnostic pop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/main.c new/pkg-config-0.29.2/main.c
--- old/pkg-config-0.29.1/main.c        2016-01-29 18:35:40.000000000 +0100
+++ new/pkg-config-0.29.2/main.c        2017-03-19 15:53:45.000000000 +0100
@@ -643,7 +643,7 @@
         return 1;
     }
 
-  package_init ();
+  package_init (want_list);
 
   if (want_list)
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/parse.c 
new/pkg-config-0.29.2/parse.c
--- old/pkg-config-0.29.1/parse.c       2016-02-26 17:56:52.000000000 +0100
+++ new/pkg-config-0.29.2/parse.c       2017-03-20 13:14:08.000000000 +0100
@@ -861,7 +861,9 @@
 
           tmp = trim_string (argv[i+1]);
           option = strdup_escape_shell (tmp);
-          flag->type = CFLAGS_OTHER;
+
+          /* These are -I flags since they control the search path */
+          flag->type = CFLAGS_I;
           flag->arg = g_strconcat (arg, " ", option, NULL);
           pkg->cflags = g_list_prepend (pkg->cflags, flag);
           i++;
@@ -1046,6 +1048,7 @@
        }
       else if (define_prefix &&
               pkg->orig_prefix != NULL &&
+              *(pkg->orig_prefix) != '\0' &&
               strncmp (p, pkg->orig_prefix, strlen (pkg->orig_prefix)) == 0 &&
               G_IS_DIR_SEPARATOR (p[strlen (pkg->orig_prefix)]))
        {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/pkg-config.1 
new/pkg-config-0.29.2/pkg-config.1
--- old/pkg-config-0.29.1/pkg-config.1  2016-02-26 17:52:25.000000000 +0100
+++ new/pkg-config-0.29.2/pkg-config.1  2017-03-20 17:34:23.000000000 +0100
@@ -32,7 +32,7 @@
 .PP
 .nf
 program: program.c
-       cc program.c $(pkg-config --cflags --libs gnomeui)
+       cc program.c `pkg-config --cflags --libs gnomeui`
 .fi
 .PP
 .I pkg-config
@@ -319,11 +319,47 @@
 uninstalled packages.  If this environment variable is set, it
 disables said behavior.
 .TP
+.I "PKG_CONFIG_SYSTEM_INCLUDE_PATH"
+A path variable containing system directories searched by the compiler.
+This is normally
+.IR /usr/include .
+.TP
+.I "CPATH"
+.TQ
+.I "C_INCLUDE_PATH"
+.TQ
+.I "CPLUS_INCLUDE_PATH"
+Additional paths to append to
+.IR "PKG_CONFIG_SYSTEM_INCLUDE_PATH" .
+These correspond to environment variables used by many compilers to
+affect the header search path. These are ignored on Windows builds when
+\-\-msvc-syntax is in use.
+.TP
+.I "INCLUDE"
+Additional paths to append to
+.IR "PKG_CONFIG_SYSTEM_INCLUDE_PATH"
+on Windows builds when \-\-msvc-syntax is in use. This corresponds to
+the environment variable used by MSVC to add directories to the include
+file search path.
+.TP
 .I "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS"
-Don't strip -I/usr/include out of cflags.
+Don't strip system paths out of Cflags. See
+.I "PKG_CONFIG_SYSTEM_INCLUDE_PATH"
+for the definition of system paths.
+.TP
+.I "PKG_CONFIG_SYSTEM_LIBRARY_PATH"
+A path variable containing system directories searched by the linker.
+This is normally
+.I /usr/lib:/lib
+but is dependent on the
+.I pkg-config
+build and can contain other directories such as
+.IR /usr/lib64 .
 .TP
 .I "PKG_CONFIG_ALLOW_SYSTEM_LIBS"
-Don't strip -L/usr/lib or -L/lib out of libs.
+Don't strip system paths out of Libs. See
+.I "PKG_CONFIG_SYSTEM_LIBRARY_PATH"
+for the definition of system paths.
 .TP
 .I "PKG_CONFIG_SYSROOT_DIR"
 Modify -I and -L to use the directories located in target sysroot.
@@ -440,7 +476,15 @@
 
 Defines the PKG_CONFIG variable to the best pkg-config available,
 useful if you need pkg-config but don't want to use PKG_CHECK_MODULES.
-.\"
+
+If the first call to PKG_PROG_PKG_CONFIG is conditional, then it will
+not work correctly in all cases. Since many of the other macros such as
+PKG_CHECK_MODULES require PKG_PROG_PKG_CONFIG to know which pkg-config
+program to run, PKG_PROG_PKG_CONFIG may be run for the first time from a
+conditional from one of these macros. Therefore, if any of the
+pkg-config macros will be used under a conditional, it's best to run
+PKG_PROG_PKG_CONFIG before any of the other macros are used.
+
 .TP
 .I "PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES [,ACTION-IF-FOUND 
[,ACTION-IF-NOT-FOUND]])"
 Enables static linking through --static prior to calling
@@ -451,9 +495,10 @@
 Check to see whether a particular set of modules exists.  Similar
 to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
-Similar to PKG_CHECK_MODULES, make sure that the first instance of
-this or PKG_CHECK_MODULES is called, or make sure to call
-PKG_CHECK_EXISTS manually.
+Similar to PKG_CHECK_MODULES, make sure that the first instance of this
+or PKG_CHECK_MODULES is called, or make sure to call PKG_PROG_PKGCONFIG
+manually.
+
 .TP
 .I "PKG_INSTALLDIR(DIRECTORY)"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/pkg.c new/pkg-config-0.29.2/pkg.c
--- old/pkg-config-0.29.1/pkg.c 2016-02-26 17:56:52.000000000 +0100
+++ new/pkg-config-0.29.2/pkg.c 2017-03-20 17:34:23.000000000 +0100
@@ -43,11 +43,8 @@
 static void verify_package (Package *pkg);
 
 static GHashTable *packages = NULL;
-static GHashTable *locations = NULL;
-static GHashTable *path_positions = NULL;
 static GHashTable *globals = NULL;
 static GList *search_dirs = NULL;
-static int scanned_dir_count = 0;
 
 gboolean disable_uninstalled = FALSE;
 gboolean ignore_requires = FALSE;
@@ -121,6 +118,8 @@
     return FALSE;
 }
 
+static Package *
+internal_get_package (const char *name, gboolean warn);
 
 /* Look for .pc files in the given directory and add them into
  * locations, ignoring duplicates
@@ -129,7 +128,7 @@
 scan_dir (char *dirname)
 {
   GDir *dir;
-  const gchar *d_name;
+  const gchar *filename;
 
   int dirnamelen = strlen (dirname);
   /* Use a copy of dirname cause Win32 opendir doesn't like
@@ -161,59 +160,20 @@
   dir = g_dir_open (dirname_copy, 0 , NULL);
   g_free (dirname_copy);
 
-  scanned_dir_count += 1;
-
   if (!dir)
     {
-      debug_spew ("Cannot open directory #%i '%s' in package search path: 
%s\n",
-                  scanned_dir_count, dirname, g_strerror (errno));
+      debug_spew ("Cannot open directory '%s' in package search path: %s\n",
+                  dirname, g_strerror (errno));
       return;
     }
 
-  debug_spew ("Scanning directory #%i '%s'\n", scanned_dir_count, dirname);
-  
-  while ((d_name = g_dir_read_name(dir)))
-    {
-      int len = strlen (d_name);
+  debug_spew ("Scanning directory '%s'\n", dirname);
 
-      if (ends_in_dotpc (d_name))
-        {
-          char *pkgname = g_malloc (len - EXT_LEN + 1);
-
-          debug_spew ("File '%s' appears to be a .pc file\n", d_name);
-          
-          strncpy (pkgname, d_name, len - EXT_LEN);
-          pkgname[len-EXT_LEN] = '\0';
-
-          if (g_hash_table_lookup (locations, pkgname))
-            {
-              debug_spew ("File '%s' ignored, we already know about package 
'%s'\n", d_name, pkgname);
-              g_free (pkgname);
-            }
-          else
-            {
-              char *filename = g_malloc (dirnamelen + 1 + len + 1);
-              strncpy (filename, dirname, dirnamelen);
-              filename[dirnamelen] = G_DIR_SEPARATOR;
-              strcpy (filename + dirnamelen + 1, d_name);
-              
-             if (g_file_test(filename, G_FILE_TEST_IS_REGULAR) == TRUE) {
-                 g_hash_table_insert (locations, pkgname, filename);
-                 g_hash_table_insert (path_positions, pkgname,
-                                      GINT_TO_POINTER (scanned_dir_count));
-                 debug_spew ("Will find package '%s' in file '%s'\n",
-                             pkgname, filename);
-             } else {
-                 debug_spew ("Ignoring '%s' while looking for '%s'; not a "
-                             "regular file.\n", pkgname, filename);
-             }
-           }
-        }
-      else
-        {
-          debug_spew ("Ignoring file '%s' in search directory; not a .pc 
file\n",
-                      d_name);
-        }
+  while ((filename = g_dir_read_name(dir)))
+    {
+      char *path = g_build_filename (dirname, filename, NULL);
+      internal_get_package (path, FALSE);
+      g_free (path);
     }
   g_dir_close (dir);
 }
@@ -243,31 +203,31 @@
 }
 
 void
-package_init ()
+package_init (gboolean want_list)
 {
-  static gboolean initted = FALSE;
-
-  if (!initted)
-    {
-      initted = TRUE;
-      
-      packages = g_hash_table_new (g_str_hash, g_str_equal);
-      locations = g_hash_table_new (g_str_hash, g_str_equal);
-      path_positions = g_hash_table_new (g_str_hash, g_str_equal);
+  if (packages)
+    return;
       
-      add_virtual_pkgconfig_package ();
+  packages = g_hash_table_new (g_str_hash, g_str_equal);
 
-      g_list_foreach (search_dirs, (GFunc)scan_dir, NULL);
-    }
+  if (want_list)
+    g_list_foreach (search_dirs, (GFunc)scan_dir, NULL);
+  else
+    /* Should not add virtual pkgconfig package when listing to be
+     * compatible with old code that only listed packages from real
+     * files */
+    add_virtual_pkgconfig_package ();
 }
 
 static Package *
 internal_get_package (const char *name, gboolean warn)
 {
   Package *pkg = NULL;
-  char *key;
-  const char *location;
+  char *key = NULL;
+  char *location = NULL;
+  unsigned int path_position = 0;
   GList *iter;
+  GList *dir_iter;
   
   pkg = g_hash_table_lookup (packages, name);
 
@@ -280,7 +240,8 @@
   if ( ends_in_dotpc (name) )
     {
       debug_spew ("Considering '%s' to be a filename rather than a package 
name\n", name);
-      location = name;
+      location = g_strdup (name);
+      key = g_strdup (name);
     }
   else
     {
@@ -303,7 +264,18 @@
             }
         }
       
-      location = g_hash_table_lookup (locations, name);
+      for (dir_iter = search_dirs; dir_iter != NULL;
+           dir_iter = g_list_next (dir_iter))
+        {
+          path_position++;
+          location = g_strdup_printf ("%s%c%s.pc", (char*)dir_iter->data,
+                                      G_DIR_SEPARATOR, name);
+          if (g_file_test (location, G_FILE_TEST_IS_REGULAR))
+            break;
+          g_free (location);
+          location = NULL;
+        }
+
     }
   
   if (location == NULL)
@@ -317,21 +289,13 @@
       return NULL;
     }
 
-  if (location != name)
+  if (key == NULL)
     key = g_strdup (name);
   else
     {
       /* need to strip package name out of the filename */
-      int len = strlen (name);
-      const char *end = name + (len - EXT_LEN);
-      const char *start = end;
-
-      while (start != name && *start != G_DIR_SEPARATOR)
-        --start;
-
-      g_assert (end >= start);
-
-      key = g_strndup (start, end - start);
+      key = g_path_get_basename (name);
+      key[strlen (key) - EXT_LEN] = '\0';
     }
 
   debug_spew ("Reading '%s' from file '%s'\n", name, location);
@@ -339,17 +303,18 @@
                             ignore_private_libs, ignore_requires_private);
   g_free (key);
 
+  if (pkg != NULL && strstr (location, "uninstalled.pc"))
+    pkg->uninstalled = TRUE;
+
+  g_free (location);
+
   if (pkg == NULL)
     {
       debug_spew ("Failed to parse '%s'\n", location);
       return NULL;
     }
 
-  if (strstr (location, "uninstalled.pc"))
-    pkg->uninstalled = TRUE;
-
-  pkg->path_position =
-    GPOINTER_TO_INT (g_hash_table_lookup (path_positions, pkg->key));
+  pkg->path_position = path_position;
 
   debug_spew ("Path position of '%s' is %d\n",
               pkg->key, pkg->path_position);
@@ -469,10 +434,21 @@
     char *tmpstr = flag->arg;
 
     if (pcsysrootdir != NULL && flag->type & (CFLAGS_I | LIBS_L)) {
-      g_string_append_c (str, '-');
-      g_string_append_c (str, tmpstr[1]);
-      g_string_append (str, pcsysrootdir);
-      g_string_append (str, tmpstr+2);
+      /* Handle non-I Cflags like -isystem */
+      if (flag->type & CFLAGS_I && strncmp (tmpstr, "-I", 2) != 0) {
+        char *space = strchr (tmpstr, ' ');
+
+        /* Ensure this has a separate arg */
+        g_assert (space != NULL && space[1] != '\0');
+        g_string_append_len (str, tmpstr, space - tmpstr + 1);
+        g_string_append (str, pcsysrootdir);
+        g_string_append (str, space + 1);
+      } else {
+        g_string_append_c (str, '-');
+        g_string_append_c (str, tmpstr[1]);
+        g_string_append (str, pcsysrootdir);
+        g_string_append (str, tmpstr+2);
+      }
     } else {
       g_string_append (str, tmpstr);
     }
@@ -525,35 +501,44 @@
   return g_list_sort (list, pathposcmp);
 }
 
+/* Construct a topological sort of all required packages.
+ *
+ * This is a depth first search starting from the right.  The output 'listp' is
+ * in reverse order, with the first node reached in the depth first search at
+ * the end of the list.  Previously visited nodes are skipped.  The result is
+ * a list of packages such that each packages is listed once and comes before
+ * any package that it depends on.
+ */
 static void
-recursive_fill_list (Package *pkg, gboolean include_private, GList **listp)
+recursive_fill_list (Package *pkg, gboolean include_private,
+                     GHashTable *visited, GList **listp)
 {
   GList *tmp;
 
   /*
-   * If the package is one of the parents, we can skip it. This allows
-   * circular requires loops to be broken.
+   * If the package has already been visited, then it is already in 'listp' and
+   * we can skip it. Additionally, this allows circular requires loops to be
+   * broken.
    */
-  if (pkg->in_requires_chain)
+  if (g_hash_table_lookup_extended (visited, pkg->key, NULL, NULL))
     {
       debug_spew ("Package %s already in requires chain, skipping\n",
                   pkg->key);
       return;
     }
-
   /* record this package in the dependency chain */
-  pkg->in_requires_chain = TRUE;
+  else
+    {
+      g_hash_table_replace (visited, pkg->key, pkg->key);
+    }
 
   /* Start from the end of the required package list to maintain order since
    * the recursive list is built by prepending. */
   tmp = include_private ? pkg->requires_private : pkg->requires;
   for (tmp = g_list_last (tmp); tmp != NULL; tmp = g_list_previous (tmp))
-    recursive_fill_list (tmp->data, include_private, listp);
+    recursive_fill_list (tmp->data, include_private, visited, listp);
 
   *listp = g_list_prepend (*listp, pkg);
-
-  /* remove this package from the dependency chain now that we've unwound */
-  pkg->in_requires_chain = FALSE;
 }
 
 /* merge the flags from the individual packages */
@@ -590,43 +575,6 @@
   return merged;
 }
 
-/* Work backwards from the end of the package list to remove duplicate
- * packages. This could happen because the package was specified multiple
- * times on the command line, or because multiple packages require the same
- * package. When we have duplicate dependencies, starting from the end of the
- * list ensures that the dependency shows up later in the package list and
- * Libs will come out correctly. */
-static GList *
-package_list_strip_duplicates (GList *packages)
-{
-  GList *cur;
-  GHashTable *requires;
-
-  requires = g_hash_table_new (g_str_hash, g_str_equal);
-  for (cur = g_list_last (packages); cur != NULL; cur = g_list_previous (cur))
-    {
-      Package *pkg = cur->data;
-
-      if (g_hash_table_lookup_extended (requires, pkg->key, NULL, NULL))
-        {
-          GList *dup = cur;
-
-          /* Remove the duplicate package from the list */
-          debug_spew ("Removing duplicate package %s\n", pkg->key);
-          cur = cur->next;
-          packages = g_list_delete_link (packages, dup);
-        }
-      else
-        {
-          /* Unique package. Track it and move to the next. */
-          g_hash_table_replace (requires, pkg->key, pkg->key);
-        }
-    }
-  g_hash_table_destroy (requires);
-
-  return packages;
-}
-
 static GList *
 fill_list (GList *packages, FlagType type,
            gboolean in_path_order, gboolean include_private)
@@ -634,18 +582,15 @@
   GList *tmp;
   GList *expanded = NULL;
   GList *flags;
+  GHashTable *visited;
 
   /* Start from the end of the requested package list to maintain order since
    * the recursive list is built by prepending. */
+  visited = g_hash_table_new (g_str_hash, g_str_equal);
   for (tmp = g_list_last (packages); tmp != NULL; tmp = g_list_previous (tmp))
-    recursive_fill_list (tmp->data, include_private, &expanded);
-
-  /* Remove duplicate packages from the recursive list. This should provide a
-   * serialized package list where all interdependencies are resolved
-   * consistently. */
-  spew_package_list (" pre-remove", expanded);
-  expanded = package_list_strip_duplicates (expanded);
-  spew_package_list ("post-remove", expanded);
+    recursive_fill_list (tmp->data, include_private, visited, &expanded);
+  g_hash_table_destroy (visited);
+  spew_package_list ("post-recurse", expanded);
 
   if (in_path_order)
     {
@@ -676,6 +621,25 @@
   return list;
 }
 
+/* Well known compiler include path environment variables. These are
+ * used to find additional system include paths to remove. See
+ * https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html. */
+static const gchar *gcc_include_envvars[] = {
+  "CPATH",
+  "C_INCLUDE_PATH",
+  "CPP_INCLUDE_PATH",
+  NULL
+};
+
+#ifdef G_OS_WIN32
+/* MSVC include path environment variables. See
+ * https://msdn.microsoft.com/en-us/library/73f9s62w.aspx. */
+static const gchar *msvc_include_envvars[] = {
+  "INCLUDE",
+  NULL
+};
+#endif
+
 static void
 verify_package (Package *pkg)
 {
@@ -686,8 +650,11 @@
   GList *requires_iter;
   GList *conflicts_iter;
   GList *system_dir_iter = NULL;
+  GHashTable *visited;
   int count;
   const gchar *search_path;
+  const gchar **include_envvars;
+  const gchar **var;
 
   /* Be sure we have the required fields */
 
@@ -756,7 +723,9 @@
   /* Make sure we didn't drag in any conflicts via Requires
    * (inefficient algorithm, who cares)
    */
-  recursive_fill_list (pkg, TRUE, &requires);
+  visited = g_hash_table_new (g_str_hash, g_str_equal);
+  recursive_fill_list (pkg, TRUE, visited, &requires);
+  g_hash_table_destroy (visited);
   conflicts = pkg->conflicts;
 
   requires_iter = requires;
@@ -795,8 +764,8 @@
   
   g_list_free (requires);
 
-  /* We make a list of system directories that gcc expects so we can remove
-   * them.
+  /* We make a list of system directories that compilers expect so we
+   * can remove them.
    */
 
   search_path = g_getenv ("PKG_CONFIG_SYSTEM_INCLUDE_PATH");
@@ -808,16 +777,16 @@
 
   system_directories = add_env_variable_to_list (system_directories, 
search_path);
 
-  search_path = g_getenv ("C_INCLUDE_PATH");
-  if (search_path != NULL)
-    {
-      system_directories = add_env_variable_to_list (system_directories, 
search_path);
-    }
-
-  search_path = g_getenv ("CPLUS_INCLUDE_PATH");
-  if (search_path != NULL)
+#ifdef G_OS_WIN32
+  include_envvars = msvc_syntax ? msvc_include_envvars : gcc_include_envvars;
+#else
+  include_envvars = gcc_include_envvars;
+#endif
+  for (var = include_envvars; *var != NULL; var++)
     {
-      system_directories = add_env_variable_to_list (system_directories, 
search_path);
+      search_path = g_getenv (*var);
+      if (search_path != NULL)
+        system_directories = add_env_variable_to_list (system_directories, 
search_path);
     }
 
   count = 0;
@@ -829,8 +798,12 @@
       if (!(flag->type & CFLAGS_I))
         continue;
 
-      /* we put things in canonical -I/usr/include (vs. -I /usr/include) 
format,
-       * but if someone changes it later we may as well be robust
+      /* Handle the system cflags. We put things in canonical
+       * -I/usr/include (vs. -I /usr/include) format, but if someone
+       * changes it later we may as well be robust.
+       *
+       * Note that the -i* flags are left out of this handling since
+       * they're intended to adjust the system cflags behavior.
        */
       if (((strncmp (flag->arg, "-I", 2) == 0) && (offset = 2))||
           ((strncmp (flag->arg, "-I ", 3) == 0) && (offset = 3)))
@@ -1198,19 +1171,15 @@
 static void
 packages_foreach (gpointer key, gpointer value, gpointer data)
 {
-  Package *pkg = get_package (key);
-
-  if (pkg != NULL)
-    {
-      char *pad;
+  Package *pkg = value;
+  char *pad;
 
-      pad = g_strnfill (GPOINTER_TO_INT (data) - strlen (pkg->key), ' ');
+  pad = g_strnfill (GPOINTER_TO_INT (data) - strlen (pkg->key), ' ');
       
-      printf ("%s%s%s - %s\n",
-              pkg->key, pad, pkg->name, pkg->description);
+  printf ("%s%s%s - %s\n",
+          pkg->key, pad, pkg->name, pkg->description);
 
-      g_free (pad);
-    }
+  g_free (pad);
 }
 
 void
@@ -1221,8 +1190,8 @@
   ignore_requires = TRUE;
   ignore_requires_private = TRUE;
 
-  g_hash_table_foreach (locations, max_len_foreach, &mlen);
-  g_hash_table_foreach (locations, packages_foreach, GINT_TO_POINTER (mlen + 
1));
+  g_hash_table_foreach (packages, max_len_foreach, &mlen);
+  g_hash_table_foreach (packages, packages_foreach, GINT_TO_POINTER (mlen + 
1));
 }
 
 void
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/pkg.h new/pkg-config-0.29.2/pkg.h
--- old/pkg-config-0.29.1/pkg.h 2016-01-29 18:44:17.000000000 +0100
+++ new/pkg-config-0.29.2/pkg.h 2017-03-19 15:53:45.000000000 +0100
@@ -84,7 +84,6 @@
   int path_position; /* used to order packages by position in path of their 
.pc file, lower number means earlier in path */
   int libs_num; /* Number of times the "Libs" header has been seen */
   int libs_private_num;  /* Number of times the "Libs.private" header has been 
seen */
-  gboolean in_requires_chain; /* package is in current Requires chain */
   char *orig_prefix; /* original prefix value before redefinition */
 };
 
@@ -99,7 +98,7 @@
 
 void add_search_dir (const char *path);
 void add_search_dirs (const char *path, const char *separator);
-void package_init (void);
+void package_init (gboolean want_list);
 int compare_versions (const char * a, const char *b);
 gboolean version_test (ComparisonType comparison,
                        const char *a,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkg-config-0.29.1/pkg.m4.in 
new/pkg-config-0.29.2/pkg.m4.in
--- old/pkg-config-0.29.1/pkg.m4.in     2016-01-24 22:51:38.000000000 +0100
+++ new/pkg-config-0.29.2/pkg.m4.in     2017-03-20 18:03:02.000000000 +0100
@@ -1,6 +1,6 @@
-dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
-dnl serial 11 (pkg-config-@VERSION@)
-dnl
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 12 (pkg-config-@VERSION@)
+
 dnl Copyright © 2004 Scott James Remnant <sc...@netsplit.com>.
 dnl Copyright © 2012-2015 Dan Nicholson <dbn.li...@gmail.com>
 dnl
@@ -142,7 +142,7 @@
 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
 pkg_failed=no
-AC_MSG_CHECKING([for $1])
+AC_MSG_CHECKING([for $2])
 
 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -152,11 +152,11 @@
 See the pkg-config man page for more details.])
 
 if test $pkg_failed = yes; then
-       AC_MSG_RESULT([no])
+        AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "$2" 2>&1`
-        else 
+        else
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"$2" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
@@ -173,7 +173,7 @@
 _PKG_TEXT])[]dnl
         ])
 elif test $pkg_failed = untried; then
-       AC_MSG_RESULT([no])
+        AC_MSG_RESULT([no])
        m4_default([$4], [AC_MSG_FAILURE(
 [The pkg-config script could not be found or is too old.  Make sure it
 is in your PATH or set the PKG_CONFIG environment variable to the full


Reply via email to