libpkgconf: fragment: handle -idirafter in the same way as -isystem

(https://bugs.freedesktop.org/show_bug.cgi?id=97337)
pull/109/head
William Pitcock 2016-12-30 02:47:42 -06:00
parent c916e3a437
commit ad1e414dee
4 changed files with 25 additions and 0 deletions

View File

@ -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 \

View File

@ -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 != '/')

4
tests/lib1/idirafter.pc Normal file
View File

@ -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

View File

@ -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"