mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-05-21 17:38:26 +02:00
Exercise the ${pcfiledir} and --define-prefix features for allowing
relocation of packages. The --define-prefix test .pc files are put in a
pkgconfig subdirectory since the feature will only be enabled in that
situation.
29 lines
1 KiB
Bash
29 lines
1 KiB
Bash
#! /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
|
|
|
|
# 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
|