summaryrefslogtreecommitdiff
path: root/m4/jm-macros.m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-07-09 17:46:11 +0000
committerJim Meyering <jim@meyering.net>2000-07-09 17:46:11 +0000
commitd2269d5c1b3e4267997bf7aca25439c579638d92 (patch)
treea64f66ff6cbe8e12cee14cf0d0811565c3273bd8 /m4/jm-macros.m4
parent0fe0294290d20f949fe86d0459e2dd576c6a9e5f (diff)
downloadcoreutils-d2269d5c1b3e4267997bf7aca25439c579638d92.tar.xz
(jm_MACROS): Add a test to see if -lm is required
to link seq. If so, set SEQ_LIBM to -lm. From Bruno Haible.
Diffstat (limited to 'm4/jm-macros.m4')
-rw-r--r--m4/jm-macros.m416
1 files changed, 16 insertions, 0 deletions
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 6ed662cfd..b60b6ff22 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -188,6 +188,22 @@ AC_DEFUN(jm_MACROS,
AC_SUBST(POW_LIBM)
test $am_cv_func_strtod_needs_libm = yes && POW_LIBM=-lm
+ # See if linking `seq' requires -lm.
+ # It does on nearly every system. The single exception (so far) is
+ # BeOS which doesn't even have a separate math library.
+ AC_SUBST(SEQ_LIBM)
+ ac_seq_body='
+ static double x, y;
+ x = floor (x);
+ x = rint (x);
+ x = modf (x, &y);'
+ AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
+ [ac_seq_save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
+ LIBS="$ac_seq_save_LIBS"
+ ])
+
jm_LANGINFO_CODESET
jm_GLIBC21
jm_ICONV