Your message dated Thu, 25 Nov 2021 14:14:08 +0100
with message-id <[email protected]>
and subject line Re: singular FTCBFS: gmp check doesn't work
has caused the Debian Bug report #958095,
regarding singular FTCBFS: gmp check doesn't work
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
958095: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958095
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: singular
Version: 1:4.1.1-p2+ds-4
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

singular fails to cross build for a few reasons. In this bug report, I'm
addressing one of them. The check for GMP uses AC_TRY_RUN, which doesn't
work during cross compilation and the implemented fallback code doesn't
work either. Thus it thinks that GMP is missing and gives up. I've
reimplemented that part to not rely on AC_TRY_RUN as what we need here
can be examined using AC_COMPUTE_INT. What do you think about the
attached patch? Please close this bug when solving the gmp detection
issue even if singular still fails to cross build.

Helmut
--- singular-4.1.1-p2+ds.orig/m4/gmp-check.m4
+++ singular-4.1.1-p2+ds/m4/gmp-check.m4
@@ -56,50 +56,29 @@
 		[#include <gmp.h>],
 		[mpz_t a; mpz_init (a);],
 		[
-        		AC_TRY_RUN(
- 			[#include <gmp.h>
-			 int main () {  if (__GNU_MP_VERSION < 3) return -1; else return 0; }
-		  	],[
-				AC_MSG_RESULT(found)
-				AC_SUBST(GMP_CPPFLAGS)
-		  		AC_SUBST(GMP_LIBS)
-				AC_DEFINE(HAVE_GMP,1,[Define if GMP is installed])
-				# See if we are running GMP 4.0
-	   			AC_MSG_CHECKING(whether GMP is 4.0 or greater)
-		   		AC_TRY_RUN(
-		   		[#include <gmp.h>
-	    			int main () { if (__GNU_MP_VERSION < 4) return -1; else return 0; }
-	   			],[
-					gmp_found="yes"
-					AC_MSG_RESULT(yes)
-					GMP_VERSION=""
-					AC_SUBST(GMP_VERSION)
-				],[
-					AC_MSG_RESULT(no)
-					AC_DEFINE(GMP_VERSION_3,1,[Define if GMP is version 3.xxx])
-					GMP_VERSION="-DGMP_VERSION_3"
-					AC_SUBST(GMP_VERSION)
-				],[
-					dnl This should never happen
-					AC_MSG_RESULT(no)
-				])
-				ifelse([$2], , :, [$2])
-				break
-			],[
+			AC_COMPUTE_INT(GMP_VERSION_MAJOR,__GNU_MP_VERSION,[#include <gmp.h>],
+			[
+				GMP_VERSION_MAJOR=
 				gmp_problem="$gmp_problem $GMP_HOME"
 				unset GMP_CPPFLAGS
 				unset GMP_LIBS
-			],[
-				AC_MSG_RESULT(unknown)
-				echo "WARNING: You appear to be cross compiling, so there is no way to determine"
-				echo "whether your GMP version is new enough. I am assuming it is."
-				AC_SUBST(GMP_CPPFLAGS)
-				AC_SUBST(GMP_LIBS)
-				AC_SUBST(GMP_HOME)
-				HAVE_GMP=yes
-				AC_DEFINE(HAVE_GMP,1,[Define if GMP is installed])
+			])
+			AS_IF([test "x$GMP_VERSION_MAJOR" != x && test "$GMP_VERSION_MAJOR" -ge 4],[
+				gmp_found=yes
+				AC_MSG_RESULT([yes ($GMP_VERSION_MAJOR.X)])
+				GMP_VERSION=
+				AC_SUBST(GMP_VERSION)
+				ifelse([$2], , :, [$2])
+				break
+			],[test "x$GMP_VERSION_MAJOR" != x && test "$GMP_VERSION_MAJOR" -ge 3],[
+				AC_MSG_RESULT([no (found 3.X)])
+				AC_DEFINE(GMP_VERSION_3,1,[Define if GMP is version 3.xxx])
+				GMP_VERSION="-DGMP_VERSION_3"
+				AC_SUBST(GMP_VERSION)
 				ifelse([$2], , :, [$2])
 				break
+			],[
+				AC_MSG_RESULT([no (cannot determine gmp version)])
 			])
 		],[
 		gmp_found="no"

--- End Message ---
--- Begin Message ---
Dear Helmut, thanks for your report and your patch.
I apologize for my late reply.

I am now packaging the last version of the minor 2 series:
it appears that upstream substantially changed their m4/gmp-check.m4 .
Therefore your patch does not apply as-is any more.
This new version does not rely on AC_TRY_RUN but on AC_TRY_LINK .

I assume that the new version fixes the issue.
So I am closing the bug.

Please feel free to reopen it if the issue persists.

Best wishes,
Jerome


--
Jerome BENOIT | calculus+at-rezozer^dot*net
https://qa.debian.org/[email protected]
AE28 AE15 710D FF1D 87E5  A762 3F92 19A6 7F36 C68B

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


--- End Message ---
-- 
debian-science-maintainers mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to