]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acfunctions.m4 (_AC_LIBOBJ_STRTOD, AC_FUNC_STRTOD,
authorAkim Demaille <akim@epita.fr>
Tue, 1 Aug 2000 11:16:33 +0000 (11:16 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 1 Aug 2000 11:16:33 +0000 (11:16 +0000)
AM_FUNC_STRTOD): New macros, from Automake.
* acfunctions: Adjust.

ChangeLog
NEWS
TODO
acfunctions
acfunctions.m4
doc/autoconf.texi
lib/autoconf/functions.m4
lib/autoscan/functions

index cb7ee3a439a9ab525ef6d2dd8e902b2b58ff59dd..4b066061d82aabf4044a84123ed7a1ef9aa1ae28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-01  Akim Demaille  <akim@epita.fr>
+
+       * acfunctions.m4 (_AC_LIBOBJ_STRTOD, AC_FUNC_STRTOD,
+       AM_FUNC_STRTOD): New macros, from Automake.
+       * acfunctions: Adjust.
+
 2000-08-01  Akim Demaille  <akim@epita.fr>
 
        * acidentifiers: Catch ptrdiff_t.
diff --git a/NEWS b/NEWS
index 752fb2a6f213bdbcfeffb057e6b1e19531ff84c4..7cb81353f18dbd822c396d8eca3af4d557c2ec3f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -190,7 +190,7 @@ test cases in this new frame work.
 ** Specific Macros
 - AC_FUNC_CHOWN, AC_FUNC_MALLOC, AC_FUNC_STRERROR_R,
   AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, AC_FUNC_STAT, AC_FUNC_LSTAT,
-  AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK.
+  AC_FUNC_ERROR_AT_LINE, AC_FUNC_OBSTACK, AC_FUNC_STRTOD.
   New.
 
 - AC_FUNC_GETGROUPS
diff --git a/TODO b/TODO
index aed34c0a30b8c8fb9a4358f501a23574d926d99d..2af535ee1123d811e8d101749f48f084af7140b7 100644 (file)
--- a/TODO
+++ b/TODO
@@ -97,6 +97,8 @@ this.  Most should be removed.
 ** AC_EXEXT, AC_OBJEXT
 Support should be enabled by default.
 
+** Macros now swallowed by Autoconf.
+error.m4, obstack.m4, ptrdiff.m4, strtod.m4, termios.m4, winsz.m4.
 
 ------------------------------------------------------------------------------
 
index 795f1b42e6098481d45594763a725f08f3681394..d5d512527d52cfc3926f181cdf668623edb619aa 100644 (file)
@@ -33,6 +33,7 @@ stat          AC_FUNC_STAT
 strcoll                AC_FUNC_STRCOLL
 strerror_r     AC_FUNC_STRERROR_R
 strftime       AC_FUNC_STRFTIME
+strtod         AC_FUNC_STRTOD
 utime          AC_FUNC_UTIME_NULL
 vfork          AC_FUNC_VFORK
 vfprintf       AC_FUNC_VPRINTF
index fe8e776299a6bdbed5f7bee25c35eadc36fe148f..7b7b93299c2b9bec168c9fb055ece5736c5e5d1c 100644 (file)
@@ -1201,6 +1201,64 @@ AC_DEFUN([AC_FUNC_STAT],  [_AC_FUNC_STAT(stat)])
 AC_DEFUN([AC_FUNC_LSTAT], [_AC_FUNC_STAT(lstat)])
 
 
+# _AC_LIBOBJ_STRTOD
+# -----------------
+define([_AC_LIBOBJ_STRTOD],
+[AC_LIBOBJ(strtod)
+AC_CHECK_FUNC(pow)
+if test $ac_cv_func_pow = no; then
+  AC_CHECK_LIB(m, pow,
+               [POW_LIB=-lm],
+               [AC_MSG_WARN(can't find library containing definition of pow)])
+fi
+])# _AC_LIBOBJ_STRTOD
+
+
+# AC_FUNC_STRTOD
+# --------------
+AC_DEFUN([AC_FUNC_STRTOD],
+[AC_CACHE_CHECK(for working strtod, ac_cv_func_strtod,
+[AC_TRY_RUN([
+double strtod ();
+int
+main()
+{
+  {
+    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
+    char *string = " +69";
+    char *term;
+    double value;
+    value = strtod (string, &term);
+    if (value != 69 || term != (string + 4))
+      exit (1);
+  }
+
+  {
+    /* Under Solaris 2.4, strtod returns the wrong value for the
+       terminating character under some conditions.  */
+    char *string = "NaN";
+    char *term;
+    strtod (string, &term);
+    if (term != string && *(term - 1) == 0)
+      exit (1);
+  }
+  exit (0);
+}
+],
+            ac_cv_func_strtod=yes,
+            ac_cv_func_strtod=no,
+            ac_cv_func_strtod=no)])
+if test $ac_cv_func_strtod = no; then
+  _AC_LIBOBJ_STRTOD
+fi
+])
+
+
+# AU::AM_FUNC_STRTOD
+# -------------------
+AU_ALIAS([AM_FUNC_STRTOD], [AC_FUNC_STRTOD])
+
+
 # AC_FUNC_STRERROR_R
 # ------------------
 AC_DEFUN([AC_FUNC_STRERROR_R],
index b7b580c6e914f07cb98b6196986156de0d587194..ae8baf1dec4aadac6731ea0f2cf91c5c59446a00 100644 (file)
@@ -3140,6 +3140,15 @@ If the @code{strcoll} function exists and works correctly, define
 definitions of @code{strcoll}, which should not be used.
 @end defmac
 
+@defmac AC_FUNC_STRTOD
+@maindex FUNC_STRTOD
+@ovindex POW_LIB
+If the @code{strtod} function does not exist or doesn't work correctly,
+ask for an @code{AC_LIBOBJ} replacement of @samp{strtod}.  In this case,
+because @file{strtod.c} is likely to need @samp{pow}, set the output
+variable @code{POW_LIB} to the extra library needed.
+@end defmac
+
 @defmac AC_FUNC_STRERROR_R
 @maindex FUNC_STRERROR_R
 @cvindex HAVE_STRERROR_R
index fe8e776299a6bdbed5f7bee25c35eadc36fe148f..7b7b93299c2b9bec168c9fb055ece5736c5e5d1c 100644 (file)
@@ -1201,6 +1201,64 @@ AC_DEFUN([AC_FUNC_STAT],  [_AC_FUNC_STAT(stat)])
 AC_DEFUN([AC_FUNC_LSTAT], [_AC_FUNC_STAT(lstat)])
 
 
+# _AC_LIBOBJ_STRTOD
+# -----------------
+define([_AC_LIBOBJ_STRTOD],
+[AC_LIBOBJ(strtod)
+AC_CHECK_FUNC(pow)
+if test $ac_cv_func_pow = no; then
+  AC_CHECK_LIB(m, pow,
+               [POW_LIB=-lm],
+               [AC_MSG_WARN(can't find library containing definition of pow)])
+fi
+])# _AC_LIBOBJ_STRTOD
+
+
+# AC_FUNC_STRTOD
+# --------------
+AC_DEFUN([AC_FUNC_STRTOD],
+[AC_CACHE_CHECK(for working strtod, ac_cv_func_strtod,
+[AC_TRY_RUN([
+double strtod ();
+int
+main()
+{
+  {
+    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
+    char *string = " +69";
+    char *term;
+    double value;
+    value = strtod (string, &term);
+    if (value != 69 || term != (string + 4))
+      exit (1);
+  }
+
+  {
+    /* Under Solaris 2.4, strtod returns the wrong value for the
+       terminating character under some conditions.  */
+    char *string = "NaN";
+    char *term;
+    strtod (string, &term);
+    if (term != string && *(term - 1) == 0)
+      exit (1);
+  }
+  exit (0);
+}
+],
+            ac_cv_func_strtod=yes,
+            ac_cv_func_strtod=no,
+            ac_cv_func_strtod=no)])
+if test $ac_cv_func_strtod = no; then
+  _AC_LIBOBJ_STRTOD
+fi
+])
+
+
+# AU::AM_FUNC_STRTOD
+# -------------------
+AU_ALIAS([AM_FUNC_STRTOD], [AC_FUNC_STRTOD])
+
+
 # AC_FUNC_STRERROR_R
 # ------------------
 AC_DEFUN([AC_FUNC_STRERROR_R],
index 795f1b42e6098481d45594763a725f08f3681394..d5d512527d52cfc3926f181cdf668623edb619aa 100644 (file)
@@ -33,6 +33,7 @@ stat          AC_FUNC_STAT
 strcoll                AC_FUNC_STRCOLL
 strerror_r     AC_FUNC_STRERROR_R
 strftime       AC_FUNC_STRFTIME
+strtod         AC_FUNC_STRTOD
 utime          AC_FUNC_UTIME_NULL
 vfork          AC_FUNC_VFORK
 vfprintf       AC_FUNC_VPRINTF