diff --git a/configure.ac b/configure.ac index 0b28153be..5db524c9f 100644 --- a/configure.ac +++ b/configure.ac @@ -159,37 +159,39 @@ if test x"$has_gmp" != x"yes"; then AC_CHECK_HEADER( gmp.h, [AC_CHECK_LIB(gmp, __gmpz_init, [], [AC_MSG_ERROR([libgmp not found or unusable])])], - [AC_MSG_ERROR([gmp header not found])] + [has_gmp=no] ) - # Proper support for macOS aarch64 was introduced in 6.3.0, but LTS distros - # like Ubuntu 20.04 (focal) use 6.2.0, so, the minimum supported version is - # determined by platform and architecture. - case $host in - *darwin*) - case $host_cpu in - aarch*) - gmp_major_version=6 - gmp_minor_version=3 - ;; - esac - ;; - *) - gmp_major_version=6 - gmp_minor_version=2 - ;; - esac - AC_MSG_CHECKING([gmp version >= $gmp_major_version.$gmp_minor_version]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include ]], - [[ - @%:@if __GNU_MP_VERSION < $gmp_major_version || __GNU_MP_VERSION_MINOR < $gmp_minor_version - @%:@error Unsupported GMP version - @%:@endif]])], - [AC_MSG_RESULT([yes]); has_gmp=yes; GMP_LIBS="-lgmp";], - [AC_MSG_RESULT([no]); AC_MSG_ERROR([unsupported gmp version])] - ) + if test x"$has_gmp" != x"no"; then + # Proper support for macOS aarch64 was introduced in 6.3.0, but LTS distros + # like Ubuntu 20.04 (focal) use 6.2.0, so, the minimum supported version is + # determined by platform and architecture. + case $host in + *darwin*) + case $host_cpu in + aarch*) + gmp_major_version=6 + gmp_minor_version=3 + ;; + esac + ;; + *) + gmp_major_version=6 + gmp_minor_version=2 + ;; + esac + AC_MSG_CHECKING([gmp version >= $gmp_major_version.$gmp_minor_version]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include ]], + [[ + @%:@if __GNU_MP_VERSION < $gmp_major_version || __GNU_MP_VERSION_MINOR < $gmp_minor_version + @%:@error Unsupported GMP version + @%:@endif]])], + [AC_MSG_RESULT([yes]); has_gmp=yes; GMP_LIBS="-lgmp";], + [AC_MSG_RESULT([no]); AC_MSG_ERROR([unsupported gmp version])] + ) + fi CPPFLAGS="$CPPFLAGS_TEMP" LIBS="$LIBS_TEMP"