1 ## Copyright (C) 1996 Free Software Foundation, Inc.
3 ## This program is free software; you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation; either version 2, or (at your option)
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with this program; if not, write to the Free Software
15 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 ## @defmac AC_FUNC_STRTOD
23 ## @maindex FUNC_STRTOD
25 ## If the @code{strtod} function is not available, or does not work
26 ## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
27 ## variable @code{LIBOBJS}.
30 AC_DEFUN(AM_FUNC_STRTOD,
31 [AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
38 /* Some versions of Linux strtod mis-parse strings with leading '+'. */
39 char *string = " +69";
42 value = strtod (string, &term);
43 if (value != 69 || term != (string + 4))
48 /* Under Solaris 2.4, strtod returns the wrong value for the
49 terminating character under some conditions. */
52 strtod (string, &term);
53 if (term != string && *(term - 1) == 0)
58 ], am_cv_func_strtod=yes, am_cv_func_strtod=no, am_cv_func_strtod=no)])
59 test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
61 am_cv_func_strtod_needs_libm=no
62 if test $am_cv_func_strtod = no; then
64 if test $ac_cv_func_pow = no; then
65 AC_CHECK_LIB(m, pow, [am_cv_func_strtod_needs_libm=yes],
66 [AC_MSG_WARN(can't find library containing definition of pow)])