From 72c6e9237b865365f236890f80e438f4ef1387b8 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 19 Jul 2015 23:00:35 +0200 Subject: [PATCH] Ensure -I is never merged back as well --- fragment.c | 2 ++ tests/lib1/prefix-foo1.pc | 2 +- tests/lib1/prefix-foo2.pc | 2 +- tests/run.sh.in | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fragment.c b/fragment.c index 693b038..d944a28 100644 --- a/fragment.c +++ b/fragment.c @@ -117,6 +117,8 @@ pkg_fragment_can_merge_back(pkg_fragment_t *base, unsigned int flags, bool is_pr return false; if (base->type == 'L') return false; + if (base->type == 'I') + return false; return true; } diff --git a/tests/lib1/prefix-foo1.pc b/tests/lib1/prefix-foo1.pc index 3a56669..a91133d 100644 --- a/tests/lib1/prefix-foo1.pc +++ b/tests/lib1/prefix-foo1.pc @@ -7,6 +7,6 @@ Name: prefix-foo1 Description: A testing pkg-config file Version: 1.2.3 Libs: -L${libdir} -lfoo1 -Cflags: -fPIC -I${includedir}/foo1 +Cflags: -fPIC -I${includedir}/foo -DBAR Cflags.private: -DFOO_STATIC diff --git a/tests/lib1/prefix-foo2.pc b/tests/lib1/prefix-foo2.pc index 28ec566..f2926db 100644 --- a/tests/lib1/prefix-foo2.pc +++ b/tests/lib1/prefix-foo2.pc @@ -7,6 +7,6 @@ Name: prefix-foo2 Description: A testing pkg-config file Version: 1.2.3 Libs: -L${libdir} -lfoo2 -Cflags: -fPIC -I${includedir}/foo2 +Cflags: -fPIC -I${includedir}/foo -DFOO Cflags.private: -DFOO_STATIC diff --git a/tests/run.sh.in b/tests/run.sh.in index 5ca5afe..819954c 100644 --- a/tests/run.sh.in +++ b/tests/run.sh.in @@ -268,6 +268,8 @@ run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs prefix-foo1" \ '-L/usr/bar/lib -lfoo1' run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --libs prefix-foo1 prefix-foo2" \ '-L/usr/bar/lib -lfoo1 -lfoo2' +run_test "PKG_CONFIG_PATH='${selfdir}/lib1' ${1} --cflags prefix-foo1 prefix-foo2" \ + '-I/usr/bar/include/foo -DBAR -fPIC -DFOO' # 10) tests for internal getopt implementation with options at the end if [ "x@STRICT_MODE@" = "xno" ]; then