Source: libquantum
Version: 1.1.1-5
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

libquantum fails to cross build from source, because it uses
AC_RUN_IFELSE. In some situations, that macro is unavoidable. The use of
libquantum isn't, because it is evaluating a compile-time constant. We
can also check that using AC_CHECK_SIZEOF and AC_COMPUTE_INT, both of
which work during cross compilation. Please consider applying the
attached patch to avoid using AC_RUN_IFELSE at no cost in functionality.

Helmut
--- libquantum-1.1.1.orig/configure.in
+++ libquantum-1.1.1/configure.in
@@ -96,11 +96,15 @@
 	AC_MSG_ERROR([No complex number type!])
 fi
 
+AC_CHECK_SIZEOF([double])
+AC_COMPUTE_INT([SIZEOF_CF_TYPE],[sizeof($CF_TYPE)])
+SIZEOF_2DOUBLE=`expr $ac_cv_sizeof_double + $ac_cv_sizeof_double`
+
 AC_MSG_CHECKING([for corresponding real data type])
-AC_RUN_IFELSE(
-	[AC_LANG_PROGRAM([], [return sizeof($CF_TYPE) == 2*sizeof(double)])],
-	[RF_TYPE="float"],
-	[RF_TYPE="double"; AC_DEFINE(USE_DOUBLE)], [float])
+AS_IF(
+      	[test "$SIZEOF_2DOUBLE" = "$SIZEOF_CF_TYPE"],
+	[RF_TYPE="double"; AC_DEFINE(USE_DOUBLE)],
+	[RF_TYPE="float"])
 AC_MSG_RESULT($RF_TYPE)
 
 

Reply via email to