Compare commits
3 Commits
19b1befb5d
...
72e429ae70
Author | SHA1 | Date |
---|---|---|
Ariadne Conill | 72e429ae70 | |
Ariadne Conill | 7fa632a658 | |
Ariadne Conill | 9950312fde |
|
@ -100,6 +100,8 @@ EXTRA_DIST = pkg.m4 \
|
|||
tests/lib1/orphaned-requires-private.pc \
|
||||
tests/lib1/sysroot-dir-2.pc \
|
||||
tests/lib1/sysroot-dir-3.pc \
|
||||
tests/lib1/sysroot-dir-4.pc \
|
||||
tests/lib1/sysroot-dir-5.pc \
|
||||
$(test_scripts) \
|
||||
doc/conf.py \
|
||||
doc/extract.py \
|
||||
|
|
|
@ -330,15 +330,19 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const
|
|||
*
|
||||
* Finally, we call pkgconf_path_relocate() to clean the path of spurious elements.
|
||||
*/
|
||||
const char *sysroot_dir = pkgconf_tuple_find(client, vars, "pc_sysrootdir");
|
||||
if (sysroot_dir == NULL)
|
||||
sysroot_dir = client->sysroot_dir;
|
||||
|
||||
if (*buf == '/' &&
|
||||
client->sysroot_dir != NULL &&
|
||||
strcmp(client->sysroot_dir, "/") != 0 &&
|
||||
strlen(buf) > strlen(client->sysroot_dir) &&
|
||||
strstr(buf + strlen(client->sysroot_dir), client->sysroot_dir) != NULL)
|
||||
sysroot_dir != NULL &&
|
||||
strcmp(sysroot_dir, "/") != 0 &&
|
||||
strlen(buf) > strlen(sysroot_dir) &&
|
||||
strstr(buf + strlen(sysroot_dir), sysroot_dir) != NULL)
|
||||
{
|
||||
char cleanpath[PKGCONF_ITEM_SIZE];
|
||||
|
||||
pkgconf_strlcpy(cleanpath, buf + strlen(client->sysroot_dir), sizeof cleanpath);
|
||||
pkgconf_strlcpy(cleanpath, buf + strlen(sysroot_dir), sizeof cleanpath);
|
||||
pkgconf_path_relocate(cleanpath, sizeof cleanpath);
|
||||
|
||||
return strdup(cleanpath);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
prefix=/sysroot
|
||||
prefix=/sysroot/usr
|
||||
includedir=${prefix}/include
|
||||
libdir=${prefix}/lib
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
prefix=${pc_sysrootdir}/usr
|
||||
includedir=${prefix}/include
|
||||
libdir=${prefix}/lib
|
||||
|
||||
Name: sysroot-dir
|
||||
Description: Package for testing whether sysroot dirs are repeated or not
|
||||
Version: 1
|
||||
CFlags: -I${includedir}
|
||||
Libs: -L${libdir} -lfoo
|
|
@ -0,0 +1,9 @@
|
|||
prefix=/sysroot/usr
|
||||
includedir=${prefix}/include
|
||||
libdir=${prefix}/lib
|
||||
|
||||
Name: sysroot-dir
|
||||
Description: Package for testing whether sysroot dirs are repeated or not
|
||||
Version: 1
|
||||
CFlags: -I${includedir}
|
||||
Libs: -L${libdir} -lfoo
|
|
@ -6,6 +6,7 @@ tests_init \
|
|||
cflags \
|
||||
variable \
|
||||
do_not_eat_slash \
|
||||
do_not_duplicate_sysroot_dir
|
||||
|
||||
do_not_eat_slash_body()
|
||||
{
|
||||
|
@ -36,3 +37,27 @@ variable_body()
|
|||
-o inline:"${SYSROOT_DIR}/test/include\n" \
|
||||
pkgconf --variable=includedir foo
|
||||
}
|
||||
|
||||
do_not_duplicate_sysroot_dir_body()
|
||||
{
|
||||
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
||||
export PKG_CONFIG_SYSROOT_DIR="/sysroot"
|
||||
|
||||
atf_check \
|
||||
-o inline:"-I/sysroot/usr/include \n" \
|
||||
pkgconf --cflags sysroot-dir-2
|
||||
|
||||
atf_check \
|
||||
-o inline:"-I/sysroot/usr/include \n" \
|
||||
pkgconf --cflags sysroot-dir-3
|
||||
|
||||
atf_check \
|
||||
-o inline:"-I/sysroot/usr/include \n" \
|
||||
pkgconf --cflags sysroot-dir-5
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}"
|
||||
|
||||
atf_check \
|
||||
-o inline:"-I${SYSROOT_DIR}/usr/include \n" \
|
||||
pkgconf --cflags sysroot-dir-4
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue