From a2d66545d1303dd2cb5e0d56761aaf8a96bbc282 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 14 May 2020 18:53:13 +0200 Subject: 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 --- configure.ac | 10 ++++++++-- 1 file 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 + #include ], [ - 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, -- cgit v1.1-32-gdbae