summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@inbox.ru>2009-12-04 21:40:12 +0000
committerSergei Trofimovich <slyfox@inbox.ru>2009-12-04 21:40:12 +0000
commitf2bfd33806f1339ecd16eb76b0146544b65dc68e (patch)
tree65a9c3ea403ad7236f574de68ce0d00dad6f6e72 /configure.ac
parentaeeeda3efad5266b0c52b92807bb0cc3b3f23b5c (diff)
downloadhaskell-f2bfd33806f1339ecd16eb76b0146544b65dc68e.tar.gz
configure.ac: fix libm checks (Trac #3730)
libbfd pulled libm as dependency and broke LIBM= detection. Patch moves libm in library tests as early as possible. Thanks to asuffield for suggesting such a simple fix. Thanks to Roie Kerstein and Renato Gallo for finding and tracking down the issue.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 9 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index fa5f9a38e4..15b3c8547a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -723,18 +723,22 @@ if test $HaveLibMingwEx = YES ; then
AC_DEFINE([HAVE_MINGWEX], [1], [Define to 1 if you have the mingwex library.])
fi
-dnl ** check whether this machine has BFD and liberty installed (used for debugging)
-dnl the order of these tests matters: bfd needs liberty
-AC_CHECK_LIB(iberty, xmalloc)
-AC_CHECK_LIB(bfd, bfd_init)
-
dnl ** check for math library
+dnl Keep that check as early as possible.
+dnl as we need to know whether we need libm
+dnl for math functions or not
+dnl (see http://hackage.haskell.org/trac/ghc/ticket/3730)
AC_CHECK_FUNC(atan,[fp_libm_not_needed=yes;LIBM=],[fp_libm_not_needed=dunno])
if test x"$fp_libm_not_needed" = xdunno; then
AC_CHECK_LIB([m], [atan], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=])
fi
AC_SUBST([LIBM])
+dnl ** check whether this machine has BFD and liberty installed (used for debugging)
+dnl the order of these tests matters: bfd needs liberty
+AC_CHECK_LIB(iberty, xmalloc)
+AC_CHECK_LIB(bfd, bfd_init)
+
dnl ################################################################
dnl Check for libraries
dnl ################################################################