From 1c1bfbe71037e9b5a925a547e590e3628df00c7b Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 16 Dec 2009 11:36:52 +0000 Subject: [PATCH] fix up libm detection and use (#3724) --- configure.ac | 7 ++----- mk/config.mk.in | 3 --- rts/package.conf.in | 5 ++++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 15b3c85..a751e17 100644 --- a/configure.ac +++ b/configure.ac @@ -728,11 +728,8 @@ 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]) +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 diff --git a/mk/config.mk.in b/mk/config.mk.in index 4b8417a..f2d0776 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -302,9 +302,6 @@ SupportsSplitObjs=$(strip $(if $(filter YES,$(ArchSupportsSplitObjs)),\ # By default, enable SplitObjs for the libraries if this build supports it SplitObjs=$(SupportsSplitObjs) -# Math library -LIBM=@LIBM@ - # .NET interop support? # DotnetSupport=NO diff --git a/rts/package.conf.in b/rts/package.conf.in index 087a7e9..2dff162 100644 --- a/rts/package.conf.in +++ b/rts/package.conf.in @@ -27,7 +27,10 @@ library-dirs: TOP"/rts/dist/build" PAPI_LIB_DIR hs-libraries: "HSrts" -extra-libraries: "m" /* for ldexp() */ +extra-libraries: +#ifdef HAVE_LIBM + "m" /* for ldexp() */ +#endif #ifdef HAVE_LIBRT , "rt" #endif -- 1.7.10.4