Index: configure ================================================================== --- configure +++ configure @@ -1944,11 +1944,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # The following RCS revision string applies to configure.in -# $Revision: 1.50 $ +# $Revision: 1.51 $ ######### # Programs needed # # Check whether --enable-shared was given. @@ -19530,10 +19530,112 @@ fi done + +######### +# Figure out whether or not we have these functions +# + + + + +for ac_func in usleep fdatasync localtime_r gmtime_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* 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 $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + ######### # Set up an appropriate program prefix # if test "$program_prefix" = "NONE"; then @@ -20651,188 +20753,10 @@ else LOADEXTENSION_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" fi -######### -# Figure out whether or not we have a "usleep()" function. -# -{ echo "$as_me:$LINENO: checking for usleep" >&5 -echo $ECHO_N "checking for usleep... $ECHO_C" >&6; } -if test "${ac_cv_func_usleep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define usleep to an innocuous variant, in case declares usleep. - For example, HP-UX 11i declares gettimeofday. */ -#define usleep innocuous_usleep - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char usleep (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef usleep - -/* 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 usleep (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_usleep || defined __stub___usleep -choke me -#endif - -int -main () -{ -return usleep (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_usleep=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_usleep=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_usleep" >&5 -echo "${ECHO_T}$ac_cv_func_usleep" >&6; } -if test $ac_cv_func_usleep = yes; then - CFLAGS="$CFLAGS -DHAVE_USLEEP=1" -fi - - -#-------------------------------------------------------------------- -# Redefine fdatasync as fsync on systems that lack fdatasync -#-------------------------------------------------------------------- - -{ echo "$as_me:$LINENO: checking for fdatasync" >&5 -echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } -if test "${ac_cv_func_fdatasync+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define fdatasync to an innocuous variant, in case declares fdatasync. - For example, HP-UX 11i declares gettimeofday. */ -#define fdatasync innocuous_fdatasync - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char fdatasync (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef fdatasync - -/* 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 fdatasync (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_fdatasync || defined __stub___fdatasync -choke me -#endif - -int -main () -{ -return fdatasync (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_fdatasync=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_fdatasync=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_fdatasync" >&5 -echo "${ECHO_T}$ac_cv_func_fdatasync" >&6; } -if test $ac_cv_func_fdatasync = yes; then - CFLAGS="$CFLAGS -DHAVE_FDATASYNC=1" -fi - ######### # Output the config header ac_config_headers="$ac_config_headers src/config.h" Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -90,11 +90,11 @@ AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.36 $ +# $Revision: 1.37 $ ######### # Programs needed # AC_PROG_LIBTOOL @@ -106,11 +106,17 @@ AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t, uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t]) ######### # Check for needed/wanted headers -AC_CHECK_HEADERS(sys/types.h stdlib.h stdint.h inttypes.h) +AC_CHECK_HEADERS([sys/types.h stdlib.h stdint.h inttypes.h]) + +######### +# Figure out whether or not we have these functions +# +AC_CHECK_FUNCS([usleep fdatasync localtime_r gmtime_r]) + ######### # Set up an appropriate program prefix # if test "$program_prefix" = "NONE"; then @@ -592,20 +598,10 @@ else LOADEXTENSION_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" fi AC_SUBST(LOADEXTENSION_FLAGS) -######### -# Figure out whether or not we have a "usleep()" function. -# -AC_CHECK_FUNC(usleep, [CFLAGS="$CFLAGS -DHAVE_USLEEP=1"]) - -#-------------------------------------------------------------------- -# Redefine fdatasync as fsync on systems that lack fdatasync -#-------------------------------------------------------------------- - -AC_CHECK_FUNC(fdatasync, [CFLAGS="$CFLAGS -DHAVE_FDATASYNC=1"]) ######### # Output the config header AC_CONFIG_HEADERS(src/config.h) Index: src/config.h.in ================================================================== --- src/config.h.in +++ src/config.h.in @@ -9,15 +9,20 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** Configuration header template to be filled in by 'configure' script ** -** @(#) $Id: config.h.in,v 1.2 2008/03/06 16:28:58 mlcreech Exp $ +** @(#) $Id: config.h.in,v 1.3 2008/03/09 01:38:10 mlcreech Exp $ */ #ifndef _CONFIG_H_ #define _CONFIG_H_ + +/***************************** +** Data types +*****************************/ + /* Define as 1 if you have the int8_t type */ #undef HAVE_INT8_T /* Define as 1 if you have the int16_t type */ #undef HAVE_INT16_T @@ -44,10 +49,15 @@ #undef HAVE_UINT64_T /* Define as 1 if you have the uintptr_t type */ #undef HAVE_UINTPTR_T + +/***************************** +** Header Files +*****************************/ + /* Define as 1 if you have the sys/types.h header */ #undef HAVE_SYS_TYPES_H /* Define as 1 if you have the stdlib.h header */ #undef HAVE_STDLIB_H @@ -56,6 +66,25 @@ #undef HAVE_STDINT_H /* Define as 1 if you have the inttypes.h header */ #undef HAVE_INTTYPES_H + +/***************************** +** Functions +*****************************/ + +/* Define as 1 if you have the usleep() function */ +#undef HAVE_USLEEP + +/* Define as 1 if you have the fdatasync() function */ +#undef HAVE_FDATASYNC + +/* Define as 1 if you have the gmtime_r() function */ +#undef HAVE_GMTIME_R + +/* Define as 1 if you have the localtime_r() function */ +#undef HAVE_LOCALTIME_R + + +/* End of header */ #endif