AM_FUNC_STRTOD): New macros, from Automake.
* acfunctions: Adjust.
+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.
** 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
** 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.
------------------------------------------------------------------------------
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
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],
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
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],
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