From caf4cc6399083ed5d9b461ee3f372a39337699ba Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 19 Dec 2014 20:45:18 -0800 Subject: Use AC_SEARCH_LIBS() for math functions. Use it to check whether we need -lm for various math functions - including floorl(). Let it handle adding -lm, rather than having that in the various _LDADD macros. Change-Id: Ic5d24ec35e060306351f4981c92e26879e597d81 Reviewed-on: https://code.wireshark.org/review/5908 Reviewed-by: Guy Harris --- configure.ac | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b55f2221a4..8fa43242f2 100644 --- a/configure.ac +++ b/configure.ac @@ -506,6 +506,23 @@ AC_SUBST(OSX_MIN_VERSION) # AC_SYS_LARGEFILE +# +# Look for math functions; use libm if necessary. +# +AC_SEARCH_LIBS(floor, m) +AC_SEARCH_LIBS(ceil, m) +AC_SEARCH_LIBS(exp, m) +AC_SEARCH_LIBS(log, m) +AC_SEARCH_LIBS(log10, m) +AC_SEARCH_LIBS(floorl, m, + [ + FLOORL_LO="" + AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.]) + ], + FLOORL_LO="floorl.lo") +AC_SUBST(FLOORL_LO) + + # # GUI toolkit options # @@ -2648,14 +2665,6 @@ AC_C_BIGENDIAN # XXX - do we need this? AC_PROG_GCC_TRADITIONAL -AC_CHECK_FUNC(floorl, - [ - FLOORL_LO="" - AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.]) - ], - FLOORL_LO="floorl.lo") -AC_SUBST(FLOORL_LO) - AC_CHECK_FUNC(getopt, [ GETOPT_LO="" -- cgit v1.2.1