From fb70a0e69cd9e5d1c82193b06614fc568b5fb720 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 10 Oct 2009 08:16:44 +0000 Subject: [PATCH] 2009-10-10 Tatsuhiro Tsujikawa Added AC_FUNC_STRTOD and AC_TYPE_PID_T. Check function for pow, utime. Check header for utime.h. * configure.ac --- ChangeLog | 6 ++ Makefile.in | 1 + config.h.in | 9 +++ configure | 141 +++++++++++++++++++++++++++++++++++++++++++---- configure.ac | 7 ++- doc/Makefile.in | 1 + lib/Makefile.in | 1 + src/Makefile.in | 1 + test/Makefile.in | 1 + 9 files changed, 155 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3bc1ec27b..26bd7964d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-10 Tatsuhiro Tsujikawa + + Added AC_FUNC_STRTOD and AC_TYPE_PID_T. Check function for pow, + utime. Check header for utime.h. + * configure.ac + 2009-10-10 Tatsuhiro Tsujikawa Use AC_FUNC_FORK. Replaced HAVE_FORK with HAVE_WORKING_FORK. diff --git a/Makefile.in b/Makefile.in index 461bd96f0e..3a58c5d6b3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -248,6 +248,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ +POW_LIB = @POW_LIB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ diff --git a/config.h.in b/config.h.in index 8522dd47e6..bf065c2a8e 100644 --- a/config.h.in +++ b/config.h.in @@ -299,6 +299,9 @@ /* Define if your printf() function supports format strings with positions. */ #undef HAVE_POSIX_PRINTF +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + /* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ #undef HAVE_PTHREAD_MUTEX_RECURSIVE @@ -457,6 +460,12 @@ /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_UTIME_H + /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK diff --git a/configure b/configure index b9c9ebda48..7ded801e20 100755 --- a/configure +++ b/configure @@ -621,6 +621,7 @@ HAVE_POSIX_FALLOCATE_FALSE HAVE_POSIX_FALLOCATE_TRUE HAVE_EPOLL_FALSE HAVE_EPOLL_TRUE +POW_LIB LIBOBJS POSUB LTLIBINTL @@ -7680,6 +7681,7 @@ for ac_header in argz.h \ sys/time.h \ termios.h \ unistd.h \ + utime.h \ wchar.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -8140,6 +8142,17 @@ _ACEOF ;; esac +ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if test "${ac_cv_c_volatile+set}" = set; then : @@ -14054,17 +14067,6 @@ fi done -ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = x""yes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - for ac_header in vfork.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" @@ -14279,6 +14281,119 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if test "${ac_cv_func_strtod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +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)) + return 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) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_cxx_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + for ac_func in __argz_count \ __argz_next \ __argz_stringify \ @@ -14297,6 +14412,7 @@ for ac_func in __argz_count \ munmap \ nl_langinfo \ posix_memalign \ + pow \ putenv \ rmdir \ select \ @@ -14316,7 +14432,8 @@ for ac_func in __argz_count \ strtoull \ tzset \ unsetenv \ - usleep + usleep \ + utime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 74f1f93a86..4f7e20f06b 100644 --- a/configure.ac +++ b/configure.ac @@ -213,6 +213,7 @@ AC_CHECK_HEADERS([argz.h \ sys/time.h \ termios.h \ unistd.h \ + utime.h \ wchar.h]) # Checks for typedefs, structures, and compiler characteristics. @@ -233,6 +234,7 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T +AC_TYPE_PID_T AC_C_VOLATILE AC_CHECK_TYPES([ptrdiff_t]) AC_C_BIGENDIAN @@ -252,6 +254,7 @@ AC_FUNC_STAT AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_FUNC_FORK +AC_FUNC_STRTOD AC_CHECK_FUNCS([__argz_count \ __argz_next \ __argz_stringify \ @@ -270,6 +273,7 @@ AC_CHECK_FUNCS([__argz_count \ munmap \ nl_langinfo \ posix_memalign \ + pow \ putenv \ rmdir \ select \ @@ -289,7 +293,8 @@ AC_CHECK_FUNCS([__argz_count \ strtoull \ tzset \ unsetenv \ - usleep]) + usleep \ + utime]) if test "x$enable_epoll" = "xyes"; then AC_CHECK_FUNCS([epoll_create], [have_epoll=yes]) diff --git a/doc/Makefile.in b/doc/Makefile.in index 7316f1cb19..638bc4a21d 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -195,6 +195,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ +POW_LIB = @POW_LIB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ diff --git a/lib/Makefile.in b/lib/Makefile.in index d07f87b75d..d933a7d29d 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -166,6 +166,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ +POW_LIB = @POW_LIB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ diff --git a/src/Makefile.in b/src/Makefile.in index 463bd5f8e6..2c075f9ac4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -936,6 +936,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ +POW_LIB = @POW_LIB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ diff --git a/test/Makefile.in b/test/Makefile.in index 83766141d5..3fafc3ac38 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -499,6 +499,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ POSUB = @POSUB@ +POW_LIB = @POW_LIB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@