summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 19 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index ffbcfbc..375dd69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,18 +122,35 @@ esac
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([complex.h locale.h inttypes.h stdint.h limits.h unistd.h sys/time.h])
+AC_HEADER_TIME
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
-AC_HEADER_TIME
# Checks for libraries.
-AC_CHECK_LIB([m], [creal])
+AC_CHECK_HEADERS(
+ [complex.h],
+ [
+ AC_MSG_CHECKING(whether creal and cimag can be used without libm)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <complex.h>]],
+ [[complex double x = 1.0 + 2.0 * I; return (creal (x) + cimag (x));]]
+ )],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_CHECK_LIB([m], [creal])
+ ]
+ )
+ ]
+ )
AC_CHECK_LIB([gmp], [__gmpz_init],
[LIBS="-lgmp $LIBS"],
[AC_MSG_ERROR([libgmp not found or uses a different ABI.])])
+
AC_MSG_CHECKING(for MPFR)
LIBS="-lmpfr $LIBS"
AC_LINK_IFELSE(