# I've submitted this patch to givaro at https://github.com/linbox-team/givaro/issues/155

diff -ur givaro-4.1.1/tests/Makefile.am givaro-4.1.1/tests/Makefile.am
--- givaro-4.1.1/tests/Makefile.am	2019-04-18 03:33:27.000000000 -0400
+++ givaro-4.1.1/tests/Makefile.am	2020-05-06 09:13:42.532677813 -0400
@@ -214,4 +214,4 @@
 # for compilation of new tests
 GIVARO_BIN=@bindir@
 %:%.C
-	$(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $*.C -o $*  `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD)  `$(GIVARO_BIN)/givaro-config --libs`
+	$(CXX) $(OPTFLAGS) $(AM_CPPFLAGS) $(AM_CXXFLAGS) $(CPPFLAGS) $(CXXFLAGS) $*.C -o $*  `$(GIVARO_BIN)/givaro-config --cflags` $(LDADD)  `$(GIVARO_BIN)/givaro-config --libs`
diff -ur /mike-raid/home/dan/src/M2/overnight/M2/BUILD/dan/builds.tmp/habanero-master/libraries/givaro/tmp/givaro-4.1.1/macros/gmp-check.m4 givaro-4.1.1/macros/gmp-check.m4
--- /mike-raid/home/dan/src/M2/overnight/M2/BUILD/dan/builds.tmp/habanero-master/libraries/givaro/tmp/givaro-4.1.1/macros/gmp-check.m4	2018-11-15 13:24:55.000000000 -0500
+++ givaro-4.1.1/macros/gmp-check.m4	2020-05-06 09:28:51.786460344 -0400
@@ -78,7 +78,7 @@
 	fi
 
 	##### OK, we have found a working GMP. Check if it has c++ bindings, and is recent enough
-	GMP_LIBS="$GMP_LIBS -lgmpxx"
+	GMP_LIBS="-lgmpxx $GMP_LIBS"
 	CXXFLAGS="${BACKUP_CXXFLAGS} ${GMP_CFLAGS}"
 	CPPFLAGS="${BACKUP_CPPFLAGS} ${GMP_CFLAGS}"
 	AC_LANG_PUSH([C++])
