Fix the test whether frexpl() and ldexpl() are declared. Move the declaration
authorBruno Haible <bruno@clisp.org>
Wed, 7 Mar 2007 01:14:04 +0000 (01:14 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 7 Mar 2007 01:14:04 +0000 (01:14 +0000)
to <math.h>.

ChangeLog
m4/printf-frexpl.m4
modules/printf-frexpl

index 90a18c6..3827171 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2007-03-06  Bruno Haible  <bruno@clisp.org>
+
+       * lib/math_.h (acosl): Declare also if HAVE_DECL_ACOSL is set.
+       (asinl): Declare also if HAVE_DECL_ASINL is set.
+       (atanl): Declare also if HAVE_DECL_ATANL is set.
+       (ceill): Declare also if HAVE_DECL_CEILL is set.
+       (cosl): Declare also if HAVE_DECL_COSL is set.
+       (expl): Declare also if HAVE_DECL_EXPL is set.
+       (floorl): Declare also if HAVE_DECL_FLOORL is set.
+       (frexpl): Declare also if HAVE_DECL_FREXPL is set.
+       (ldexpl): Declare also if HAVE_DECL_LDEXPL is set.
+       (logl): Declare also if HAVE_DECL_LOGL is set.
+       (sinl): Declare also if HAVE_DECL_SINL is set.
+       (sqrtl): Declare also if HAVE_DECL_SQRTL is set.
+       (tanl): Declare also if HAVE_DECL_TANL is set.
+       * modules/math (Makefile.am): Substitute the values of HAVE_DECL_*.
+       * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Set HAVE_DECL_* to 1.
+       * m4/printf-frexpl.m4 (gl_FUNC_PRINTF_FREXPL): Fix tests for the
+       declaration of frexpl, ldexpl.
+       * modules/printf-frexpl (Depends-on): Add math.
+
 2007-03-05  Bruno Haible  <bruno@clisp.org>
 
        * m4/printf-frexpl.m4 (gl_FUNC_PRINTF_FREXPL): Also test whether
index e21ae36..d522d0e 100644 (file)
@@ -1,4 +1,4 @@
-# printf-frexpl.m4 serial 2
+# printf-frexpl.m4 serial 3
 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,
@@ -9,6 +9,7 @@ dnl Check how to define printf_frexpl() without linking with libm.
 AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
 [
   AC_REQUIRE([gt_TYPE_LONGDOUBLE])
+  AC_REQUIRE([gl_MATH_H_DEFAULTS])
   if test $gt_cv_c_long_double = yes; then
     AC_CACHE_CHECK([whether frexpl can be used without linking with libm],
       [gl_cv_func_frexpl_no_libm],
@@ -23,9 +24,9 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
     if test $gl_cv_func_frexpl_no_libm = yes; then
       AC_DEFINE([HAVE_FREXPL_IN_LIBC], 1,
         [Define if the frexpl function is available in libc.])
-      dnl Also check whether it's declared. glibc (2.3..2.5 at least) and
-      dnl MacOS X 10.3 have frexpl() in libc but don't declare it in <math.h>.
-      AC_CHECK_DECLS([frexpl])
+      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>])
     fi
 
     AC_CACHE_CHECK([whether ldexpl can be used without linking with libm],
@@ -41,9 +42,9 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
     if test $gl_cv_func_ldexpl_no_libm = yes; then
       AC_DEFINE([HAVE_LDEXPL_IN_LIBC], 1,
         [Define if the ldexpl function is available in libc.])
-      dnl Also check whether it's declared. glibc (2.3..2.5 at least) and
-      dnl MacOS X 10.3 have ldexpl() in libc but don't declare it in <math.h>.
-      AC_CHECK_DECLS([ldexpl])
+      dnl Also check whether it's declared.
+      dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+      AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>])
     fi
   fi
 ])
index 3d9e382..36d4f34 100644 (file)
@@ -10,6 +10,7 @@ m4/printf-frexpl.m4
 m4/longdouble.m4
 
 Depends-on:
+math
 
 configure.ac:
 gl_FUNC_PRINTF_FREXPL