X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=configure.ac;h=a751e17a8555a6190257962d8ecb425c660e1ed0;hb=d9a2eefd17cd91e7193616d955056fddf3dab305;hp=fa5f9a38e408eb03ef0eb7581118a5fcc4f5e3f1;hpb=aeeeda3efad5266b0c52b92807bb0cc3b3f23b5c;p=ghc-hetmet.git diff --git a/configure.ac b/configure.ac index fa5f9a3..a751e17 100644 --- a/configure.ac +++ b/configure.ac @@ -723,18 +723,19 @@ if test $HaveLibMingwEx = YES ; then AC_DEFINE([HAVE_MINGWEX], [1], [Define to 1 if you have the mingwex library.]) fi +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_SEARCH_LIBS(atan, m, + [AC_DEFINE([HAVE_LIBM], [1], [Define to 1 if you need to link with 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 ** check for math library -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 ################################################################ dnl Check for libraries dnl ################################################################