Commit f2bfd338 authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

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.
parent aeeeda3e
...@@ -723,18 +723,22 @@ if test $HaveLibMingwEx = YES ; then ...@@ -723,18 +723,22 @@ if test $HaveLibMingwEx = YES ; then
AC_DEFINE([HAVE_MINGWEX], [1], [Define to 1 if you have the mingwex library.]) AC_DEFINE([HAVE_MINGWEX], [1], [Define to 1 if you have the mingwex library.])
fi 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 ** 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]) AC_CHECK_FUNC(atan,[fp_libm_not_needed=yes;LIBM=],[fp_libm_not_needed=dunno])
if test x"$fp_libm_not_needed" = xdunno; then if test x"$fp_libm_not_needed" = xdunno; then
AC_CHECK_LIB([m], [atan], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=]) AC_CHECK_LIB([m], [atan], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=])
fi fi
AC_SUBST([LIBM]) 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 ################################################################
dnl Check for libraries dnl Check for libraries
dnl ################################################################ dnl ################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment