aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2022-02-05 12:03:25 +0100
committerKai Pastor <dg0yt@darc.de>2022-02-05 18:06:45 +0100
commit2b0ecb6f19b1be906a39eac5143d4c40252f0a5a (patch)
tree1e1dbab6c61780139e3bf67b566ce3478a86019c /test
parent295c67869270dc9319f965f1c18108fad516296e (diff)
downloadPROJ-2b0ecb6f19b1be906a39eac5143d4c40252f0a5a.tar.gz
PROJ-2b0ecb6f19b1be906a39eac5143d4c40252f0a5a.zip
Adapt testing to recursive pkg-config requirements
When pkg-config is called with --static, it will recursively collect all Libs and Libs.private which are discovered via Requires and Requires.private. So these libs must be available for linking even when acutally only lib proj uses static linkage. Libs and pkg-config must be provided for the target triplet.
Diffstat (limited to 'test')
-rw-r--r--test/postinstall/c_app/makefile.mak6
-rwxr-xr-xtest/postinstall/test_autotools.sh5
-rwxr-xr-xtest/postinstall/test_pkg-config.sh1
3 files changed, 7 insertions, 5 deletions
diff --git a/test/postinstall/c_app/makefile.mak b/test/postinstall/c_app/makefile.mak
index 3e29d4b1..01d1c259 100644
--- a/test/postinstall/c_app/makefile.mak
+++ b/test/postinstall/c_app/makefile.mak
@@ -6,18 +6,18 @@ TESTS = \
test_searchpath.sh \
test_version.sh
-override CFLAGS += -g -Wall -Werror $(shell pkg-config proj --cflags)
+override CFLAGS += -g -Wall -Werror $(shell ${PKG_CONFIG} proj --cflags)
ifeq ($(BUILD_MODE),static)
UNAME_S := $(shell uname -s)
- _ldflags := $(shell pkg-config proj --libs --static)
+ _ldflags := $(shell ${PKG_CONFIG} proj --libs --static)
ifeq ($(UNAME_S),Linux)
# force static linking to libproj
_ldflags := $(shell echo $(_ldflags) | sed 's/-lproj/-Wl,-Bstatic -lproj -Wl,-Bdynamic/')
endif
override LDFLAGS += $(_ldflags)
else # default is shared
- override LDFLAGS += $(shell pkg-config proj --libs)
+ override LDFLAGS += $(shell ${PKG_CONFIG} proj --libs)
endif
all: $(PROGRAM)
diff --git a/test/postinstall/test_autotools.sh b/test/postinstall/test_autotools.sh
index 28954c4d..c3e0e60b 100755
--- a/test/postinstall/test_autotools.sh
+++ b/test/postinstall/test_autotools.sh
@@ -12,12 +12,13 @@ main_setup $1 $2
echo "Running post-install tests with autotools/pkg-config (${BUILD_MODE})"
if [ ${BUILD_MODE} = shared ]; then
- export PKG_CONFIG="pkg-config"
+ export PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
ENABLE_STATIC_PROJ=no
else
- export PKG_CONFIG="pkg-config --static"
+ export PKG_CONFIG="${PKG_CONFIG:-pkg-config} --static"
ENABLE_STATIC_PROJ=yes
fi
+echo ,${PKG_CONFIG},
export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig
diff --git a/test/postinstall/test_pkg-config.sh b/test/postinstall/test_pkg-config.sh
index a9ccabce..d170e189 100755
--- a/test/postinstall/test_pkg-config.sh
+++ b/test/postinstall/test_pkg-config.sh
@@ -11,6 +11,7 @@ main_setup $1 $2
echo "Running post-install tests with pkg-config (${BUILD_MODE})"
+export PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig
if [ ${BUILD_MODE} = shared ]; then