summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-03-23 01:26:24 +0000
committerBruno Haible <bruno@clisp.org>2007-03-23 01:26:24 +0000
commit8abd907483addabfc096285697371aed37e4d8e2 (patch)
tree28a8fca3569f4b9ec12f0618d4d19e0504a5ee95 /m4
parent277bd9826cebcc6fde7e6fd8c0afbe5638768961 (diff)
downloadgnulib-8abd907483addabfc096285697371aed37e4d8e2.tar.gz
New module 'frexpl'.
Diffstat (limited to 'm4')
-rw-r--r--m4/frexpl.m447
-rw-r--r--m4/math_h.m45
-rw-r--r--m4/mathl.m46
3 files changed, 53 insertions, 5 deletions
diff --git a/m4/frexpl.m4 b/m4/frexpl.m4
new file mode 100644
index 0000000000..361fd2d867
--- /dev/null
+++ b/m4/frexpl.m4
@@ -0,0 +1,47 @@
+# frexpl.m4 serial 1
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FREXPL],
+[
+ AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ FREXPL_LIBM=
+ AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
+ [gl_cv_func_frexpl_no_libm],
+ [
+ AC_TRY_LINK([#include <math.h>
+ long double x;],
+ [int e; return frexpl (x, &e) > 0;],
+ [gl_cv_func_frexpl_no_libm=yes],
+ [gl_cv_func_frexpl_no_libm=no])
+ ])
+ if test $gl_cv_func_frexpl_no_libm = no; then
+ AC_CACHE_CHECK([whether frexpl() can be used with libm],
+ [gl_cv_func_frexpl_in_libm],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS -lm"
+ AC_TRY_LINK([#include <math.h>
+ long double x;],
+ [int e; return frexpl (x, &e) > 0;],
+ [gl_cv_func_frexpl_in_libm=yes],
+ [gl_cv_func_frexpl_in_libm=no])
+ LIBS="$save_LIBS"
+ ])
+ if test $gl_cv_func_frexpl_in_libm = yes; then
+ FREXPL_LIBM=-lm
+ fi
+ fi
+ if test $gl_cv_func_frexpl_no_libm = yes \
+ || test $gl_cv_func_frexpl_in_libm = yes; then
+ AC_DEFINE([HAVE_FREXPL], 1,
+ [Define if the frexpl() function is available.])
+ dnl Also check whether it's declared.
+ dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+ else
+ AC_LIBOBJ([frexpl])
+ fi
+])
diff --git a/m4/math_h.m4 b/m4/math_h.m4
index 5b393f4b84..fb3ea09f2b 100644
--- a/m4/math_h.m4
+++ b/m4/math_h.m4
@@ -21,8 +21,9 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR],
AC_DEFUN([gl_MATH_H_DEFAULTS],
[
- GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
- GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL])
+ GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
+ GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
+ GNULIB_MATHL=0; AC_SUBST([GNULIB_MATHL])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
diff --git a/m4/mathl.m4 b/m4/mathl.m4
index c875203d41..57d70a5a7a 100644
--- a/m4/mathl.m4
+++ b/m4/mathl.m4
@@ -1,5 +1,5 @@
-# mathl.m4 serial 2
-dnl Copyright (c) 2003 Free Software Foundation, Inc.
+# mathl.m4 serial 3
+dnl Copyright (c) 2003, 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_LONG_DOUBLE_MATH], [
AC_CHECK_LIB(m, atan)
-AC_REPLACE_FUNCS(floorl ceill sqrtl frexpl ldexpl asinl acosl atanl \
+AC_REPLACE_FUNCS(floorl ceill sqrtl ldexpl asinl acosl atanl \
logl expl tanl sinl cosl)
])