diff --git a/Makefile.am b/Makefile.am index 30ebbfe..fa390af 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,6 +54,7 @@ EXTRA_DIST = pkg.m4 \ tests/lib1/conflicts.pc \ tests/lib1/omg-uninstalled.pc \ tests/lib1/isystem.pc \ + tests/lib1/idirafter.pc \ tests/lib1/depgraph-break.pc \ tests/lib1/cflags-whitespace.pc \ tests/lib1/cflags-whitespace-trailing.pc \ diff --git a/libpkgconf/fragment.c b/libpkgconf/fragment.c index 57efe34..cdcf6e8 100644 --- a/libpkgconf/fragment.c +++ b/libpkgconf/fragment.c @@ -37,6 +37,7 @@ pkgconf_fragment_is_unmergeable(const char *string) static struct pkgconf_fragment_check check_fragments[] = { {"-framework", 10}, {"-isystem", 8}, + {"-idirafter", 10}, }; if (*string != '-') @@ -54,6 +55,7 @@ pkgconf_fragment_should_munge(const char *string, const char *sysroot_dir) { static struct pkgconf_fragment_check check_fragments[] = { {"-isystem", 8}, + {"-idirafter", 10}, }; if (*string != '/') diff --git a/tests/lib1/idirafter.pc b/tests/lib1/idirafter.pc new file mode 100644 index 0000000..6c37c8b --- /dev/null +++ b/tests/lib1/idirafter.pc @@ -0,0 +1,4 @@ +Name: Bad +Description: Demonstrates problems with -idirafter in both old pkg-config and current pkgconf; see also https://bugs.freedesktop.org/show_bug.cgi?id=97337 +Version: 1 +Cflags: -idirafter /opt/bad/include -idirafter /opt/bad2/include diff --git a/tests/regress.sh b/tests/regress.sh index 542f18d..99b13de 100755 --- a/tests/regress.sh +++ b/tests/regress.sh @@ -19,6 +19,8 @@ tests_init \ incomplete_cflags \ isystem_munge_order \ isystem_munge_sysroot \ + idirafter_munge_order \ + idirafter_munge_sysroot \ pcpath \ sysroot_munge @@ -152,6 +154,22 @@ isystem_munge_sysroot_body() pkgconf --cflags isystem } +idirafter_munge_order_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-idirafter /opt/bad/include -idirafter /opt/bad2/include \n" \ + pkgconf --cflags idirafter +} + +idirafter_munge_sysroot_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR='/test' + atf_check \ + -o match:"-idirafter /test/opt/bad/include" \ + pkgconf --cflags idirafter +} + pcpath_body() { export PKG_CONFIG_PATH="${selfdir}/lib2"