summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-05-14 18:53:13 +0200
committerGravatar Nikias Bassen2020-05-14 18:53:13 +0200
commita2d66545d1303dd2cb5e0d56761aaf8a96bbc282 (patch)
tree3649b8e413098c64aa81faf0c43bb2a611db799d
parentce1092a5fc83e1b5590128b5f642200c382451a6 (diff)
downloadlibplist-a2d66545d1303dd2cb5e0d56761aaf8a96bbc282.tar.gz
libplist-a2d66545d1303dd2cb5e0d56761aaf8a96bbc282.tar.bz2
Fix configure check for -lm to actually check if -lm is required
AC_TRY_COMPILE doesn't try to link so we better use AC_TRY_LINK
-rw-r--r--configure.ac10
1 files changed, 8 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 65d3671..f5c01cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,12 +80,18 @@ esac
AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
# Check if we need libm for fmin
+CACHED_CFLAGS="$CFLAGS"
+CFLAGS="-O0"
AC_CACHE_CHECK(if fmin is a builtin function, ac_cv_fmin_builtin,
- AC_TRY_COMPILE([
+ AC_TRY_LINK([
#include <math.h>
+ #include <float.h>
], [
- fmin(0.1f, 0.2f);
+ double val = 3.1415f * 0.55555f;
+ double diff = fmin(val, DBL_MAX);
+ if (diff > 0) return 1;
], ac_cv_fmin_builtin=yes, ac_cv_fmin_builtin=no))
+CFLAGS="$CACHED_CFLAGS"
# Check if struct tm has a tm_gmtoff member
AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,