diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-12-19 20:45:18 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-12-20 04:45:48 +0000 |
commit | caf4cc6399083ed5d9b461ee3f372a39337699ba (patch) | |
tree | 3a179c25e592bb467ef507ff209edec19e41866e /configure.ac | |
parent | 1a051afee3fdbbec399af66c4cc934ce18f311da (diff) |
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 <guy@alum.mit.edu>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index b55f2221a4..8fa43242f2 100644 --- a/configure.ac +++ b/configure.ac @@ -507,6 +507,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 # AC_ARG_WITH([qt], @@ -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="" |