Don't prepend sysroot_dir if pkg-config file lies outside of sysroot_dir
parent
fa859bb045
commit
8c9fd1a344
|
@ -406,6 +406,16 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
|
||||||
pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true);
|
pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true);
|
||||||
free(pc_filedir_value);
|
free(pc_filedir_value);
|
||||||
|
|
||||||
|
/* If pc_filedir is outside of sysroot_dir, clear pc_filedir
|
||||||
|
/* See https://github.com/pkgconf/pkgconf/issues/213
|
||||||
|
*/
|
||||||
|
if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir)))
|
||||||
|
{
|
||||||
|
free(client->sysroot_dir);
|
||||||
|
client->sysroot_dir = NULL;
|
||||||
|
pkgconf_client_set_sysroot_dir(client, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* make module id */
|
/* make module id */
|
||||||
if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)
|
if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)
|
||||||
idptr++;
|
idptr++;
|
||||||
|
|
|
@ -160,9 +160,9 @@ isystem_munge_order_body()
|
||||||
|
|
||||||
isystem_munge_sysroot_body()
|
isystem_munge_sysroot_body()
|
||||||
{
|
{
|
||||||
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR='/test'
|
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
|
||||||
atf_check \
|
atf_check \
|
||||||
-o match:"-isystem /test/opt/bad/include" \
|
-o match:"-isystem ${selfdir}/opt/bad/include" \
|
||||||
pkgconf --cflags isystem
|
pkgconf --cflags isystem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,9 +176,9 @@ idirafter_munge_order_body()
|
||||||
|
|
||||||
idirafter_munge_sysroot_body()
|
idirafter_munge_sysroot_body()
|
||||||
{
|
{
|
||||||
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR='/test'
|
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
|
||||||
atf_check \
|
atf_check \
|
||||||
-o match:"-idirafter /test/opt/bad/include" \
|
-o match:"-idirafter ${selfdir}/opt/bad/include" \
|
||||||
pkgconf --cflags idirafter
|
pkgconf --cflags idirafter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,15 +200,11 @@ pcpath_body()
|
||||||
|
|
||||||
sysroot_munge_body()
|
sysroot_munge_body()
|
||||||
{
|
{
|
||||||
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="/sysroot"
|
sed "s|/sysroot/|${selfdir}/|g" ${selfdir}/lib1/sysroot-dir.pc > ${selfdir}/lib1/sysroot-dir-selfdir.pc
|
||||||
|
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
|
||||||
atf_check \
|
atf_check \
|
||||||
-o inline:"-L/sysroot/lib -lfoo \n" \
|
-o inline:"-L${selfdir}/lib -lfoo \n" \
|
||||||
pkgconf --libs sysroot-dir
|
pkgconf --libs sysroot-dir-selfdir
|
||||||
|
|
||||||
export PKG_CONFIG_SYSROOT_DIR="/sysroot2"
|
|
||||||
atf_check \
|
|
||||||
-o inline:"-L/sysroot2/sysroot/lib -lfoo \n" \
|
|
||||||
pkgconf --libs sysroot-dir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual_variable_body()
|
virtual_variable_body()
|
||||||
|
@ -244,8 +240,8 @@ malformed_quoting_body()
|
||||||
|
|
||||||
explicit_sysroot_body()
|
explicit_sysroot_body()
|
||||||
{
|
{
|
||||||
export PKG_CONFIG_SYSROOT_DIR=/sysroot
|
export PKG_CONFIG_SYSROOT_DIR=${selfdir}
|
||||||
atf_check -o inline:"/sysroot/usr/share/test\n" \
|
atf_check -o inline:"${selfdir}/usr/share/test\n" \
|
||||||
pkgconf --with-path="${selfdir}/lib1" --variable=pkgdatadir explicit-sysroot
|
pkgconf --with-path="${selfdir}/lib1" --variable=pkgdatadir explicit-sysroot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ done
|
||||||
selfdir="@abs_top_srcdir@/tests"
|
selfdir="@abs_top_srcdir@/tests"
|
||||||
LIBRARY_PATH_ENV="LIBRARY_PATH"
|
LIBRARY_PATH_ENV="LIBRARY_PATH"
|
||||||
PATH_SEP=":"
|
PATH_SEP=":"
|
||||||
SYSROOT_DIR="${selfdir}/test"
|
SYSROOT_DIR="${selfdir}"
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
Haiku) LIBRARY_PATH_ENV="BELIBRARIES";;
|
Haiku) LIBRARY_PATH_ENV="BELIBRARIES";;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue