Factor out common code in gl_FUNC_STRTOD.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 14 Jun 2010 23:52:25 +0000 (16:52 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 15 Jun 2010 16:14:16 +0000 (09:14 -0700)
ChangeLog
m4/strtod.m4

index 5570b81..47fe5b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-14  Ben Pfaff  <blp@cs.stanford.edu>
+
+       * m4/strtod.m4 (gl_FUNC_STRTOD): Factor out common code.
+
 2010-06-15  Bruno Haible  <bruno@clisp.org>
 
        * m4/strtod.m4 (gl_FUNC_STRTOD): Stop using AC_FUNC_STRTOD.
index 00b8e64..36b5d2d 100644 (file)
@@ -15,9 +15,6 @@ AC_DEFUN([gl_FUNC_STRTOD],
   AC_CHECK_DECLS_ONCE([strtod])
   if test $ac_cv_have_decl_strtod != yes; then
     HAVE_STRTOD=0
-    gl_PREREQ_STRTOD
-    dnl Use undocumented macro to set POW_LIB correctly.
-    _AC_LIBOBJ_STRTOD
   else
     AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
@@ -101,11 +98,13 @@ numeric_equal (double x, double y)
         [gl_cv_func_strtod_works="guessing no"])])
     if test "$gl_cv_func_strtod_works" != yes; then
       REPLACE_STRTOD=1
-      gl_PREREQ_STRTOD
-      dnl Use undocumented macro to set POW_LIB correctly.
-      _AC_LIBOBJ_STRTOD
     fi
   fi
+  if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
+    gl_PREREQ_STRTOD
+    dnl Use undocumented macro to set POW_LIB correctly.
+    _AC_LIBOBJ_STRTOD
+  fi
 ])
 
 # Prerequisites of lib/strtod.c.