diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2013-04-19 05:55:28 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2013-05-17 05:13:15 -0700 |
commit | 32427bf2c648fd7425bc1e63636f5aa7456cd050 (patch) | |
tree | bbefed90b0593dcb2dd333c4f305b90de6b16fb8 | |
parent | e7238e823feb1cf9a97c241a8d4d177ca58bea36 (diff) | |
download | pkg-config-32427bf2c648fd7425bc1e63636f5aa7456cd050.tar.gz |
check: Test relocatable features
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.
-rw-r--r-- | check/Makefile.am | 8 | ||||
-rw-r--r-- | check/check-relocatable | 29 | ||||
-rw-r--r-- | check/pcfiledir.pc | 11 | ||||
-rw-r--r-- | check/pkgconfig/prefixdef-expanded.pc | 11 | ||||
-rw-r--r-- | check/pkgconfig/prefixdef.pc | 11 |
5 files changed, 68 insertions, 2 deletions
diff --git a/check/Makefile.am b/check/Makefile.am index 5006b5f..f348128 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -25,7 +25,8 @@ TESTS = \ check-uninstalled \ check-debug \ check-gtk \ - check-tilde + check-tilde \ + check-relocatable EXTRA_DIST = \ $(TESTS) \ @@ -92,4 +93,7 @@ EXTRA_DIST = \ gtk/xcb.pc \ gtk/xproto.pc \ gtk/xrender.pc \ - tilde.pc + tilde.pc \ + pkgconfig/prefixdef.pc \ + pkgconfig/prefixdef-expanded.pc \ + pcfiledir.pc diff --git a/check/check-relocatable b/check/check-relocatable new file mode 100644 index 0000000..dc320c4 --- /dev/null +++ b/check/check-relocatable @@ -0,0 +1,29 @@ +#! /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 diff --git a/check/pcfiledir.pc b/check/pcfiledir.pc new file mode 100644 index 0000000..da50e6d --- /dev/null +++ b/check/pcfiledir.pc @@ -0,0 +1,11 @@ +prefix=${pcfiledir} +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: pcfiledir relocation test +Description: Test pkg-config pcfiledir metadata variable +Version: 1.0.0 +Requires: +Libs: -L${libdir} -lfoo +Cflags: -I${includedir} diff --git a/check/pkgconfig/prefixdef-expanded.pc b/check/pkgconfig/prefixdef-expanded.pc new file mode 100644 index 0000000..464334a --- /dev/null +++ b/check/pkgconfig/prefixdef-expanded.pc @@ -0,0 +1,11 @@ +prefix=/reloc +exec_prefix=/reloc +libdir=/reloc/lib +includedir=/reloc/include + +Name: Prefix redefinition with expanded variables test +Description: Test magic prefix redefinition when variables expanded +Version: 1.0.0 +Requires: +Libs: -L${libdir} -lfoo +Cflags: -I${includedir} diff --git a/check/pkgconfig/prefixdef.pc b/check/pkgconfig/prefixdef.pc new file mode 100644 index 0000000..9f4a4ba --- /dev/null +++ b/check/pkgconfig/prefixdef.pc @@ -0,0 +1,11 @@ +prefix=/reloc +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Prefix redefinition test +Description: Test pkg-config magic prefix redefinition +Version: 1.0.0 +Requires: +Libs: -L${libdir} -lfoo +Cflags: -I${includedir} |