summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cowgill <jcowgill@debian.org>2020-01-02 13:04:30 +0000
committerJames Cowgill <jcowgill@debian.org>2020-01-02 13:19:52 +0000
commit7cc5b1050b1b31e9436e6f15876f8d62d1f1d144 (patch)
tree395effebfef64204bb019ec581965e43538097a1
parent27fa2eaac7b9379d09d486ff02229b1df5a7ab68 (diff)
d/tests: Make library-build test cross test friendly
Allow the library-build test to work in a cross environment by invoking cross tools to build the test executables. Based on the original patch in #946236 but with a few simplifications. Closes: #946236 Thanks: Steve Langasek for the original patch
-rw-r--r--debian/tests/library-build6
1 files changed, 4 insertions, 2 deletions
diff --git a/debian/tests/library-build b/debian/tests/library-build
index ab8b6d7d7..f33a4a358 100644
--- a/debian/tests/library-build
+++ b/debian/tests/library-build
@@ -11,9 +11,11 @@ cp debian/tests/library-build.c "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"
# Compile with and without pkg-config
-gcc -Wall -Wextra -O2 library-build.c -o build1 -laom
+CROSS_COMPILE="${DEB_HOST_GNU_TYPE:+$DEB_HOST_GNU_TYPE-}"
+
+${CROSS_COMPILE}gcc -Wall -Wextra -O2 library-build.c -o build1 -laom
echo "build1: compiled"
-gcc -Wall -Wextra -O2 library-build.c -o build2 $(pkg-config --cflags --libs aom)
+${CROSS_COMPILE}gcc -Wall -Wextra -O2 library-build.c -o build2 $(${CROSS_COMPILE}pkg-config --cflags --libs aom)
echo "build2: compiled"
# Run the tests