mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-02-04 20:00:29 +01:00
When pkg-config redefines the .pc file's prefix variable, it will be in the platform's native format. Convert the expected results as necessary. This only affects the relocatable test because it explicitly sets --define-prefix or uses .pc files in a pkgconfig/ directory. Other tests do not have their prefixes redefined for this reason.
37 lines
1.3 KiB
Bash
Executable file
37 lines
1.3 KiB
Bash
Executable file
#! /bin/sh
|
|
|
|
set -e
|
|
. ${srcdir}/common
|
|
|
|
# Test if pcfiledir metadata variable is substituted correctly
|
|
RESULT="-I${srcdir}/include -L${srcdir}/lib -lfoo"
|
|
run_test --cflags --libs pcfiledir
|
|
|
|
# Convert abs_top_srcdir to Windows format if necessary.
|
|
if [ "$native_win32" = yes ]; then
|
|
# Assume we have cmd to do the conversion, except we have to escape
|
|
# the command switch on MSYS.
|
|
[ "$OSTYPE" = msys ] && opt="\\/C" || opt="/C"
|
|
abs_top_srcdir=$($WINE cmd $opt echo "$abs_top_srcdir")
|
|
fi
|
|
|
|
# Test prefix redefinition for .pc files in pkgconfig directory. Try .pc
|
|
# files with both unexpanded and expanded variables. Use the absolute
|
|
# directory for the search path so that pkg-config can strip enough
|
|
# components of the file directory to be useful.
|
|
PKG_CONFIG_LIBDIR="${abs_srcdir}/pkgconfig"
|
|
for pkg in prefixdef prefixdef-expanded; do
|
|
# Typical redefinition
|
|
RESULT="-I${abs_top_srcdir}/include -L${abs_top_srcdir}/lib -lfoo"
|
|
run_test --define-prefix --cflags --libs $pkg
|
|
|
|
RESULT="-I/reloc/include -L/reloc/lib -lfoo"
|
|
run_test --dont-define-prefix --cflags --libs $pkg
|
|
|
|
# Non-standard redefinition
|
|
RESULT="-I/reloc/include -L${abs_top_srcdir} -lfoo"
|
|
run_test --define-prefix --prefix-variable=libdir --cflags --libs $pkg
|
|
|
|
RESULT="-I/reloc/include -L/reloc/lib -lfoo"
|
|
run_test --dont-define-prefix --cflags --libs $pkg
|
|
done
|