Source: algol68g
Version: 3.1.2-1
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs
algol68g fails to cross build from source, because it uses a number of
AC_RUN_IFELSE tests. That macro does not work for cross compilation as
running is what does not work. However, many of them simply check for
sizes of types (where AC_CHECK_SIZEOF can be used). It turns out that
sufficiently many can be replaced that cross building algol68g becomes
feasible. I'm attaching a patch for your convenience.
Helmut
--- algol68g-3.1.2.orig/configure.ac
+++ algol68g-3.1.2/configure.ac
@@ -340,11 +340,10 @@
# Test on gcc capabilities.
#
AC_MSG_CHECKING([__attribute__((aligned())) supported])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [typedef int aint __attribute__((aligned(8)));])],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [typedef int aint __attribute__((aligned(8)));])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
- AC_MSG_FAILURE([stop -- C compiler does not support __attribute__aligned directive])],
- [])
+ AC_MSG_FAILURE([stop -- C compiler does not support __attribute__aligned directive])])
AC_C_INLINE()
#
# Set -I/usr/local/include for *BSD
@@ -609,31 +608,23 @@
AC_MSG_NOTICE([optional headers and libraries...])
if test "x$enable_standard_types" = "xyes"; then
- AC_MSG_CHECKING([int is 32 bit])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (int) != 4;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([unsigned is 32 bit])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (unsigned) != 4;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([double is 64 bit])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (double) != 8;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([uint64_t is 64 bit])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdint.h>], [return sizeof (uint64_t) != 8;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_standard_types=no
- enable_long_types=no],
- [])
+ AC_CHECK_SIZEOF([int])
+ if test "x$ac_cv_sizeof_int" != x4; then
+ enable_long_types=no
+ fi
+ AC_CHECK_SIZEOF([unsigned])
+ if test "x$ac_cv_sizeof_unsigned" != x4; then
+ enable_long_types=no
+ fi
+ AC_CHECK_SIZEOF([double])
+ if test "x$ac_cv_sizeof_double" != x8; then
+ enable_long_types=no
+ fi
+ AC_CHECK_SIZEOF([uint64_t],[],[#include <stdint.h>])
+ if test "x$ac_cv_sizeof_uint64_t" != x8; then
+ enable_standard_types=no
+ enable_long_types=no
+ fi
fi
if test "x$enable_standard_types" = "xno"; then
@@ -641,36 +632,28 @@
fi
if test "x$enable_long_types" = "xyes"; then
- AC_MSG_CHECKING([64-bit long long int is available])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (long long) != 8;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([64-bit long long unsigned is available])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (long long unsigned) != 8;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([80-bit __float80 is available])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (__float80) != 16;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([80-bit __float80 has 64-bit mantissa])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <float.h>], [return LDBL_MANT_DIG != 64;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
- AC_MSG_CHECKING([128-bit __float128 is available])
- AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return sizeof (__float128) != 16;])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- enable_long_types=no],
- [])
+ AC_CHECK_SIZEOF([long long])
+ if test "x$ac_cv_sizeof_long_long" != x8; then
+ enable_long_types=no
+ fi
+ AC_CHECK_SIZEOF([long long unsigned])
+ if test "x$ac_cv_sizeof_long_long_unsigned" != x8; then
+ enable_long_types=no
+ fi
+ AC_CHECK_SIZEOF([__float80])
+ if test "x$ac_cv_sizeof___float80" != x8; then
+ enable_long_types=no
+ fi
+ AC_CACHE_CHECK([LDBL_MANT_DIG],[ac_cv_ldbl_mant_dig],
+ [AC_COMPUTE_INT([ac_cv_ldbl_mant_dig],[LDBL_MANT_DIG],[#include <float.h>])]
+ )
+ if test "x$ac_cv_ldbl_mant_dig" != x64; then
+ enable_long_types=no
+ fi
+ AC_CHECK_SIZEOF([__float128])
+ if test "x$ac_cv_sizeof___float128" != x16; then
+ enable_long_types=no
+ fi
if test "x$enable_long_types" = "xyes"; then
AC_DEFINE(HAVE_LONG_TYPES, 1, [Define this if a good INT*8/REAL*10/REAL*16 installation was detected])
fi