Ensure -L is never merged back

pull/81/head
Baptiste Daroussin 2015-07-19 22:49:36 +02:00
parent 9f49c7db95
commit 5a8dadafc6
4 changed files with 30 additions and 0 deletions

View File

@ -115,6 +115,8 @@ pkg_fragment_can_merge_back(pkg_fragment_t *base, unsigned int flags, bool is_pr
if (base->type == 'F')
return false;
if (base->type == 'L')
return false;
return true;
}

12
tests/lib1/prefix-foo1.pc Normal file
View File

@ -0,0 +1,12 @@
prefix=/usr/bar
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: prefix-foo1
Description: A testing pkg-config file
Version: 1.2.3
Libs: -L${libdir} -lfoo1
Cflags: -fPIC -I${includedir}/foo1
Cflags.private: -DFOO_STATIC

12
tests/lib1/prefix-foo2.pc Normal file
View File

@ -0,0 +1,12 @@
prefix=/usr/bar
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: prefix-foo2
Description: A testing pkg-config file
Version: 1.2.3
Libs: -L${libdir} -lfoo2
Cflags: -fPIC -I${includedir}/foo2
Cflags.private: -DFOO_STATIC

View File

@ -264,6 +264,10 @@ run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/sysroot' ${
'-L/sysroot/lib -lfoo'
run_test "PKG_CONFIG_PATH='${selfdir}/lib1' PKG_CONFIG_SYSROOT_DIR='/sysroot2' ${1} --libs sysroot-dir" \
'-L/sysroot2/sysroot/lib -lfoo'
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'
# 10) tests for internal getopt implementation with options at the end
if [ "x@STRICT_MODE@" = "xno" ]; then