2013-04-19 05:55:28 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
. ${srcdir}/common
|
|
|
|
|
|
2014-02-10 09:35:40 -08:00
|
|
|
# Convert absolute directories to Windows format if necessary.
|
2013-05-22 18:53:26 -07:00
|
|
|
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"
|
2015-02-21 11:37:49 -08:00
|
|
|
abs_top_srcdir=$($WINE cmd $opt echo "$abs_top_srcdir" | tr -d '\r')
|
|
|
|
|
abs_srcdir=$($WINE cmd $opt echo "$abs_srcdir" | tr -d '\r')
|
2013-05-22 18:53:26 -07:00
|
|
|
fi
|
|
|
|
|
|
2014-02-10 09:35:40 -08:00
|
|
|
# See if the pcfiledir variable is defined. First, with the path
|
|
|
|
|
# built from the relative PKG_CONFIG_LIBDIR. Second, with the path
|
|
|
|
|
# built from the full path to the pc file.
|
|
|
|
|
RESULT=$srcdir
|
|
|
|
|
run_test --variable=pcfiledir pcfiledir
|
|
|
|
|
RESULT=$abs_srcdir
|
|
|
|
|
run_test --variable=pcfiledir "$abs_srcdir/pcfiledir.pc"
|
|
|
|
|
|
|
|
|
|
# Test if pcfiledir metadata variable is substituted correctly
|
|
|
|
|
RESULT="-I${srcdir}/include -L${srcdir}/lib -lfoo"
|
|
|
|
|
run_test --cflags --libs pcfiledir
|
|
|
|
|
|
2013-04-19 05:55:28 -07:00
|
|
|
# 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
|