Use the shared tests for the floor* and ceil* functions.
authorBruno Haible <bruno@clisp.org>
Sun, 11 Nov 2007 13:17:22 +0000 (14:17 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 11 Nov 2007 13:17:22 +0000 (14:17 +0100)
ChangeLog
m4/round.m4
m4/roundf.m4
m4/roundl.m4
modules/round
modules/roundf
modules/roundl

index 3bdb99ed3b7ce7676619b66174ee5435a9e9ceac..ef5eb8fbcfa390f76583152cbfecc01d8c679c49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-11-11  Bruno Haible  <bruno@clisp.org>
+
+       * m4/roundf.m4 (gl_FUNC_ROUNDF): Use gl_FUNC_FLOORF_LIBS and
+       gl_FUNC_CEILF_LIBS.
+       * m4/round.m4 (gl_FUNC_ROUND): Use gl_FUNC_FLOOR_LIBS and
+       gl_FUNC_CEIL_LIBS.
+       * m4/roundl.m4 (gl_FUNC_ROUNDL): Use gl_FUNC_FLOORL_LIBS and
+       gl_FUNC_CEILL_LIBS.
+       * modules/roundf (Files): Add m4/floorf.m4, m4/ceilf.m4.
+       * modules/round (Files): Add m4/floor.m4, m4/ceil.m4.
+       * modules/roundl (Files): Add m4/floorl.m4, m4/ceill.m4.
+
 2007-11-11  Bruno Haible  <bruno@clisp.org>
 
        * m4/roundf.m4 (gl_FUNC_ROUNDF): Handle the case that floorf and
index 4f197fb6759fdfee91bcd88e8c040a545debe933..44c05cab4fd2aaf2d0343192269fa36e9e7b6cd7 100644 (file)
@@ -16,6 +16,8 @@ AC_DEFUN([gl_FUNC_ROUND],
   if test "$ac_cv_have_decl_round" != yes || test "$ROUND_LIBM" = missing; then
     REPLACE_ROUND=1
     AC_LIBOBJ([round])
-    gl_CHECK_MATH_LIB([ROUND_LIBM], [x = floor (x) + ceil (x);])
+    gl_FUNC_FLOOR_LIBS
+    gl_FUNC_CEIL_LIBS
+    ROUND_LIBM="$FLOOR_LIBM $CEIL_LIBM"
   fi
   AC_SUBST([ROUND_LIBM])])
index 5878beb735b08f19e38d582a1e824f2b31cd2ec1..650311e3cc333c1b055361176d9d9a8fc462d161 100644 (file)
@@ -19,10 +19,12 @@ AC_DEFUN([gl_FUNC_ROUNDF],
     AC_CHECK_DECLS([ceilf, floorf], , , [#include <math.h>])
     if test "$ac_cv_have_decl_floorf" = yes \
        && test "$ac_cv_have_decl_ceilf" = yes; then
-      gl_CHECK_MATH_LIB([ROUNDF_LIBM], [x = floorf (x) + ceilf (x);])
-      if test "$ROUNDF_LIBM" != missing; then
+      gl_FUNC_FLOORF_LIBS
+      gl_FUNC_CEILF_LIBS
+      if test "$FLOORF_LIBM" != '?' && test "$CEILF_LIBM" != '?'; then
         AC_DEFINE([HAVE_FLOORF_AND_CEILF], 1,
           [Define if the both the floorf() and ceilf() functions exist.])
+        ROUNDF_LIBM="$FLOORF_LIBM $CEILF_LIBM"
       else
         ROUNDF_LIBM=
       fi
index a35943ca6233faf431634be9f3a5aae8b15ed7f9..de9f63a0f0d3cdfda54321f8a3d86b8886e074ea 100644 (file)
@@ -19,10 +19,12 @@ AC_DEFUN([gl_FUNC_ROUNDL],
     AC_CHECK_DECLS([ceill, floorl], , , [#include <math.h>])
     if test "$ac_cv_have_decl_floorl" = yes \
        && test "$ac_cv_have_decl_ceill" = yes; then
-      gl_CHECK_MATH_LIB([ROUNDL_LIBM], [x = floorl (x) + ceill (x);])
-      if test "$ROUNDL_LIBM" != missing; then
+      gl_FUNC_FLOORL_LIBS
+      gl_FUNC_CEILL_LIBS
+      if test "$FLOORL_LIBM" != '?' && test "$CEILL_LIBM" != '?'; then
         AC_DEFINE([HAVE_FLOORL_AND_CEILL], 1,
           [Define if the both the floorl() and ceill() functions exist.])
+        ROUNDL_LIBM="$FLOORL_LIBM $CEILL_LIBM"
       else
         ROUNDL_LIBM=
       fi
index 7d1110f16dfa5de349f445e44b47ec9c5f986de7..c4acba133f14fd8758cd8f7814c3fab4ac95e39e 100644 (file)
@@ -5,6 +5,8 @@ Files:
 lib/round.c
 m4/check-math-lib.m4
 m4/round.m4
+m4/floor.m4
+m4/ceil.m4
 
 Depends-on:
 float
index d3098f71dec3df87a38cfb4d081fe0b4c175310f..d77b2a198dcbaf6b971e947cf16caa8f585f4a82 100644 (file)
@@ -6,6 +6,8 @@ lib/round.c
 lib/roundf.c
 m4/check-math-lib.m4
 m4/roundf.m4
+m4/floorf.m4
+m4/ceilf.m4
 
 Depends-on:
 float
index 1edce04b8b0c205a7cad417dc9f7c34cdc240d71..9eb9f1de544b0657a1b1fd8c3b10aef282acfd8a 100644 (file)
@@ -6,6 +6,8 @@ lib/round.c
 lib/roundl.c
 m4/check-math-lib.m4
 m4/roundl.m4
+m4/floorl.m4
+m4/ceill.m4
 
 Depends-on:
 float