[Gmp-commit] /var/hg/gmp: Fix setup of LD_LIBRARY_PATH for mini-gmp tests.

mercurial at gmplib.org mercurial at gmplib.org
Sat Nov 19 20:24:18 UTC 2016


details:   /var/hg/gmp/rev/2e2072f55b3f
changeset: 17119:2e2072f55b3f
user:      Niels Möller <nisse at lysator.liu.se>
date:      Sat Nov 19 21:23:06 2016 +0100
description:
Fix setup of LD_LIBRARY_PATH for mini-gmp tests.

diffstat:

 ChangeLog                |   4 +++-
 Makefile.am              |   3 +--
 mini-gmp/ChangeLog       |   3 +++
 mini-gmp/tests/run-tests |  10 ++++++++++
 4 files changed, 17 insertions(+), 3 deletions(-)

diffs (63 lines):

diff -r 87a3c6696f15 -r 2e2072f55b3f ChangeLog
--- a/ChangeLog	Sat Nov 19 16:47:01 2016 +0100
+++ b/ChangeLog	Sat Nov 19 21:23:06 2016 +0100
@@ -1,7 +1,9 @@
 2016-11-19  Niels Möller  <nisse at lysator.liu.se>
 
 	* Makefile.am (check-mini-gmp): Override CFLAGS and CPPFLAGS
-	instead of the deleted EXTRA_CFLAGS.
+	instead of the deleted EXTRA_CFLAGS. Set TEST_LIBRARY_PATH,
+	instead of LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, to avoid getting
+	gcc linked with an unexpected version of gmp.
 
 2016-11-18  Niels Möller  <nisse at lysator.liu.se>
 
diff -r 87a3c6696f15 -r 2e2072f55b3f Makefile.am
--- a/Makefile.am	Sat Nov 19 16:47:01 2016 +0100
+++ b/Makefile.am	Sat Nov 19 21:23:06 2016 +0100
@@ -427,8 +427,7 @@
 	abs_srcdir="`cd $(srcdir) && pwd`" ; \
 	$(MKDIR_P) mini-gmp/tests \
 	&& cd mini-gmp/tests \
-	&& LD_LIBRARY_PATH="../../.libs:$$LD_LIBRARY_PATH" \
-	   DYLD_LIBRARY_PATH="../../.libs:$$DYLD_LIBRARY_PATH" \
+	&& TEST_LIBRARY_PATH="../../.libs"  \
 	   $(MAKE) -f "$$abs_srcdir/mini-gmp/tests/Makefile" \
 		VPATH="$$abs_srcdir/mini-gmp/tests" \
 		srcdir="$$abs_srcdir/mini-gmp/tests" \
diff -r 87a3c6696f15 -r 2e2072f55b3f mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Sat Nov 19 16:47:01 2016 +0100
+++ b/mini-gmp/ChangeLog	Sat Nov 19 21:23:06 2016 +0100
@@ -1,5 +1,8 @@
 2016-11-19  Niels Möller  <nisse at lysator.liu.se>
 
+	* tests/run-tests: Set up LD_LIBRARY_PATH and DYLD_LIBRARY_PATH
+	for tests only, based on TEST_LIBRARY_PATH.
+
 	* tests/mini-random.h: Use name "../mini-gmp.h" for include, so we
 	don't need any -I options to the compiler.
 
diff -r 87a3c6696f15 -r 2e2072f55b3f mini-gmp/tests/run-tests
--- a/mini-gmp/tests/run-tests	Sat Nov 19 16:47:01 2016 +0100
+++ b/mini-gmp/tests/run-tests	Sat Nov 19 21:23:06 2016 +0100
@@ -54,10 +54,20 @@
   fi
 }
 
+TEST_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
+TEST_DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH"
+
+if [ "$TEST_LIBRARY_PATH" ] ; then
+  TEST_LD_LIBRARY_PATH="$TEST_LIBRARY_PATH:$TEST_LD_LIBRARY_PATH"
+  TEST_DYLD_LIBRARY_PATH="$TEST_LIBRARY_PATH:$TEST_DYLD_LIBRARY_PATH"
+fi
+
 test_program () {
   testname=`basename "$1" .exe`
   testname=`basename "$testname" -test`
   if [ -z "$EMULATOR" ] || head -1 "$1" | grep '^#!' > /dev/null; then
+    LD_LIBRARY_PATH="$TEST_LD_LIBRARY_PATH" \
+    DYLD_LIBRARY_PATH="$TEST_DYLD_LIBRARY_PATH" \
     "$1" $testflags
   else
     $EMULATOR "$1" $testflags


More information about the gmp-commit mailing list