Tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
dnl From Jim Meyering.
AC_DEFUN(AM_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)])
test $ac_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
AC_SUBST(LIBOBJS)dnl
if test $ac_cv_func_strtod = no; then
AC_CHECK_FUNCS(pow)
if test $ac_cv_func_pow = no; then
AC_CHECK_LIB(m, pow)
fi
fi
])