From: Tom Lane Date: Sat, 16 Jan 2010 19:50:38 +0000 (+0000) Subject: Re-order configure tests to reflect the fact that the code generated for X-Git-Tag: REL8_4_3~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=903352faeb1c86321be52430bdf3b44bd5aa6447;p=postgresql Re-order configure tests to reflect the fact that the code generated for posix_fadvise and other file-related functions can depend on _LARGEFILE_SOURCE and/or _FILE_OFFSET_BITS. Per report from Robert Treat. Back-patch to 8.4. This has been wrong all along, but we weren't really using posix_fadvise in anger before, and AC_FUNC_FSEEKO seems to mask the issue well enough for that function. --- diff --git a/configure b/configure index 9d7afbb022..87266b9940 100755 --- a/configure +++ b/configure @@ -746,8 +746,8 @@ python_libspec python_additional_libs ZIC OSSP_UUID_LIBS -HAVE_IPV6 LIBOBJS +HAVE_IPV6 acx_pthread_config PTHREAD_CC PTHREAD_LIBS @@ -1378,9 +1378,9 @@ Optional Features: --enable-thread-safety make client libraries thread-safe --enable-thread-safety-force force thread-safety despite thread test failure + --disable-largefile omit support for large files --disable-float4-byval disable float4 passed by value --disable-float8-byval disable float8 passed by value - --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -16066,44 +16066,59 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi +# Check largefile support. You might think this is a system service not a +# compiler characteristic, but you'd be wrong. We must check this before +# probing existence of related functions such as fseeko, since the largefile +# defines can affect what is generated for that. +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi -## -## Functions, global variables -## +if test "$enable_largefile" != no; then -{ echo "$as_me:$LINENO: checking for int timezone" >&5 -echo $ECHO_N "checking for int timezone... $ECHO_C" >&6; } -if test "${pgac_cv_var_int_timezone+set}" = set; then + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -int res; +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -#ifndef __CYGWIN__ -res = timezone / 60; -#else -res = _timezone / 60; -#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -16112,59 +16127,76 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 - pgac_cv_var_int_timezone=yes + } && test -s conftest.$ac_objext; then + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_var_int_timezone=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: $pgac_cv_var_int_timezone" >&5 -echo "${ECHO_T}$pgac_cv_var_int_timezone" >&6; } -if test x"$pgac_cv_var_int_timezone" = xyes ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_INT_TIMEZONE -_ACEOF +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +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_compile") 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_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -{ echo "$as_me:$LINENO: checking types of arguments for accept()" >&5 -echo $ECHO_N "checking types of arguments for accept()... $ECHO_C" >&6; } - if test "${ac_cv_func_accept_return+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "${ac_cv_func_accept_arg1+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "${ac_cv_func_accept_arg2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "${ac_cv_func_accept_arg3+set}" = set; then + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do - for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do - for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do - for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do - cat >conftest.$ac_ext <<_ACEOF + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef HAVE_SYS_TYPES_H #include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *); + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { @@ -16190,76 +16222,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_not_found=no; break 4 + ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_not_found=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - done - done - done - if test "$ac_not_found" = yes; then - { { echo "$as_me:$LINENO: error: could not determine argument types" >&5 -echo "$as_me: error: could not determine argument types" >&2;} - { (exit 1); exit 1; }; } - fi - if test "$ac_cv_func_accept_arg3" = "void"; then - ac_cv_func_accept_arg3=int - fi - -fi - -fi - -fi fi - { echo "$as_me:$LINENO: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5 -echo "${ECHO_T}$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; } - -cat >>confdefs.h <<_ACEOF -#define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3 -_ACEOF - -{ echo "$as_me:$LINENO: checking whether gettimeofday takes only one argument" >&5 -echo $ECHO_N "checking whether gettimeofday takes only one argument... $ECHO_C" >&6; } -if test "${pgac_cv_func_gettimeofday_1arg+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -struct timeval *tp; -struct timezone *tzp; -gettimeofday(tp,tzp); + ; return 0; } @@ -16281,110 +16272,68 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - pgac_cv_func_gettimeofday_1arg=no + ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_func_gettimeofday_1arg=yes + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done fi -{ echo "$as_me:$LINENO: result: $pgac_cv_func_gettimeofday_1arg" >&5 -echo "${ECHO_T}$pgac_cv_func_gettimeofday_1arg" >&6; } -if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then - -cat >>confdefs.h <<\_ACEOF -#define GETTIMEOFDAY_1ARG +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ -fi - - - - - - - - - - - - - - - - - - - - - - - - -for ac_func in cbrt dlopen fcvt fdatasync getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs -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" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -16393,97 +16342,48 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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" + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break 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 - -# posix_fadvise() is a no-op on Solaris, so don't incur function overhead -# by calling it, 2009-04-02 -# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c -if test "$PORTNAME" != "solaris"; then - -for ac_func in posix_fadvise -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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 - +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; int main () { -return $ac_func (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -16492,33 +16392,39 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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" + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break 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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done 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 +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - +;; +esac +rm -f conftest* + fi fi -done -{ echo "$as_me:$LINENO: checking whether posix_fadvise is declared" >&5 -echo $ECHO_N "checking whether posix_fadvise is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_posix_fadvise+set}" = set; then + +# Check for largefile support (must be after AC_SYS_LARGEFILE) +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -16527,15 +16433,15 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +$ac_includes_default +typedef off_t ac__type_new_; int main () { -#ifndef posix_fadvise - (void) posix_fadvise; -#endif - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -16557,55 +16463,43 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_posix_fadvise=yes + ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_posix_fadvise=no + ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_posix_fadvise" >&5 -echo "${ECHO_T}$ac_cv_have_decl_posix_fadvise" >&6; } -if test $ac_cv_have_decl_posix_fadvise = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_POSIX_FADVISE 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_POSIX_FADVISE 0 -_ACEOF - - -fi - - -fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -{ echo "$as_me:$LINENO: checking whether fdatasync is declared" >&5 -echo $ECHO_N "checking whether fdatasync is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_fdatasync+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of off_t" >&5 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +$ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -#ifndef fdatasync - (void) fdatasync; -#endif +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +test_array [0] = 0 ; return 0; @@ -16628,52 +16522,21 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_fdatasync=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_fdatasync=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fdatasync" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fdatasync" >&6; } -if test $ac_cv_have_decl_fdatasync = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FDATASYNC 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FDATASYNC 0 -_ACEOF - - -fi - - -{ echo "$as_me:$LINENO: checking whether strlcat is declared" >&5 -echo $ECHO_N "checking whether strlcat is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_strlcat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -#ifndef strlcat - (void) strlcat; -#endif +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 ; return 0; @@ -16696,50 +16559,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strlcat=yes + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_strlcat=no + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcat" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strlcat" >&6; } -if test $ac_cv_have_decl_strlcat = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRLCAT 1 -_ACEOF - - + done else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRLCAT 0 -_ACEOF - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi -{ echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5 -echo $ECHO_N "checking whether strlcpy is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_strlcpy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -#ifndef strlcpy - (void) strlcpy; -#endif +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +test_array [0] = 0 ; return 0; @@ -16762,54 +16613,21 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_strlcpy=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strlcpy=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcpy" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strlcpy" >&6; } -if test $ac_cv_have_decl_strlcpy = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRLCPY 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRLCPY 0 -_ACEOF - - -fi - - -# This is probably only present on Darwin, but may as well check always -{ echo "$as_me:$LINENO: checking whether F_FULLFSYNC is declared" >&5 -echo $ECHO_N "checking whether F_FULLFSYNC is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_F_FULLFSYNC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +$ac_includes_default + typedef off_t ac__type_sizeof_; int main () { -#ifndef F_FULLFSYNC - (void) F_FULLFSYNC; -#endif +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +test_array [0] = 0 ; return 0; @@ -16832,41 +16650,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_F_FULLFSYNC=yes + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_F_FULLFSYNC=no + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_F_FULLFSYNC" >&5 -echo "${ECHO_T}$ac_cv_have_decl_F_FULLFSYNC" >&6; } -if test $ac_cv_have_decl_F_FULLFSYNC = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_F_FULLFSYNC 1 -_ACEOF - - + done else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_F_FULLFSYNC 0 -_ACEOF - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi - -HAVE_IPV6=no -{ echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 -echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6; } -if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16874,16 +16686,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include - -typedef struct sockaddr_in6 ac__type_new_; + typedef off_t ac__type_sizeof_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -16905,33 +16714,28 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_struct_sockaddr_in6=yes + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_struct_sockaddr_in6=no + ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 -echo "${ECHO_T}$ac_cv_type_struct_sockaddr_in6" >&6; } -if test $ac_cv_type_struct_sockaddr_in6 = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_IPV6 1 -_ACEOF - - HAVE_IPV6=yes -fi - - - -{ echo "$as_me:$LINENO: checking for PS_STRINGS" >&5 -echo $ECHO_N "checking for PS_STRINGS... $ECHO_C" >&6; } -if test "${pgac_cv_var_PS_STRINGS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +done +case $ac_lo in +?*) ac_cv_sizeof_off_t=$ac_lo;; +'') if test "$ac_cv_type_off_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_off_t=0 + fi ;; +esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16939,99 +16743,106 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include - +$ac_includes_default + typedef off_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +#include +#include int main () { -PS_STRINGS->ps_nargvstr = 1; -PS_STRINGS->ps_argvstr = "foo"; + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext +rm -f 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 + (eval "$ac_link") 2>&5 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 - pgac_cv_var_PS_STRINGS=yes + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_off_t=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_var_PS_STRINGS=no +( exit $ac_status ) +if test "$ac_cv_type_off_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (off_t) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_off_t=0 + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $pgac_cv_var_PS_STRINGS" >&5 -echo "${ECHO_T}$pgac_cv_var_PS_STRINGS" >&6; } -if test "$pgac_cv_var_PS_STRINGS" = yes ; then +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } -cat >>confdefs.h <<\_ACEOF -#define HAVE_PS_STRINGS + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -fi -# We use our snprintf.c emulation if either snprintf() or vsnprintf() -# is missing. Yes, there are machines that have only one. We may -# also decide to use snprintf.c if snprintf() is present but does not -# have all the features we need --- see below. +# If we don't have largefile support, can't handle segsize >= 2GB. +if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then + { { echo "$as_me:$LINENO: error: Large file support is not enabled. Segment size cannot be larger than 1GB." >&5 +echo "$as_me: error: Large file support is not enabled. Segment size cannot be larger than 1GB." >&2;} + { (exit 1); exit 1; }; } +fi -if test "$PORTNAME" = "win32"; then - # Win32 gets snprintf.c built unconditionally. - # - # To properly translate all NLS languages strings, we must support the - # *printf() %$ format, which allows *printf() arguments to be selected - # by position in the translated string. - # - # libintl versions < 0.13 use the native *printf() functions, and Win32 - # *printf() doesn't understand %$, so we must use our /port versions, - # which do understand %$. libintl versions >= 0.13 include their own - # *printf versions on Win32. The libintl 0.13 release note text is: - # - # C format strings with positions, as they arise when a translator - # needs to reorder a sentence, are now supported on all platforms. - # On those few platforms (NetBSD and Woe32) for which the native - # printf()/fprintf()/... functions don't support such format - # strings, replacements are provided through . - # - # We could use libintl >= 0.13's *printf() if we were sure that we had - # a litint >= 0.13 at runtime, but seeing that there is no clean way - # to guarantee that, it is best to just use our own, so we are sure to - # get %$ support. In include/port.h we disable the *printf() macros - # that might have been defined by libintl. - # - # We do this unconditionally whether NLS is used or not so we are sure - # that all Win32 libraries and binaries behave the same. - pgac_need_repl_snprintf=yes -else - pgac_need_repl_snprintf=no -for ac_func in snprintf -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 +## +## Functions, global variables +## + +{ echo "$as_me:$LINENO: checking for int timezone" >&5 +echo $ECHO_N "checking for int timezone... $ECHO_C" >&6; } +if test "${pgac_cv_var_int_timezone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -17040,41 +16851,16 @@ _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 - +#include +int res; int main () { -return $ac_func (); +#ifndef __CYGWIN__ +res = timezone / 60; +#else +res = _timezone / 60; +#endif ; return 0; } @@ -17097,92 +16883,73 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + pgac_cv_var_int_timezone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + pgac_cv_var_int_timezone=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 +{ echo "$as_me:$LINENO: result: $pgac_cv_var_int_timezone" >&5 +echo "${ECHO_T}$pgac_cv_var_int_timezone" >&6; } +if test x"$pgac_cv_var_int_timezone" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INT_TIMEZONE _ACEOF -else - pgac_need_repl_snprintf=yes fi -done - - -for ac_func in vsnprintf -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 "$as_me:$LINENO: checking types of arguments for accept()" >&5 +echo $ECHO_N "checking types of arguments for accept()... $ECHO_C" >&6; } + if test "${ac_cv_func_accept_return+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "${ac_cv_func_accept_arg1+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "${ac_cv_func_accept_arg2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "${ac_cv_func_accept_arg3+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do + for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do + for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do + for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do + 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" +#ifdef HAVE_SYS_TYPES_H +#include #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 +#ifdef HAVE_SYS_SOCKET_H +#include #endif - +extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *); int main () { -return $ac_func (); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -17191,109 +16958,62 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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" + } && test -s conftest.$ac_objext; then + ac_not_found=no; break 4 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_not_found=yes fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done + done + done + if test "$ac_not_found" = yes; then + { { echo "$as_me:$LINENO: error: could not determine argument types" >&5 +echo "$as_me: error: could not determine argument types" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$ac_cv_func_accept_arg3" = "void"; then + ac_cv_func_accept_arg3=int + fi + 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 -else - pgac_need_repl_snprintf=yes fi -done fi +fi + { echo "$as_me:$LINENO: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5 +echo "${ECHO_T}$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6; } -# Check whether declares snprintf() and vsnprintf(); if not, -# include/c.h will provide declarations. Note this is a separate test -# from whether the functions exist in the C library --- there are -# systems that have the functions but don't bother to declare them :-( - -{ echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 -echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_snprintf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef snprintf - (void) snprintf; -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -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_compile") 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_objext; then - ac_cv_have_decl_snprintf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_snprintf=no -fi +cat >>confdefs.h <<_ACEOF +#define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1 +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6; } -if test $ac_cv_have_decl_snprintf = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF 1 +#define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2 _ACEOF -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SNPRINTF 0 +cat >>confdefs.h <<_ACEOF +#define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3 _ACEOF -fi -{ echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 -echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_vsnprintf+set}" = set; then +{ echo "$as_me:$LINENO: checking whether gettimeofday takes only one argument" >&5 +echo $ECHO_N "checking whether gettimeofday takes only one argument... $ECHO_C" >&6; } +if test "${pgac_cv_func_gettimeofday_1arg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -17302,14 +17022,13 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default +#include int main () { -#ifndef vsnprintf - (void) vsnprintf; -#endif - +struct timeval *tp; +struct timezone *tzp; +gettimeofday(tp,tzp); ; return 0; } @@ -17331,110 +17050,50 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_vsnprintf=yes + pgac_cv_func_gettimeofday_1arg=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_vsnprintf=no + pgac_cv_func_gettimeofday_1arg=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6; } -if test $ac_cv_have_decl_vsnprintf = yes; then +{ echo "$as_me:$LINENO: result: $pgac_cv_func_gettimeofday_1arg" >&5 +echo "${ECHO_T}$pgac_cv_func_gettimeofday_1arg" >&6; } +if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VSNPRINTF 1 +cat >>confdefs.h <<\_ACEOF +#define GETTIMEOFDAY_1ARG _ACEOF +fi -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VSNPRINTF 0 -_ACEOF -fi -{ echo "$as_me:$LINENO: checking for isinf" >&5 -echo $ECHO_N "checking for isinf... $ECHO_C" >&6; } -if test "${ac_cv_func_isinf+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. */ -#include -double glob_double; -int -main () -{ -return isinf(glob_double) ? 0 : 1; - ; - 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_isinf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_isinf=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_isinf" >&5 -echo "${ECHO_T}$ac_cv_func_isinf" >&6; } -if test $ac_cv_func_isinf = yes ; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF 1 -_ACEOF -else - case " $LIBOBJS " in - *" isinf.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS isinf.$ac_objext" - ;; -esac - # Look for a way to implement a substitute for isinf() -for ac_func in fpclass fp_class fp_class_d class + + + + + +for ac_func in cbrt dlopen fcvt fdatasync getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -17523,31 +17182,13 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - break -fi -done fi - -# Some versions of libedit contain strlcpy(); so disregard that library while -# checking for these standard libc functions. -pgac_save_LIBS="$LIBS" -LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'` - - - - - - - - - - - +done -for ac_func in crypt getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul +for ac_func in fseeko do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -17648,68 +17289,36 @@ fi done - case $host_os in - - # Windows uses a specialised env handler - mingw*) + # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos + # Mingw uses macros to access Win32 API calls + bsdi*|netbsd*|mingw*) cat >>confdefs.h <<\_ACEOF -#define HAVE_UNSETENV 1 +#define HAVE_FSEEKO 1 _ACEOF - ac_cv_func_unsetenv=yes;; - *) - -for ac_func in unsetenv -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 + ac_cv_func_fseeko=yes;; + *) + { echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + while :; do 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 - +#include /* for off_t */ + #include int main () { -return $ac_func (); +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } @@ -17732,98 +17341,30 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + ac_cv_sys_largefile_source=no; break 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 - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - -fi -done - - - ;; -esac - - -LIBS="$pgac_save_LIBS" - -# System's version of getaddrinfo(), if any, may be used only if we found -# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h. -# (Note: the AC_REPLACE_FUNCS probe fails on Windows, where the available -# versions of getaddrinfo don't follow normal C call protocol. This is OK -# because we want to use our own getaddrinfo.c on Windows anyway.) -if test x"$ac_cv_type_struct_addrinfo" = xyes ; then - -for ac_func in getaddrinfo -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 - +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include int main () { -return $ac_func (); +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } @@ -17846,49 +17387,51 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + ac_cv_sys_largefile_source=1; break 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 + ac_cv_sys_largefile_source=unknown + break +done 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 +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; +;; esac +rm -f conftest* -fi -done - +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then -else - case " $LIBOBJS " in - *" getaddrinfo.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" - ;; -esac +cat >>confdefs.h <<\_ACEOF +#define HAVE_FSEEKO 1 +_ACEOF fi +;; +esac -# Similarly, use system's getopt_long() only if system provides struct option. -if test x"$ac_cv_type_struct_option" = xyes ; then +# posix_fadvise() is a no-op on Solaris, so don't incur function overhead +# by calling it, 2009-04-02 +# http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c +if test "$PORTNAME" != "solaris"; then -for ac_func in getopt_long +for ac_func in posix_fadvise do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -17978,46 +17521,12 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - fi done - -else - case " $LIBOBJS " in - *" getopt_long.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" - ;; -esac - -fi - -# Solaris' getopt() doesn't do what we want for long options, so always use -# our version on that platform. -if test "$PORTNAME" = "solaris"; then - case " $LIBOBJS " in - *" getopt.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getopt.$ac_objext" - ;; -esac - -fi - -# Win32 support -if test "$PORTNAME" = "win32"; then - -for ac_func in gettimeofday -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 "$as_me:$LINENO: checking whether posix_fadvise is declared" >&5 +echo $ECHO_N "checking whether posix_fadvise is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_posix_fadvise+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -18026,53 +17535,27 @@ _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 +#include int main () { -return $ac_func (); +#ifndef posix_fadvise + (void) posix_fadvise; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18081,107 +17564,69 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_posix_fadvise=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_have_decl_posix_fadvise=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_posix_fadvise" >&5 +echo "${ECHO_T}$ac_cv_have_decl_posix_fadvise" >&6; } +if test $ac_cv_have_decl_posix_fadvise = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_POSIX_FADVISE 1 _ACEOF + else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_POSIX_FADVISE 0 +_ACEOF + fi -done -case " $LIBOBJS " in - *" kill.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS kill.$ac_objext" - ;; -esac - -case " $LIBOBJS " in - *" open.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS open.$ac_objext" - ;; -esac - -case " $LIBOBJS " in - *" rand.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS rand.$ac_objext" - ;; -esac - -case " $LIBOBJS " in - *" win32env.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS win32env.$ac_objext" - ;; -esac - -case " $LIBOBJS " in - *" win32error.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS win32error.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYMLINK 1 -_ACEOF - fi -if test "$with_readline" = yes; then - { echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5 -echo $ECHO_N "checking for rl_completion_append_character... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF +{ echo "$as_me:$LINENO: checking whether fdatasync is declared" >&5 +echo $ECHO_N "checking whether fdatasync is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_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. */ -#include -#ifdef HAVE_READLINE_READLINE_H -# include -#elif defined(HAVE_READLINE_H) -# include -#endif +#include int main () { -rl_completion_append_character = 'x'; +#ifndef fdatasync + (void) fdatasync; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18190,33 +17635,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 -_ACEOF - + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_fdatasync=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + ac_cv_have_decl_fdatasync=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fdatasync" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fdatasync" >&6; } +if test $ac_cv_have_decl_fdatasync = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FDATASYNC 1 +_ACEOF -for ac_func in rl_completion_matches rl_filename_completion_function -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 + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FDATASYNC 0 +_ACEOF + + +fi + + +{ echo "$as_me:$LINENO: checking whether strlcat is declared" >&5 +echo $ECHO_N "checking whether strlcat is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strlcat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -18225,53 +17675,26 @@ _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 - +$ac_includes_default int main () { -return $ac_func (); +#ifndef strlcat + (void) strlcat; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18280,37 +17703,36 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_strlcat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_have_decl_strlcat=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcat" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strlcat" >&6; } +if test $ac_cv_have_decl_strlcat = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRLCAT 1 _ACEOF -fi -done + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRLCAT 0 +_ACEOF -for ac_func in replace_history_entry -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 +fi +{ echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5 +echo $ECHO_N "checking whether strlcpy is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strlcpy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -18319,53 +17741,26 @@ _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 - +$ac_includes_default int main () { -return $ac_func (); +#ifndef strlcpy + (void) strlcpy; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18374,58 +17769,68 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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" + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_strlcpy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_have_decl_strlcpy=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext 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 +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcpy" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strlcpy" >&6; } +if test $ac_cv_have_decl_strlcpy = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRLCPY 1 _ACEOF -fi -done -fi +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRLCPY 0 +_ACEOF -{ echo "$as_me:$LINENO: checking for sigsetjmp" >&5 -echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF +fi + + +# This is probably only present on Darwin, but may as well check always +{ echo "$as_me:$LINENO: checking whether F_FULLFSYNC is declared" >&5 +echo $ECHO_N "checking whether F_FULLFSYNC is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_F_FULLFSYNC+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. */ -#include +#include + int main () { -sigjmp_buf x; sigsetjmp(x, 1); +#ifndef F_FULLFSYNC + (void) F_FULLFSYNC; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18434,29 +17839,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_F_FULLFSYNC=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<\_ACEOF -#define HAVE_SIGSETJMP 1 + ac_cv_have_decl_F_FULLFSYNC=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_F_FULLFSYNC" >&5 +echo "${ECHO_T}$ac_cv_have_decl_F_FULLFSYNC" >&6; } +if test $ac_cv_have_decl_F_FULLFSYNC = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_F_FULLFSYNC 1 _ACEOF -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_F_FULLFSYNC 0 +_ACEOF + - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 -echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_sys_siglist+set}" = set; then + +HAVE_IPV6=no +{ echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 +echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -18465,20 +17881,17 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -/* NetBSD declares sys_siglist in unistd.h. */ -#ifdef HAVE_UNISTD_H -# include -#endif - +$ac_includes_default +#include +typedef struct sockaddr_in6 ac__type_new_; int main () { -#ifndef sys_siglist - (void) sys_siglist; -#endif - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -18500,39 +17913,133 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_have_decl_sys_siglist=yes + ac_cv_type_struct_sockaddr_in6=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_have_decl_sys_siglist=no + ac_cv_type_struct_sockaddr_in6=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 -echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6; } -if test $ac_cv_have_decl_sys_siglist = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 +echo "${ECHO_T}$ac_cv_type_struct_sockaddr_in6" >&6; } +if test $ac_cv_type_struct_sockaddr_in6 = yes; then -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_IPV6 1 _ACEOF + HAVE_IPV6=yes +fi + + +{ echo "$as_me:$LINENO: checking for PS_STRINGS" >&5 +echo $ECHO_N "checking for PS_STRINGS... $ECHO_C" >&6; } +if test "${pgac_cv_var_PS_STRINGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_SIGLIST 0 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +PS_STRINGS->ps_nargvstr = 1; +PS_STRINGS->ps_argvstr = "foo"; + ; + 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 + pgac_cv_var_PS_STRINGS=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + pgac_cv_var_PS_STRINGS=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: $pgac_cv_var_PS_STRINGS" >&5 +echo "${ECHO_T}$pgac_cv_var_PS_STRINGS" >&6; } +if test "$pgac_cv_var_PS_STRINGS" = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PS_STRINGS +_ACEOF +fi +# We use our snprintf.c emulation if either snprintf() or vsnprintf() +# is missing. Yes, there are machines that have only one. We may +# also decide to use snprintf.c if snprintf() is present but does not +# have all the features we need --- see below. -{ echo "$as_me:$LINENO: checking for syslog" >&5 -echo $ECHO_N "checking for syslog... $ECHO_C" >&6; } -if test "${ac_cv_func_syslog+set}" = set; then +if test "$PORTNAME" = "win32"; then + # Win32 gets snprintf.c built unconditionally. + # + # To properly translate all NLS languages strings, we must support the + # *printf() %$ format, which allows *printf() arguments to be selected + # by position in the translated string. + # + # libintl versions < 0.13 use the native *printf() functions, and Win32 + # *printf() doesn't understand %$, so we must use our /port versions, + # which do understand %$. libintl versions >= 0.13 include their own + # *printf versions on Win32. The libintl 0.13 release note text is: + # + # C format strings with positions, as they arise when a translator + # needs to reorder a sentence, are now supported on all platforms. + # On those few platforms (NetBSD and Woe32) for which the native + # printf()/fprintf()/... functions don't support such format + # strings, replacements are provided through . + # + # We could use libintl >= 0.13's *printf() if we were sure that we had + # a litint >= 0.13 at runtime, but seeing that there is no clean way + # to guarantee that, it is best to just use our own, so we are sure to + # get %$ support. In include/port.h we disable the *printf() macros + # that might have been defined by libintl. + # + # We do this unconditionally whether NLS is used or not so we are sure + # that all Win32 libraries and binaries behave the same. + pgac_need_repl_snprintf=yes +else + pgac_need_repl_snprintf=no + +for ac_func in snprintf +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 @@ -18541,12 +18048,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define syslog to an innocuous variant, in case declares syslog. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ -#define syslog innocuous_syslog +#define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char syslog (); below. + which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -18556,7 +18063,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include #endif -#undef syslog +#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -18564,18 +18071,18 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char syslog (); +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_syslog || defined __stub___syslog +#if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { -return syslog (); +return $ac_func (); ; return 0; } @@ -18598,49 +18105,92 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_syslog=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_syslog=no + 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 -{ echo "$as_me:$LINENO: result: $ac_cv_func_syslog" >&5 -echo "${ECHO_T}$ac_cv_func_syslog" >&6; } -if test $ac_cv_func_syslog = yes; then - if test "${ac_cv_header_syslog_h+set}" = set; then - { echo "$as_me:$LINENO: checking for syslog.h" >&5 -echo $ECHO_N "checking for syslog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_syslog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +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 + +else + pgac_need_repl_snprintf=yes fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_syslog_h" >&5 -echo "${ECHO_T}$ac_cv_header_syslog_h" >&6; } +done + + +for ac_func in vsnprintf +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 - # Is the header compilable? -{ echo "$as_me:$LINENO: checking syslog.h usability" >&5 -echo $ECHO_N "checking syslog.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include +/* 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 -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18649,114 +18199,109 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + } && 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 - ac_header_compiler=no + eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +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 -# Is the header present? -{ echo "$as_me:$LINENO: checking syslog.h presence" >&5 -echo $ECHO_N "checking syslog.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF +else + pgac_need_repl_snprintf=yes +fi +done + +fi + + +# Check whether declares snprintf() and vsnprintf(); if not, +# include/c.h will provide declarations. Note this is a separate test +# from whether the functions exist in the C library --- there are +# systems that have the functions but don't bother to declare them :-( + +{ echo "$as_me:$LINENO: checking whether snprintf is declared" >&5 +echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_snprintf+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. */ -#include +$ac_includes_default +int +main () +{ +#ifndef snprintf + (void) snprintf; +#endif + + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 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); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_snprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: syslog.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: syslog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: syslog.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: syslog.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: syslog.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: syslog.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: syslog.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: syslog.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: syslog.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: syslog.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: syslog.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: syslog.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: syslog.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: syslog.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: syslog.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: syslog.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ---------------------------------------- ## -## Report this to pgsql-bugs@postgresql.org ## -## ---------------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for syslog.h" >&5 -echo $ECHO_N "checking for syslog.h... $ECHO_C" >&6; } -if test "${ac_cv_header_syslog_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_syslog_h=$ac_header_preproc + ac_cv_have_decl_snprintf=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_syslog_h" >&5 -echo "${ECHO_T}$ac_cv_header_syslog_h" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -if test $ac_cv_header_syslog_h = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6; } +if test $ac_cv_have_decl_snprintf = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYSLOG 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 1 _ACEOF -fi - -fi +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SNPRINTF 0 +_ACEOF -{ echo "$as_me:$LINENO: checking for opterr" >&5 -echo $ECHO_N "checking for opterr... $ECHO_C" >&6; } -if test "${pgac_cv_var_int_opterr+set}" = set; then +fi +{ echo "$as_me:$LINENO: checking whether vsnprintf is declared" >&5 +echo $ECHO_N "checking whether vsnprintf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_vsnprintf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -18765,23 +18310,26 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +$ac_includes_default int main () { -extern int opterr; opterr = 1; +#ifndef vsnprintf + (void) vsnprintf; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -18790,32 +18338,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 - pgac_cv_var_int_opterr=yes + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_vsnprintf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_var_int_opterr=no + ac_cv_have_decl_vsnprintf=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $pgac_cv_var_int_opterr" >&5 -echo "${ECHO_T}$pgac_cv_var_int_opterr" >&6; } -if test x"$pgac_cv_var_int_opterr" = x"yes"; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_vsnprintf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_vsnprintf" >&6; } +if test $ac_cv_have_decl_vsnprintf = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_INT_OPTERR 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VSNPRINTF 0 _ACEOF + fi -{ echo "$as_me:$LINENO: checking for optreset" >&5 -echo $ECHO_N "checking for optreset... $ECHO_C" >&6; } -if test "${pgac_cv_var_int_optreset+set}" = set; then + + + +{ echo "$as_me:$LINENO: checking for isinf" >&5 +echo $ECHO_N "checking for isinf... $ECHO_C" >&6; } +if test "${ac_cv_func_isinf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -18824,11 +18380,14 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include + +#include +double glob_double; + int main () { -extern int optreset; optreset = 1; +return isinf(glob_double) ? 0 : 1; ; return 0; } @@ -18851,30 +18410,39 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - pgac_cv_var_int_optreset=yes + ac_cv_func_isinf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_var_int_optreset=no + ac_cv_func_isinf=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: $pgac_cv_var_int_optreset" >&5 -echo "${ECHO_T}$pgac_cv_var_int_optreset" >&6; } -if test x"$pgac_cv_var_int_optreset" = x"yes"; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_isinf" >&5 +echo "${ECHO_T}$ac_cv_func_isinf" >&6; } + +if test $ac_cv_func_isinf = yes ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_INT_OPTRESET 1 +#define HAVE_ISINF 1 _ACEOF -fi +else + case " $LIBOBJS " in + *" isinf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS isinf.$ac_objext" + ;; +esac + + # Look for a way to implement a substitute for isinf() -for ac_func in strtoll strtoq + +for ac_func in fpclass fp_class fp_class_d class do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -18967,9 +18535,27 @@ _ACEOF fi done +fi + +# Some versions of libedit contain strlcpy(); so disregard that library while +# checking for these standard libc functions. +pgac_save_LIBS="$LIBS" +LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'` + -for ac_func in strtoull strtouq + + + + + + + + + + + +for ac_func in crypt getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -19058,14 +18644,32 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - break + +else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac + fi done -# Check for one of atexit() or on_exit() -for ac_func in atexit +case $host_os in + + # Windows uses a specialised env handler + mingw*) + +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSETENV 1 +_ACEOF + + ac_cv_func_unsetenv=yes;; + *) + +for ac_func in unsetenv do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -19156,8 +18760,30 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac -for ac_func in on_exit +fi +done + + + ;; +esac + + +LIBS="$pgac_save_LIBS" + +# System's version of getaddrinfo(), if any, may be used only if we found +# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h. +# (Note: the AC_REPLACE_FUNCS probe fails on Windows, where the available +# versions of getaddrinfo don't follow normal C call protocol. This is OK +# because we want to use our own getaddrinfo.c on Windows anyway.) +if test x"$ac_cv_type_struct_addrinfo" = xyes ; then + +for ac_func in getaddrinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -19248,18 +18874,29 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then _ACEOF else - { { echo "$as_me:$LINENO: error: neither atexit() nor on_exit() found" >&5 -echo "$as_me: error: neither atexit() nor on_exit() found" >&2;} - { (exit 1); exit 1; }; } -fi -done + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac fi done +else + case " $LIBOBJS " in + *" getaddrinfo.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" + ;; +esac + +fi + +# Similarly, use system's getopt_long() only if system provides struct option. +if test x"$ac_cv_type_struct_option" = xyes ; then -for ac_func in fseeko +for ac_func in getopt_long do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -19360,82 +18997,78 @@ fi done -case $host_os in - # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos - # Mingw uses macros to access Win32 API calls - bsdi*|netbsd*|mingw*) +else + case " $LIBOBJS " in + *" getopt_long.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" + ;; +esac -cat >>confdefs.h <<\_ACEOF -#define HAVE_FSEEKO 1 -_ACEOF +fi - ac_cv_func_fseeko=yes;; - *) - { echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_largefile_source+set}" = set; then +# Solaris' getopt() doesn't do what we want for long options, so always use +# our version on that platform. +if test "$PORTNAME" = "solaris"; then + case " $LIBOBJS " in + *" getopt.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt.$ac_objext" + ;; +esac + +fi + +# Win32 support +if test "$PORTNAME" = "win32"; then + +for ac_func in gettimeofday +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 - while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - 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_sys_largefile_source=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +/* 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. */ -fi +#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 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 -#include /* for off_t */ - #include int main () { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); +return $ac_func (); ; return 0; } @@ -19458,97 +19091,93 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_sys_largefile_source=1; break + 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 - ac_cv_sys_largefile_source=unknown - break -done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } -case $ac_cv_sys_largefile_source in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +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 -;; + +else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; esac -rm -f conftest* -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -if test $ac_cv_sys_largefile_source != unknown; then +fi +done -cat >>confdefs.h <<\_ACEOF -#define HAVE_FSEEKO 1 -_ACEOF -fi -;; +case " $LIBOBJS " in + *" kill.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS kill.$ac_objext" + ;; esac +case " $LIBOBJS " in + *" open.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS open.$ac_objext" + ;; +esac -# -# Pthreads -# -# For each platform, we need to know about any special compile and link -# libraries, and whether the normal C function names are thread-safe. -# See the comment at the top of src/port/thread.c for more information. -# WIN32 doesn't need the pthread tests; it always uses threads -if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then +case " $LIBOBJS " in + *" rand.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS rand.$ac_objext" + ;; +esac +case " $LIBOBJS " in + *" win32env.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS win32env.$ac_objext" + ;; +esac +case " $LIBOBJS " in + *" win32error.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS win32error.$ac_objext" + ;; +esac -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -acx_pthread_ok=no +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYMLINK 1 +_ACEOF -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. +fi -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 -echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF +if test "$with_readline" = yes; then + { echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5 +echo $ECHO_N "checking for rl_completion_append_character... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* 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" +#include +#ifdef HAVE_READLINE_READLINE_H +# include +#elif defined(HAVE_READLINE_H) +# include #endif -char pthread_join (); + int main () { -return pthread_join (); +rl_completion_append_character = 'x'; ; return 0; } @@ -19571,169 +19200,168 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - acx_pthread_ok=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 +_ACEOF + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 -echo "${ECHO_T}$acx_pthread_ok" >&6; } - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config pthreadGC2" +for ac_func in rl_completion_matches rl_filename_completion_function +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 -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: +/* 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. */ -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) +#ifdef __STDC__ +# include +#else +# include +#endif -case "${host_cpu}-${host_os}" in - *solaris*) +#undef $ac_func - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthread or - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: +/* 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 - acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" - ;; +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 - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - tryPTHREAD_CFLAGS="" - tryPTHREAD_LIBS="" - case $flag in - none) - { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 -echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; } - ;; - - -*) - { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 -echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; } - tryPTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - # skip this if we already have flags defined, for PostgreSQL - if test x"$PTHREAD_CFLAGS" != x -o x"$PTHREAD_LIBS" != x; then continue; fi - # Extract the first word of "pthread-config", so it can be a program name with args. -set dummy pthread-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_acx_pthread_config+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$acx_pthread_config"; then - ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. +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 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_acx_pthread_config="yes" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" -fi -fi -acx_pthread_config=$ac_cv_prog_acx_pthread_config -if test -n "$acx_pthread_config"; then - { echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 -echo "${ECHO_T}$acx_pthread_config" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + 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 - if test x"$acx_pthread_config" = xno; then continue; fi - tryPTHREAD_CFLAGS="`pthread-config --cflags`" - tryPTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 -echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; } - tryPTHREAD_LIBS="-l$flag" - ;; - esac +fi +done - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$tryPTHREAD_LIBS $PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS $tryPTHREAD_CFLAGS" - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - cat >conftest.$ac_ext <<_ACEOF +for ac_func in replace_history_entry +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. */ -#include +/* 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 () { -pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); +return $ac_func (); ; return 0; } @@ -19756,70 +19384,44 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - acx_pthread_ok=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - acx_pthread_ok=no + eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - - if test "x$acx_pthread_ok" = xyes; then - # Don't use options that are ignored by the compiler. - # We find them by checking stderror. - cat >conftest.$ac_ext <<_ACEOF -int -main (int argc, char **argv) -{ - (void) argc; - (void) argv; - return 0; -} +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 - rm -f conftest.$ac_objext conftest$ac_exeext - if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then - # we continue with more flags because Linux needs -lpthread - # for libpq builds on PostgreSQL. The test above only - # tests for building binaries, not shared libraries. - PTHREAD_LIBS=" $tryPTHREAD_LIBS $PTHREAD_LIBS" - PTHREAD_CFLAGS="$PTHREAD_CFLAGS $tryPTHREAD_CFLAGS" - else acx_pthread_ok=no - fi - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 -echo "${ECHO_T}$acx_pthread_ok" >&6; } +fi done + fi -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - # Detect AIX lossage: threads are created detached by default - # and the JOINABLE attribute has a nonstandard name (UNDETACHED). - { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 -echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF +{ echo "$as_me:$LINENO: checking for sigsetjmp" >&5 +echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -int attr=PTHREAD_CREATE_JOINABLE; +sigjmp_buf x; sigsetjmp(x, 1); ; return 0; } @@ -19842,40 +19444,61 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ok=PTHREAD_CREATE_JOINABLE + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SIGSETJMP 1 +_ACEOF + +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ok=unknown + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext - if test x"$ok" = xunknown; then - cat >conftest.$ac_ext <<_ACEOF + +{ echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 +echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_sys_siglist+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. */ -#include +#include +/* NetBSD declares sys_siglist in unistd.h. */ +#ifdef HAVE_UNISTD_H +# include +#endif + + int main () { -int attr=PTHREAD_CREATE_UNDETACHED; +#ifndef sys_siglist + (void) sys_siglist; +#endif + ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -19884,167 +19507,131 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 - ok=PTHREAD_CREATE_UNDETACHED + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_sys_siglist=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ok=unknown + ac_cv_have_decl_sys_siglist=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5 +echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6; } +if test $ac_cv_have_decl_sys_siglist = yes; then -cat >>confdefs.h <<\_ACEOF -#define PTHREAD_CREATE_JOINABLE $ok +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SYS_SIGLIST 1 _ACEOF - fi - { echo "$as_me:$LINENO: result: ${ok}" >&5 -echo "${ECHO_T}${ok}" >&6; } - if test x"$ok" = xunknown; then - { echo "$as_me:$LINENO: WARNING: we do not know how to create joinable pthreads" >&5 -echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;} - fi - - { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 -echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; } - flag=no -# We always add these in PostgreSQL -# case "${host_cpu}-${host_os}" in -# *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; -# *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; -# esac - { echo "$as_me:$LINENO: result: ${flag}" >&5 -echo "${ECHO_T}${flag}" >&6; } - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - -# Supporting cc_r would require a special CC in all places that -# use libpq, and that is ugly, so we don't do it. Users can still -# define their compiler as cc_r to do thread builds of everything. - # More AIX lossage: must compile with cc_r - # Extract the first word of "cc_r", so it can be a program name with args. -set dummy cc_r; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$PTHREAD_CC"; then - ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_PTHREAD_CC="cc_r" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}" -fi -fi -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC -if test -n "$PTHREAD_CC"; then - { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5 -echo "${ECHO_T}$PTHREAD_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SYS_SIGLIST 0 +_ACEOF -else - PTHREAD_CC="$CC" fi - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD 1 +{ echo "$as_me:$LINENO: checking for syslog" >&5 +echo $ECHO_N "checking for syslog... $ECHO_C" >&6; } +if test "${ac_cv_func_syslog+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 syslog to an innocuous variant, in case declares syslog. + For example, HP-UX 11i declares gettimeofday. */ +#define syslog innocuous_syslog - : -else - acx_pthread_ok=no +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char syslog (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#ifdef __STDC__ +# include +#else +# include +#endif - # set thread flags +#undef syslog -# Some platforms use these, so just define them. They can't hurt if they -# are not supported. For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS -# enables 5-arg getpwuid_r, among other things. -PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS" +/* 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 syslog (); +/* 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_syslog || defined __stub___syslog +choke me +#endif +int +main () +{ +return syslog (); + ; + 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_syslog=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# At this point, we don't want to muck with the compiler name for threading. -# Let's see who fails, perhaps AIX. 2004-04-23 -if test "$PTHREAD_CC" != "$CC"; then -{ { echo "$as_me:$LINENO: error: -PostgreSQL does not support platforms that require a special compiler -for thread safety." >&5 -echo "$as_me: error: -PostgreSQL does not support platforms that require a special compiler -for thread safety." >&2;} - { (exit 1); exit 1; }; } + ac_cv_func_syslog=no fi -if test "$THREAD_SUPPORT" = no; then -{ { echo "$as_me:$LINENO: error: cannot enable threads on this platform -This platform is known to not support thread-safe programs. For details, -compile and run src/bin/pg_thread_test." >&5 -echo "$as_me: error: cannot enable threads on this platform -This platform is known to not support thread-safe programs. For details, -compile and run src/bin/pg_thread_test." >&2;} - { (exit 1); exit 1; }; } +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi - -# Check for *_r functions -_CFLAGS="$CFLAGS" -_LIBS="$LIBS" -CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -LIBS="$LIBS $PTHREAD_LIBS" - -if test "$PORTNAME" != "win32"; then -if test "${ac_cv_header_pthread_h+set}" = set; then - { echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } -if test "${ac_cv_header_pthread_h+set}" = set; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_syslog" >&5 +echo "${ECHO_T}$ac_cv_func_syslog" >&6; } +if test $ac_cv_func_syslog = yes; then + if test "${ac_cv_header_syslog_h+set}" = set; then + { echo "$as_me:$LINENO: checking for syslog.h" >&5 +echo $ECHO_N "checking for syslog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_syslog_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_syslog_h" >&5 +echo "${ECHO_T}$ac_cv_header_syslog_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 -echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking syslog.h usability" >&5 +echo $ECHO_N "checking syslog.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20052,7 +19639,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -20084,15 +19671,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 -echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking syslog.h presence" >&5 +echo $ECHO_N "checking syslog.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in @@ -20125,25 +19712,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: syslog.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: syslog.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: syslog.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: syslog.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: syslog.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: syslog.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: syslog.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: syslog.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: syslog.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to pgsql-bugs@postgresql.org ## @@ -20152,37 +19739,32 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } -if test "${ac_cv_header_pthread_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for syslog.h" >&5 +echo $ECHO_N "checking for syslog.h... $ECHO_C" >&6; } +if test "${ac_cv_header_syslog_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_pthread_h=$ac_header_preproc + ac_cv_header_syslog_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_syslog_h" >&5 +echo "${ECHO_T}$ac_cv_header_syslog_h" >&6; } fi -if test $ac_cv_header_pthread_h = yes; then - : -else - { { echo "$as_me:$LINENO: error: pthread.h not found, required for --enable-thread-safety" >&5 -echo "$as_me: error: pthread.h not found, required for --enable-thread-safety" >&2;} - { (exit 1); exit 1; }; } -fi +if test $ac_cv_header_syslog_h = yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYSLOG 1 +_ACEOF fi +fi -for ac_func in strerror_r getpwuid_r gethostbyname_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 "$as_me:$LINENO: checking for opterr" >&5 +echo $ECHO_N "checking for opterr... $ECHO_C" >&6; } +if test "${pgac_cv_var_int_opterr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -20191,41 +19773,70 @@ _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 +#include +int +main () +{ +extern int opterr; opterr = 1; + ; + 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 + pgac_cv_var_int_opterr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -/* 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. */ + pgac_cv_var_int_opterr=no +fi -#ifdef __STDC__ -# include -#else -# include -#endif +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $pgac_cv_var_int_opterr" >&5 +echo "${ECHO_T}$pgac_cv_var_int_opterr" >&6; } +if test x"$pgac_cv_var_int_opterr" = x"yes"; then -#undef $ac_func +cat >>confdefs.h <<\_ACEOF +#define HAVE_INT_OPTERR 1 +_ACEOF -/* 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 +fi +{ echo "$as_me:$LINENO: checking for optreset" >&5 +echo $ECHO_N "checking for optreset... $ECHO_C" >&6; } +if test "${pgac_cv_var_int_optreset+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. */ +#include int main () { -return $ac_func (); +extern int optreset; optreset = 1; ; return 0; } @@ -20248,33 +19859,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + pgac_cv_var_int_optreset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + pgac_cv_var_int_optreset=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 +{ echo "$as_me:$LINENO: result: $pgac_cv_var_int_optreset" >&5 +echo "${ECHO_T}$pgac_cv_var_int_optreset" >&6; } +if test x"$pgac_cv_var_int_optreset" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_INT_OPTRESET 1 _ACEOF fi -done -# Do test here with the proper thread flags -{ echo "$as_me:$LINENO: checking whether getpwuid_r takes a fifth argument" >&5 -echo $ECHO_N "checking whether getpwuid_r takes a fifth argument... $ECHO_C" >&6; } -if test "${pgac_cv_func_getpwuid_r_5arg+set}" = set; then + +for ac_func in strtoll strtoq +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 @@ -20283,29 +19896,53 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +/* 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 () { -uid_t uid; -struct passwd *space; -char *buf; -size_t bufsize; -struct passwd **result; -getpwuid_r(uid, space, buf, bufsize, result); +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -20314,30 +19951,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - pgac_cv_func_getpwuid_r_5arg=yes + } && 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 - pgac_cv_func_getpwuid_r_5arg=no + eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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 + break fi -{ echo "$as_me:$LINENO: result: $pgac_cv_func_getpwuid_r_5arg" >&5 -echo "${ECHO_T}$pgac_cv_func_getpwuid_r_5arg" >&6; } -if test x"$pgac_cv_func_getpwuid_r_5arg" = xyes ; then +done -cat >>confdefs.h <<\_ACEOF -#define GETPWUID_R_5ARG -_ACEOF -fi -{ echo "$as_me:$LINENO: checking whether strerror_r returns int" >&5 -echo $ECHO_N "checking whether strerror_r returns int... $ECHO_C" >&6; } -if test "${pgac_cv_func_strerror_r_int+set}" = set; then +for ac_func in strtoull strtouq +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 @@ -20346,28 +19991,53 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +/* 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 () { -#ifndef _AIX -int strerror_r(int, char *, size_t); -#else -/* Older AIX has 'int' for the third argument so we don't test the args. */ -int strerror_r(); -#endif +return $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -20376,59 +20046,63 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - pgac_cv_func_strerror_r_int=yes + } && 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 - pgac_cv_func_strerror_r_int=no + eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $pgac_cv_func_strerror_r_int" >&5 -echo "${ECHO_T}$pgac_cv_func_strerror_r_int" >&6; } -if test x"$pgac_cv_func_strerror_r_int" = xyes ; then - -cat >>confdefs.h <<\_ACEOF -#define STRERROR_R_INT +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 - - -CFLAGS="$_CFLAGS" -LIBS="$_LIBS" - -else -# do not use values from template file -PTHREAD_CFLAGS= -PTHREAD_LIBS= + break fi +done +# Check for one of atexit() or on_exit() - - -# We can test for libldap_r only after we know PTHREAD_LIBS -if test "$with_ldap" = yes ; then - _LIBS="$LIBS" - if test "$PORTNAME" != "win32"; then - -{ echo "$as_me:$LINENO: checking for ldap_bind in -lldap" >&5 -echo $ECHO_N "checking for ldap_bind in -lldap... $ECHO_C" >&6; } -if test "${ac_cv_lib_ldap_ldap_bind+set}" = set; then +for ac_func in atexit +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF + 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 @@ -20436,11 +20110,18 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char ldap_bind (); +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 ldap_bind (); +return $ac_func (); ; return 0; } @@ -20463,50 +20144,57 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_ldap_ldap_bind=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ldap_ldap_bind=no + eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_bind" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_ldap_bind" >&6; } -if test $ac_cv_lib_ldap_ldap_bind = yes; then +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 HAVE_LIBLDAP 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - LIBS="-lldap $LIBS" - else - { { echo "$as_me:$LINENO: error: library 'ldap' is required for LDAP" >&5 -echo "$as_me: error: library 'ldap' is required for LDAP" >&2;} - { (exit 1); exit 1; }; } -fi - - LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS" - if test "$enable_thread_safety" = yes; then - # on some platforms ldap_r fails to link without PTHREAD_LIBS -{ echo "$as_me:$LINENO: checking for ldap_simple_bind in -lldap_r" >&5 -echo $ECHO_N "checking for ldap_simple_bind in -lldap_r... $ECHO_C" >&6; } -if test "${ac_cv_lib_ldap_r_ldap_simple_bind+set}" = set; then +for ac_func in on_exit +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF + 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 @@ -20514,11 +20202,18 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char ldap_simple_bind (); +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 ldap_simple_bind (); +return $ac_func (); ; return 0; } @@ -20541,47 +20236,71 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_ldap_r_ldap_simple_bind=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ldap_r_ldap_simple_bind=no + eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; } -if test $ac_cv_lib_ldap_r_ldap_simple_bind = yes; then +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 HAVE_LIBLDAP_R 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF - LIBS="-lldap_r $LIBS" - else - { { echo "$as_me:$LINENO: error: library 'ldap_r' is required for LDAP" >&5 -echo "$as_me: error: library 'ldap_r' is required for LDAP" >&2;} + { { echo "$as_me:$LINENO: error: neither atexit() nor on_exit() found" >&5 +echo "$as_me: error: neither atexit() nor on_exit() found" >&2;} { (exit 1); exit 1; }; } fi +done + +fi +done + + + +# +# Pthreads +# +# For each platform, we need to know about any special compile and link +# libraries, and whether the normal C function names are thread-safe. +# See the comment at the top of src/port/thread.c for more information. +# WIN32 doesn't need the pthread tests; it always uses threads +if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS" - else - LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS" - fi - else +acx_pthread_ok=no -{ echo "$as_me:$LINENO: checking for ldap_bind in -lwldap32" >&5 -echo $ECHO_N "checking for ldap_bind in -lwldap32... $ECHO_C" >&6; } -if test "${ac_cv_lib_wldap32_ldap_bind+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lwldap32 $LIBS" -cat >conftest.$ac_ext <<_ACEOF +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20594,11 +20313,11 @@ cat >>conftest.$ac_ext <<_ACEOF #ifdef __cplusplus extern "C" #endif -char ldap_bind (); +char pthread_join (); int main () { -return ldap_bind (); +return pthread_join (); ; return 0; } @@ -20621,219 +20340,267 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_wldap32_ldap_bind=yes + acx_pthread_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_wldap32_ldap_bind=no + fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 +echo "${ECHO_T}$acx_pthread_ok" >&6; } + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_wldap32_ldap_bind" >&5 -echo "${ECHO_T}$ac_cv_lib_wldap32_ldap_bind" >&6; } -if test $ac_cv_lib_wldap32_ldap_bind = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBWLDAP32 1 -_ACEOF - LIBS="-lwldap32 $LIBS" +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). -else - { { echo "$as_me:$LINENO: error: library 'wldap32' is required for LDAP" >&5 -echo "$as_me: error: library 'wldap32' is required for LDAP" >&2;} - { (exit 1); exit 1; }; } -fi +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. - LDAP_LIBS_FE="-lwldap32" - LDAP_LIBS_BE="-lwldap32" - fi - LIBS="$_LIBS" -fi +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config pthreadGC2" +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) +case "${host_cpu}-${host_os}" in + *solaris*) -# This test makes sure that run tests work at all. Sometimes a shared -# library is found by the linker, but the runtime linker can't find it. -# This check should come after all modifications of compiler or linker -# variables, and before any other run tests. -{ echo "$as_me:$LINENO: checking test program" >&5 -echo $ECHO_N "checking test program... $ECHO_C" >&6; } -if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: cross-compiling" >&5 -echo "${ECHO_T}cross-compiling" >&6; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -rm -f 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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthread or + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" + ;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + tryPTHREAD_CFLAGS="" + tryPTHREAD_LIBS="" + case $flag in + none) + { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 +echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; } + ;; + + -*) + { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 +echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; } + tryPTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # skip this if we already have flags defined, for PostgreSQL + if test x"$PTHREAD_CFLAGS" != x -o x"$PTHREAD_LIBS" != x; then continue; fi + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_acx_pthread_config+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test -n "$acx_pthread_config"; then + ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_acx_pthread_config="yes" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -( exit $ac_status ) -{ echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } -{ { echo "$as_me:$LINENO: error: -Could not execute a simple test program. This may be a problem -related to locating shared libraries. Check the file 'config.log' -for the exact reason." >&5 -echo "$as_me: error: -Could not execute a simple test program. This may be a problem -related to locating shared libraries. Check the file 'config.log' -for the exact reason." >&2;} - { (exit 1); exit 1; }; } + test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +acx_pthread_config=$ac_cv_prog_acx_pthread_config +if test -n "$acx_pthread_config"; then + { echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 +echo "${ECHO_T}$acx_pthread_config" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + if test x"$acx_pthread_config" = xno; then continue; fi + tryPTHREAD_CFLAGS="`pthread-config --cflags`" + tryPTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; -# -------------------- -# Run tests below here -# -------------------- + *) + { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 +echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; } + tryPTHREAD_LIBS="-l$flag" + ;; + esac -# Force use of our snprintf if system's doesn't do arg control -# See comment above at snprintf test for details. -if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then - { echo "$as_me:$LINENO: checking whether printf supports argument control" >&5 -echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6; } -if test "${pgac_cv_printf_arg_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - pgac_cv_printf_arg_control=cross -else - cat >conftest.$ac_ext <<_ACEOF + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$tryPTHREAD_LIBS $PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS $tryPTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int main() +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () { - char buf[100]; - - /* can it swap arguments? */ - snprintf(buf, 100, "%2\$d %1\$d", 3, 4); - if (strcmp(buf, "4 3") != 0) - return 1; +pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); + ; return 0; } _ACEOF -rm -f conftest$ac_exeext +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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (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_try") 2>&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); }; }; then - pgac_cv_printf_arg_control=yes + (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 + acx_pthread_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -pgac_cv_printf_arg_control=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + acx_pthread_ok=no fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + if test "x$acx_pthread_ok" = xyes; then + # Don't use options that are ignored by the compiler. + # We find them by checking stderror. + cat >conftest.$ac_ext <<_ACEOF +int +main (int argc, char **argv) +{ + (void) argc; + (void) argv; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then + # we continue with more flags because Linux needs -lpthread + # for libpq builds on PostgreSQL. The test above only + # tests for building binaries, not shared libraries. + PTHREAD_LIBS=" $tryPTHREAD_LIBS $PTHREAD_LIBS" + PTHREAD_CFLAGS="$PTHREAD_CFLAGS $tryPTHREAD_CFLAGS" + else acx_pthread_ok=no + fi + fi -fi -{ echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5 -echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6; } + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" - if test $pgac_cv_printf_arg_control != yes ; then - pgac_need_repl_snprintf=yes - fi + { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 +echo "${ECHO_T}$acx_pthread_ok" >&6; } +done fi +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - -{ echo "$as_me:$LINENO: checking whether long int is 64 bits" >&5 -echo $ECHO_N "checking whether long int is 64 bits... $ECHO_C" >&6; } -if test "${pgac_cv_type_long_int_64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - # If cross-compiling, check the size reported by the compiler and -# trust that the arithmetic works. -cat >conftest.$ac_ext <<_ACEOF + # Detect AIX lossage: threads are created detached by default + # and the JOINABLE attribute has a nonstandard name (UNDETACHED). + { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 +echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +#include int main () { -static int test_array [1 - 2 * !(sizeof(long int) == 8)]; -test_array [0] = 0 - +int attr=PTHREAD_CREATE_JOINABLE; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -20842,122 +20609,219 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - pgac_cv_type_long_int_64=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ok=PTHREAD_CREATE_JOINABLE else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_type_long_int_64=no + ok=unknown fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + if test x"$ok" = xunknown; then + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -typedef long int ac_int64; - -/* - * These are globals to discourage the compiler from folding all the - * arithmetic tests down to compile-time constants. - */ -ac_int64 a = 20000001; -ac_int64 b = 40000005; - -int does_int64_work() +#include +int +main () { - ac_int64 c,d; - - if (sizeof(ac_int64) != 8) - return 0; /* definitely not the right size */ - - /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ - c = a * b; - d = (c + b) / b; - if (d != a+1) - return 0; - return 1; -} -main() { - exit(! does_int64_work()); +int attr=PTHREAD_CREATE_UNDETACHED; + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext +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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (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_try") 2>&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); }; }; then - pgac_cv_type_long_int_64=yes + (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 + ok=PTHREAD_CREATE_UNDETACHED else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -pgac_cv_type_long_int_64=no + ok=unknown +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + fi + if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<\_ACEOF +#define PTHREAD_CREATE_JOINABLE $ok +_ACEOF + + fi + { echo "$as_me:$LINENO: result: ${ok}" >&5 +echo "${ECHO_T}${ok}" >&6; } + if test x"$ok" = xunknown; then + { echo "$as_me:$LINENO: WARNING: we do not know how to create joinable pthreads" >&5 +echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;} + fi + + { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 +echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; } + flag=no +# We always add these in PostgreSQL +# case "${host_cpu}-${host_os}" in +# *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; +# *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; +# esac + { echo "$as_me:$LINENO: result: ${flag}" >&5 +echo "${ECHO_T}${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + +# Supporting cc_r would require a special CC in all places that +# use libpq, and that is ugly, so we don't do it. Users can still +# define their compiler as cc_r to do thread builds of everything. + # More AIX lossage: must compile with cc_r + # Extract the first word of "cc_r", so it can be a program name with args. +set dummy cc_r; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PTHREAD_CC="cc_r" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5 +echo "${ECHO_T}$PTHREAD_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi +else + PTHREAD_CC="$CC" fi -{ echo "$as_me:$LINENO: result: $pgac_cv_type_long_int_64" >&5 -echo "${ECHO_T}$pgac_cv_type_long_int_64" >&6; } -HAVE_LONG_INT_64=$pgac_cv_type_long_int_64 -if test x"$pgac_cv_type_long_int_64" = xyes ; then + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_INT_64 1 +#define HAVE_PTHREAD 1 _ACEOF + : +else + acx_pthread_ok=no + fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + # set thread flags -if test x"$HAVE_LONG_INT_64" = x"no" ; then - { echo "$as_me:$LINENO: checking whether long long int is 64 bits" >&5 -echo $ECHO_N "checking whether long long int is 64 bits... $ECHO_C" >&6; } -if test "${pgac_cv_type_long_long_int_64+set}" = set; then +# Some platforms use these, so just define them. They can't hurt if they +# are not supported. For example, on Solaris -D_POSIX_PTHREAD_SEMANTICS +# enables 5-arg getpwuid_r, among other things. +PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS" + + +# At this point, we don't want to muck with the compiler name for threading. +# Let's see who fails, perhaps AIX. 2004-04-23 +if test "$PTHREAD_CC" != "$CC"; then +{ { echo "$as_me:$LINENO: error: +PostgreSQL does not support platforms that require a special compiler +for thread safety." >&5 +echo "$as_me: error: +PostgreSQL does not support platforms that require a special compiler +for thread safety." >&2;} + { (exit 1); exit 1; }; } +fi + +if test "$THREAD_SUPPORT" = no; then +{ { echo "$as_me:$LINENO: error: cannot enable threads on this platform +This platform is known to not support thread-safe programs. For details, +compile and run src/bin/pg_thread_test." >&5 +echo "$as_me: error: cannot enable threads on this platform +This platform is known to not support thread-safe programs. For details, +compile and run src/bin/pg_thread_test." >&2;} + { (exit 1); exit 1; }; } +fi + +# Check for *_r functions +_CFLAGS="$CFLAGS" +_LIBS="$LIBS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +LIBS="$LIBS $PTHREAD_LIBS" + +if test "$PORTNAME" != "win32"; then +if test "${ac_cv_header_pthread_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else - if test "$cross_compiling" = yes; then - # If cross-compiling, check the size reported by the compiler and -# trust that the arithmetic works. + # Is the header compilable? +{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -int -main () -{ -static int test_array [1 - 2 * !(sizeof(long long int) == 8)]; -test_array [0] = 0 - - ; - return 0; -} +$ac_includes_default +#include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -20976,171 +20840,119 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - pgac_cv_type_long_long_int_64=yes + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_type_long_long_int_64=no + ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -typedef long long int ac_int64; - -/* - * These are globals to discourage the compiler from folding all the - * arithmetic tests down to compile-time constants. - */ -ac_int64 a = 20000001; -ac_int64 b = 40000005; - -int does_int64_work() -{ - ac_int64 c,d; - - if (sizeof(ac_int64) != 8) - return 0; /* definitely not the right size */ - - /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ - c = a * b; - d = (c + b) / b; - if (d != a+1) - return 0; - return 1; -} -main() { - exit(! does_int64_work()); -} -_ACEOF -rm -f 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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (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_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - pgac_cv_type_long_long_int_64=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -pgac_cv_type_long_long_int_64=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $pgac_cv_type_long_long_int_64" >&5 -echo "${ECHO_T}$pgac_cv_type_long_long_int_64" >&6; } - -HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64 -if test x"$pgac_cv_type_long_long_int_64" = xyes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LONG_LONG_INT_64 1 -_ACEOF - -fi - - if test x"$HAVE_LONG_LONG_INT_64" = x"no" ; then - { { echo "$as_me:$LINENO: error: Cannot find a working 64-bit integer type." >&5 -echo "$as_me: error: Cannot find a working 64-bit integer type." >&2;} - { (exit 1); exit 1; }; } - fi -fi - - +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } -if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then - cat >conftest.$ac_ext <<_ACEOF +# Is the header present? +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#define INT64CONST(x) x##LL -long long int foo = INT64CONST(0x1234567890123456); - -int -main () -{ - - ; - return 0; -} +#include _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +if { (ac_try="$ac_cpp conftest.$ac_ext" 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_compile") 2>conftest.er1 + (eval "$ac_cpp conftest.$ac_ext") 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" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<\_ACEOF -#define HAVE_LL_CONSTANTS 1 -_ACEOF + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ---------------------------------------- ## +## Report this to pgsql-bugs@postgresql.org ## +## ---------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_pthread_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +fi +if test $ac_cv_header_pthread_h = yes; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + { { echo "$as_me:$LINENO: error: pthread.h not found, required for --enable-thread-safety" >&5 +echo "$as_me: error: pthread.h not found, required for --enable-thread-safety" >&2;} + { (exit 1); exit 1; }; } +fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -# If we found "long int" is 64 bits, assume snprintf handles it. If -# we found we need to use "long long int", better check. We cope with -# snprintfs that use %lld, %qd, or %I64d as the format. If none of these -# work, fall back to our own snprintf emulation (which we know uses %lld). -if test "$HAVE_LONG_LONG_INT_64" = yes ; then - if test $pgac_need_repl_snprintf = no; then - { echo "$as_me:$LINENO: checking snprintf format for long long int" >&5 -echo $ECHO_N "checking snprintf format for long long int... $ECHO_C" >&6; } -if test "${pgac_cv_snprintf_long_long_int_format+set}" = set; then +for ac_func in strerror_r getpwuid_r gethostbyname_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 - for pgac_format in '%lld' '%qd' '%I64d'; do -if test "$cross_compiling" = yes; then - pgac_cv_snprintf_long_long_int_format=cross; break else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21148,125 +20960,90 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -typedef long long int ac_int64; -#define INT64_FORMAT "$pgac_format" +/* 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 -ac_int64 a = 20000001; -ac_int64 b = 40000005; +/* 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. */ -int does_int64_snprintf_work() -{ - ac_int64 c; - char buf[100]; +#ifdef __STDC__ +# include +#else +# include +#endif - if (sizeof(ac_int64) != 8) - return 0; /* doesn't look like the right size */ +#undef $ac_func - c = a * b; - snprintf(buf, 100, INT64_FORMAT, c); - if (strcmp(buf, "800000140000005") != 0) - return 0; /* either multiply or snprintf is busted */ - return 1; -} -main() { - exit(! does_int64_snprintf_work()); +/* 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_exeext +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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (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_try") 2>&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); }; }; then - pgac_cv_snprintf_long_long_int_format=$pgac_format; break + (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: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -done -fi - -LONG_LONG_INT_FORMAT='' -case $pgac_cv_snprintf_long_long_int_format in - cross) { echo "$as_me:$LINENO: result: cannot test (not on host machine)" >&5 -echo "${ECHO_T}cannot test (not on host machine)" >&6; };; - ?*) { echo "$as_me:$LINENO: result: $pgac_cv_snprintf_long_long_int_format" >&5 -echo "${ECHO_T}$pgac_cv_snprintf_long_long_int_format" >&6; } - LONG_LONG_INT_FORMAT=$pgac_cv_snprintf_long_long_int_format;; - *) { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; };; -esac - if test "$LONG_LONG_INT_FORMAT" = ""; then - # Force usage of our own snprintf, since system snprintf is broken - pgac_need_repl_snprintf=yes - LONG_LONG_INT_FORMAT='%lld' - fi - else - # Here if we previously decided we needed to use our own snprintf - LONG_LONG_INT_FORMAT='%lld' - fi - LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'` - INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\"" - UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\"" -else - # Here if we are not using 'long long int' at all - INT64_FORMAT='"%ld"' - UINT64_FORMAT='"%lu"' +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi - - -cat >>confdefs.h <<_ACEOF -#define INT64_FORMAT $INT64_FORMAT -_ACEOF - - - -cat >>confdefs.h <<_ACEOF -#define UINT64_FORMAT $UINT64_FORMAT -_ACEOF - - -# Now we have checked all the reasons to replace snprintf -if test $pgac_need_repl_snprintf = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_REPL_SNPRINTF 1 +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 - case " $LIBOBJS " in - *" snprintf.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" - ;; -esac - fi +done -# Need a #define for the size of Datum (unsigned long) -{ echo "$as_me:$LINENO: checking for unsigned long" >&5 -echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6; } -if test "${ac_cv_type_unsigned_long+set}" = set; then + +# Do test here with the proper thread flags +{ echo "$as_me:$LINENO: checking whether getpwuid_r takes a fifth argument" >&5 +echo $ECHO_N "checking whether getpwuid_r takes a fifth argument... $ECHO_C" >&6; } +if test "${pgac_cv_func_getpwuid_r_5arg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -21275,15 +21052,17 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef unsigned long ac__type_new_; +#include +#include int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +uid_t uid; +struct passwd *space; +char *buf; +size_t bufsize; +struct passwd **result; +getpwuid_r(uid, space, buf, bufsize, result); ; return 0; } @@ -21305,44 +21084,47 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_unsigned_long=yes + pgac_cv_func_getpwuid_r_5arg=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_unsigned_long=no + pgac_cv_func_getpwuid_r_5arg=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6; } +{ echo "$as_me:$LINENO: result: $pgac_cv_func_getpwuid_r_5arg" >&5 +echo "${ECHO_T}$pgac_cv_func_getpwuid_r_5arg" >&6; } +if test x"$pgac_cv_func_getpwuid_r_5arg" = xyes ; then -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of unsigned long" >&5 -echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_unsigned_long+set}" = set; then +cat >>confdefs.h <<\_ACEOF +#define GETPWUID_R_5ARG +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether strerror_r returns int" >&5 +echo $ECHO_N "checking whether strerror_r returns int... $ECHO_C" >&6; } +if test "${pgac_cv_func_strerror_r_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef unsigned long ac__type_sizeof_; +#include int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; -test_array [0] = 0 - +#ifndef _AIX +int strerror_r(int, char *, size_t); +#else +/* Older AIX has 'int' for the third argument so we don't test the args. */ +int strerror_r(); +#endif ; return 0; } @@ -21364,34 +21146,82 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + pgac_cv_func_strerror_r_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pgac_cv_func_strerror_r_int=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $pgac_cv_func_strerror_r_int" >&5 +echo "${ECHO_T}$pgac_cv_func_strerror_r_int" >&6; } +if test x"$pgac_cv_func_strerror_r_int" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define STRERROR_R_INT +_ACEOF + +fi + + +CFLAGS="$_CFLAGS" +LIBS="$_LIBS" + +else +# do not use values from template file +PTHREAD_CFLAGS= +PTHREAD_LIBS= +fi + + + + + +# We can test for libldap_r only after we know PTHREAD_LIBS +if test "$with_ldap" = yes ; then + _LIBS="$LIBS" + if test "$PORTNAME" != "win32"; then + +{ echo "$as_me:$LINENO: checking for ldap_bind in -lldap" >&5 +echo $ECHO_N "checking for ldap_bind in -lldap... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldap_ldap_bind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldap $EXTRA_LDAP_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef unsigned long ac__type_sizeof_; + +/* 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 ldap_bind (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - +return ldap_bind (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21400,52 +21230,76 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldap_ldap_bind=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_cv_lib_ldap_ldap_bind=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_bind" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap_ldap_bind" >&6; } +if test $ac_cv_lib_ldap_ldap_bind = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBLDAP 1 +_ACEOF + + LIBS="-lldap $LIBS" + else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + { { echo "$as_me:$LINENO: error: library 'ldap' is required for LDAP" >&5 +echo "$as_me: error: library 'ldap' is required for LDAP" >&2;} + { (exit 1); exit 1; }; } +fi - cat >conftest.$ac_ext <<_ACEOF + LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS" + if test "$enable_thread_safety" = yes; then + # on some platforms ldap_r fails to link without PTHREAD_LIBS + +{ echo "$as_me:$LINENO: checking for ldap_simple_bind in -lldap_r" >&5 +echo $ECHO_N "checking for ldap_simple_bind in -lldap_r... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldap_r_ldap_simple_bind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef unsigned long ac__type_sizeof_; + +/* 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 ldap_simple_bind (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; -test_array [0] = 0 - +return ldap_simple_bind (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21454,35 +21308,78 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldap_r_ldap_simple_bind=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldap_r_ldap_simple_bind=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap_r_ldap_simple_bind" >&6; } +if test $ac_cv_lib_ldap_r_ldap_simple_bind = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBLDAP_R 1 +_ACEOF + + LIBS="-lldap_r $LIBS" + +else + { { echo "$as_me:$LINENO: error: library 'ldap_r' is required for LDAP" >&5 +echo "$as_me: error: library 'ldap_r' is required for LDAP" >&2;} + { (exit 1); exit 1; }; } +fi + + LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS" + else + LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS" + fi + else + +{ echo "$as_me:$LINENO: checking for ldap_bind in -lwldap32" >&5 +echo $ECHO_N "checking for ldap_bind in -lwldap32... $ECHO_C" >&6; } +if test "${ac_cv_lib_wldap32_ldap_bind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lwldap32 $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef unsigned long ac__type_sizeof_; + +/* 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 ldap_bind (); int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; -test_array [0] = 0 - +return ldap_bind (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21491,93 +21388,121 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_wldap32_ldap_bind=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_cv_lib_wldap32_ldap_bind=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_wldap32_ldap_bind" >&5 +echo "${ECHO_T}$ac_cv_lib_wldap32_ldap_bind" >&6; } +if test $ac_cv_lib_wldap32_ldap_bind = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBWLDAP32 1 +_ACEOF - ac_lo= ac_hi= + LIBS="-lwldap32 $LIBS" + +else + { { echo "$as_me:$LINENO: error: library 'wldap32' is required for LDAP" >&5 +echo "$as_me: error: library 'wldap32' is required for LDAP" >&2;} + { (exit 1); exit 1; }; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + LDAP_LIBS_FE="-lwldap32" + LDAP_LIBS_BE="-lwldap32" + fi + LIBS="$_LIBS" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + + + +# This test makes sure that run tests work at all. Sometimes a shared +# library is found by the linker, but the runtime linker can't find it. +# This check should come after all modifications of compiler or linker +# variables, and before any other run tests. +{ echo "$as_me:$LINENO: checking test program" >&5 +echo $ECHO_N "checking test program... $ECHO_C" >&6; } +if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: result: cross-compiling" >&5 +echo "${ECHO_T}cross-compiling" >&6; } +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef unsigned long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} +int main() { return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f 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_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 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_objext; then - ac_hi=$ac_mid + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` +( exit $ac_status ) +{ echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } +{ { echo "$as_me:$LINENO: error: +Could not execute a simple test program. This may be a problem +related to locating shared libraries. Check the file 'config.log' +for the exact reason." >&5 +echo "$as_me: error: +Could not execute a simple test program. This may be a problem +related to locating shared libraries. Check the file 'config.log' +for the exact reason." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_unsigned_long=$ac_lo;; -'') if test "$ac_cv_type_unsigned_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_unsigned_long=0 - fi ;; -esac + + +# -------------------- +# Run tests below here +# -------------------- + +# Force use of our snprintf if system's doesn't do arg control +# See comment above at snprintf test for details. +if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then + { echo "$as_me:$LINENO: checking whether printf supports argument control" >&5 +echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6; } +if test "${pgac_cv_printf_arg_control+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + pgac_cv_printf_arg_control=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21585,36 +21510,17 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef unsigned long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include -#include -int -main () +#include + +int main() { + char buf[100]; - FILE *f = fopen ("conftest.val", "w"); - if (! f) + /* can it swap arguments? */ + snprintf(buf, 100, "%2\$d %1\$d", 3, 4); + if (strcmp(buf, "4 3") != 0) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; - - ; return 0; } _ACEOF @@ -21638,59 +21544,53 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_unsigned_long=`cat conftest.val` + pgac_cv_printf_arg_control=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_unsigned_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_unsigned_long=0 - fi +pgac_cv_printf_arg_control=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long -_ACEOF +fi +{ echo "$as_me:$LINENO: result: $pgac_cv_printf_arg_control" >&5 +echo "${ECHO_T}$pgac_cv_printf_arg_control" >&6; } + if test $pgac_cv_printf_arg_control != yes ; then + pgac_need_repl_snprintf=yes + fi +fi -# And check size of void *, size_t (enables tweaks for > 32bit address space) -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then + + +{ echo "$as_me:$LINENO: checking whether long int is 64 bits" >&5 +echo $ECHO_N "checking whether long int is 64 bits... $ECHO_C" >&6; } +if test "${pgac_cv_type_long_int_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + # If cross-compiling, check the size reported by the compiler and +# trust that the arithmetic works. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(sizeof(long int) == 8)]; +test_array [0] = 0 + ; return 0; } @@ -21712,79 +21612,116 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes + pgac_cv_type_long_int_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_void_p=no + pgac_cv_type_long_int_64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () +typedef long int ac_int64; + +/* + * These are globals to discourage the compiler from folding all the + * arithmetic tests down to compile-time constants. + */ +ac_int64 a = 20000001; +ac_int64 b = 40000005; + +int does_int64_work() { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; -test_array [0] = 0 + ac_int64 c,d; - ; - return 0; + if (sizeof(ac_int64) != 8) + return 0; /* definitely not the right size */ + + /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ + c = a * b; + d = (c + b) / b; + if (d != a+1) + return 0; + return 1; +} +main() { + exit(! does_int64_work()); } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f 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_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 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_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + pgac_cv_type_long_int_64=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +pgac_cv_type_long_int_64=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $pgac_cv_type_long_int_64" >&5 +echo "${ECHO_T}$pgac_cv_type_long_int_64" >&6; } + +HAVE_LONG_INT_64=$pgac_cv_type_long_int_64 +if test x"$pgac_cv_type_long_int_64" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_INT_64 1 +_ACEOF + +fi + + +if test x"$HAVE_LONG_INT_64" = x"no" ; then + { echo "$as_me:$LINENO: checking whether long long int is 64 bits" >&5 +echo $ECHO_N "checking whether long long int is 64 bits... $ECHO_C" >&6; } +if test "${pgac_cv_type_long_long_int_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # If cross-compiling, check the size reported by the compiler and +# trust that the arithmetic works. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(sizeof(long long int) == 8)]; test_array [0] = 0 ; @@ -21808,139 +21745,118 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break + pgac_cv_type_long_long_int_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + pgac_cv_type_long_long_int_64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () +typedef long long int ac_int64; + +/* + * These are globals to discourage the compiler from folding all the + * arithmetic tests down to compile-time constants. + */ +ac_int64 a = 20000001; +ac_int64 b = 40000005; + +int does_int64_work() { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; -test_array [0] = 0 + ac_int64 c,d; - ; - return 0; + if (sizeof(ac_int64) != 8) + return 0; /* definitely not the right size */ + + /* Do perfunctory checks to see if 64-bit arithmetic seems to work */ + c = a * b; + d = (c + b) / b; + if (d != a+1) + return 0; + return 1; +} +main() { + exit(! does_int64_work()); } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f 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_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 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_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_compile") 2>conftest.er1 + (eval "$ac_try") 2>&5 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_objext; then - ac_lo=$ac_mid; break + (exit $ac_status); }; }; then + pgac_cv_type_long_long_int_64=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +( exit $ac_status ) +pgac_cv_type_long_long_int_64=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= fi +{ echo "$as_me:$LINENO: result: $pgac_cv_type_long_long_int_64" >&5 +echo "${ECHO_T}$pgac_cv_type_long_long_int_64" >&6; } + +HAVE_LONG_LONG_INT_64=$pgac_cv_type_long_long_int_64 +if test x"$pgac_cv_type_long_long_int_64" = xyes ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_LONG_INT_64 1 +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + if test x"$HAVE_LONG_LONG_INT_64" = x"no" ; then + { { echo "$as_me:$LINENO: error: Cannot find a working 64-bit integer type." >&5 +echo "$as_me: error: Cannot find a working 64-bit integer type." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; + +#define INT64CONST(x) x##LL +long long int foo = INT64CONST(0x1234567890123456); + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 ; return 0; @@ -21963,28 +21879,37 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LL_CONSTANTS 1 +_ACEOF + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_void_p=$ac_lo;; -'') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi ;; -esac +fi + + +# If we found "long int" is 64 bits, assume snprintf handles it. If +# we found we need to use "long long int", better check. We cope with +# snprintfs that use %lld, %qd, or %I64d as the format. If none of these +# work, fall back to our own snprintf emulation (which we know uses %lld). + +if test "$HAVE_LONG_LONG_INT_64" = yes ; then + if test $pgac_need_repl_snprintf = no; then + { echo "$as_me:$LINENO: checking snprintf format for long long int" >&5 +echo $ECHO_N "checking snprintf format for long long int... $ECHO_C" >&6; } +if test "${pgac_cv_snprintf_long_long_int_format+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for pgac_format in '%lld' '%qd' '%I64d'; do +if test "$cross_compiling" = yes; then + pgac_cv_snprintf_long_long_int_format=cross; break else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21992,37 +21917,29 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include -#include -int -main () +typedef long long int ac_int64; +#define INT64_FORMAT "$pgac_format" + +ac_int64 a = 20000001; +ac_int64 b = 40000005; + +int does_int64_snprintf_work() { + ac_int64 c; + char buf[100]; - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; + if (sizeof(ac_int64) != 8) + return 0; /* doesn't look like the right size */ - ; - return 0; + c = a * b; + snprintf(buf, 100, INT64_FORMAT, c); + if (strcmp(buf, "800000140000005") != 0) + return 0; /* either multiply or snprintf is busted */ + return 1; +} +main() { + exit(! does_int64_snprintf_work()); } _ACEOF rm -f conftest$ac_exeext @@ -22045,40 +21962,80 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_void_p=`cat conftest.val` + pgac_cv_snprintf_long_long_int_format=$pgac_format; break else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.val + + +done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +LONG_LONG_INT_FORMAT='' + +case $pgac_cv_snprintf_long_long_int_format in + cross) { echo "$as_me:$LINENO: result: cannot test (not on host machine)" >&5 +echo "${ECHO_T}cannot test (not on host machine)" >&6; };; + ?*) { echo "$as_me:$LINENO: result: $pgac_cv_snprintf_long_long_int_format" >&5 +echo "${ECHO_T}$pgac_cv_snprintf_long_long_int_format" >&6; } + LONG_LONG_INT_FORMAT=$pgac_cv_snprintf_long_long_int_format;; + *) { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; };; +esac + if test "$LONG_LONG_INT_FORMAT" = ""; then + # Force usage of our own snprintf, since system snprintf is broken + pgac_need_repl_snprintf=yes + LONG_LONG_INT_FORMAT='%lld' + fi + else + # Here if we previously decided we needed to use our own snprintf + LONG_LONG_INT_FORMAT='%lld' + fi + LONG_LONG_UINT_FORMAT=`echo "$LONG_LONG_INT_FORMAT" | sed 's/d$/u/'` + INT64_FORMAT="\"$LONG_LONG_INT_FORMAT\"" + UINT64_FORMAT="\"$LONG_LONG_UINT_FORMAT\"" +else + # Here if we are not using 'long long int' at all + INT64_FORMAT='"%ld"' + UINT64_FORMAT='"%lu"' +fi cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +#define INT64_FORMAT $INT64_FORMAT _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then + +cat >>confdefs.h <<_ACEOF +#define UINT64_FORMAT $UINT64_FORMAT +_ACEOF + + +# Now we have checked all the reasons to replace snprintf +if test $pgac_need_repl_snprintf = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_REPL_SNPRINTF 1 +_ACEOF + + case " $LIBOBJS " in + *" snprintf.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" + ;; +esac + +fi + +# Need a #define for the size of Datum (unsigned long) +{ echo "$as_me:$LINENO: checking for unsigned long" >&5 +echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6; } +if test "${ac_cv_type_unsigned_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22088,7 +22045,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; +typedef unsigned long ac__type_new_; int main () { @@ -22117,26 +22074,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + ac_cv_type_unsigned_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + ac_cv_type_unsigned_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_size_t+set}" = set; then +{ echo "$as_me:$LINENO: checking size of unsigned long" >&5 +echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_unsigned_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -22148,7 +22105,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; + typedef unsigned long ac__type_sizeof_; int main () { @@ -22185,7 +22142,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; + typedef unsigned long ac__type_sizeof_; int main () { @@ -22239,7 +22196,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; + typedef unsigned long ac__type_sizeof_; int main () { @@ -22276,7 +22233,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; + typedef unsigned long ac__type_sizeof_; int main () { @@ -22340,7 +22297,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; + typedef unsigned long ac__type_sizeof_; int main () { @@ -22379,15 +22336,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_sizeof_size_t=$ac_lo;; -'') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) +?*) ac_cv_sizeof_unsigned_long=$ac_lo;; +'') if test "$ac_cv_type_unsigned_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_sizeof_size_t=0 + ac_cv_sizeof_unsigned_long=0 fi ;; esac else @@ -22398,7 +22355,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; + typedef unsigned long ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include @@ -22426,198 +22383,66 @@ main () } return ferror (f) || fclose (f) != 0; - ; - return 0; -} -_ACEOF -rm -f 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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (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_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_size_t=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_size_t=0 - fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF - - - -# Decide whether float4 is passed by value: user-selectable, enabled by default -{ echo "$as_me:$LINENO: checking whether to build with float4 passed by value" >&5 -echo $ECHO_N "checking whether to build with float4 passed by value... $ECHO_C" >&6; } - -pgac_args="$pgac_args enable_float4_byval" - -# Check whether --enable-float4-byval was given. -if test "${enable_float4_byval+set}" = set; then - enableval=$enable_float4_byval; - case $enableval in - yes) - -cat >>confdefs.h <<\_ACEOF -#define USE_FLOAT4_BYVAL 1 -_ACEOF - - float4passbyval=true - ;; - no) - float4passbyval=false - ;; - *) - { { echo "$as_me:$LINENO: error: no argument expected for --enable-float4-byval option" >&5 -echo "$as_me: error: no argument expected for --enable-float4-byval option" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - -else - enable_float4_byval=yes - -cat >>confdefs.h <<\_ACEOF -#define USE_FLOAT4_BYVAL 1 -_ACEOF - - float4passbyval=true -fi - - -{ echo "$as_me:$LINENO: result: $enable_float4_byval" >&5 -echo "${ECHO_T}$enable_float4_byval" >&6; } - -cat >>confdefs.h <<_ACEOF -#define FLOAT4PASSBYVAL $float4passbyval -_ACEOF - - -# Decide whether float8 is passed by value. -# Note: this setting also controls int8 and related types such as timestamp. -# If sizeof(Datum) >= 8, this is user-selectable, enabled by default. -# If not, trying to select it is an error. -{ echo "$as_me:$LINENO: checking whether to build with float8 passed by value" >&5 -echo $ECHO_N "checking whether to build with float8 passed by value... $ECHO_C" >&6; } -if test $ac_cv_sizeof_unsigned_long -ge 8 ; then - -pgac_args="$pgac_args enable_float8_byval" - -# Check whether --enable-float8-byval was given. -if test "${enable_float8_byval+set}" = set; then - enableval=$enable_float8_byval; - case $enableval in - yes) - : - ;; - no) - : - ;; - *) - { { echo "$as_me:$LINENO: error: no argument expected for --enable-float8-byval option" >&5 -echo "$as_me: error: no argument expected for --enable-float8-byval option" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - + ; + return 0; +} +_ACEOF +rm -f 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>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_unsigned_long=`cat conftest.val` else - enable_float8_byval=yes + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +if test "$ac_cv_type_unsigned_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (unsigned long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_long=0 + fi fi - - -else - -pgac_args="$pgac_args enable_float8_byval" - -# Check whether --enable-float8-byval was given. -if test "${enable_float8_byval+set}" = set; then - enableval=$enable_float8_byval; - case $enableval in - yes) - : - ;; - no) - : - ;; - *) - { { echo "$as_me:$LINENO: error: no argument expected for --enable-float8-byval option" >&5 -echo "$as_me: error: no argument expected for --enable-float8-byval option" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - -else - enable_float8_byval=no - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - - - if test "$enable_float8_byval" = yes ; then - { { echo "$as_me:$LINENO: error: --enable-float8-byval is not supported on 32-bit platforms." >&5 -echo "$as_me: error: --enable-float8-byval is not supported on 32-bit platforms." >&2;} - { (exit 1); exit 1; }; } - fi +rm -f conftest.val fi -if test "$enable_float8_byval" = yes ; then +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6; } -cat >>confdefs.h <<\_ACEOF -#define USE_FLOAT8_BYVAL 1 -_ACEOF - float8passbyval=true -else - float8passbyval=false -fi -{ echo "$as_me:$LINENO: result: $enable_float8_byval" >&5 -echo "${ECHO_T}$enable_float8_byval" >&6; } cat >>confdefs.h <<_ACEOF -#define FLOAT8PASSBYVAL $float8passbyval +#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF -# Determine memory alignment requirements for the basic C data types. -{ echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6; } -if test "${ac_cv_type_short+set}" = set; then +# And check size of void *, size_t (enables tweaks for > 32bit address space) +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22627,7 +22452,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef short ac__type_new_; +typedef void * ac__type_new_; int main () { @@ -22656,24 +22481,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_short=yes + ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_short=no + ac_cv_type_void_p=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } -# The cast to long int works around a bug in the HP C Compiler, -# see AC_CHECK_SIZEOF for more information. -{ echo "$as_me:$LINENO: checking alignment of short" >&5 -echo $ECHO_N "checking alignment of short... $ECHO_C" >&6; } -if test "${ac_cv_alignof_short+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -22685,14 +22512,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; short y; } ac__type_alignof_; + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -22725,14 +22549,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; short y; } ac__type_alignof_; + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22782,14 +22603,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; short y; } ac__type_alignof_; + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -22822,14 +22640,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; short y; } ac__type_alignof_; + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -22889,14 +22704,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; short y; } ac__type_alignof_; + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22931,15 +22743,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_alignof_short=$ac_lo;; -'') if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of short +?*) ac_cv_sizeof_void_p=$ac_lo;; +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of short +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_short=0 + ac_cv_sizeof_void_p=0 fi ;; esac else @@ -22950,12 +22762,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; short y; } ac__type_alignof_; -static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } -static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -22965,17 +22774,17 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) offsetof (ac__type_alignof_, y)) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) offsetof (ac__type_alignof_, y))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) offsetof (ac__type_alignof_, y))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } @@ -23005,40 +22814,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_alignof_short=`cat conftest.val` + ac_cv_sizeof_void_p=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of short +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of short +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_short=0 + ac_cv_sizeof_void_p=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_alignof_short" >&5 -echo "${ECHO_T}$ac_cv_alignof_short" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF -#define ALIGNOF_SHORT $ac_cv_alignof_short +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -23048,7 +22857,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int ac__type_new_; +typedef size_t ac__type_new_; int main () { @@ -23077,24 +22886,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes + ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no + ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -# The cast to long int works around a bug in the HP C Compiler, -# see AC_CHECK_SIZEOF for more information. -{ echo "$as_me:$LINENO: checking alignment of int" >&5 -echo $ECHO_N "checking alignment of int... $ECHO_C" >&6; } -if test "${ac_cv_alignof_int+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of size_t" >&5 +echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +if test "${ac_cv_sizeof_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -23106,14 +22917,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; int y; } ac__type_alignof_; + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -23146,14 +22954,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; int y; } ac__type_alignof_; + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -23203,14 +23008,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; int y; } ac__type_alignof_; + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -23243,14 +23045,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; int y; } ac__type_alignof_; + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -23310,14 +23109,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; int y; } ac__type_alignof_; + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -23352,15 +23148,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_alignof_int=$ac_lo;; -'') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of int +?*) ac_cv_sizeof_size_t=$ac_lo;; +'') if test "$ac_cv_type_size_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of int +echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_int=0 + ac_cv_sizeof_size_t=0 fi ;; esac else @@ -23371,12 +23167,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#ifndef offsetof -# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) -#endif -typedef struct { char x; int y; } ac__type_alignof_; -static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } -static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } + typedef size_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -23386,17 +23179,17 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) offsetof (ac__type_alignof_, y)) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) offsetof (ac__type_alignof_, y))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) offsetof (ac__type_alignof_, y))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } @@ -23426,40 +23219,174 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_alignof_int=`cat conftest.val` + ac_cv_sizeof_size_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of int +if test "$ac_cv_type_size_t" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of int +echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_int=0 + ac_cv_sizeof_size_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_alignof_int" >&5 -echo "${ECHO_T}$ac_cv_alignof_int" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF -#define ALIGNOF_INT $ac_cv_alignof_int +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then + +# Decide whether float4 is passed by value: user-selectable, enabled by default +{ echo "$as_me:$LINENO: checking whether to build with float4 passed by value" >&5 +echo $ECHO_N "checking whether to build with float4 passed by value... $ECHO_C" >&6; } + +pgac_args="$pgac_args enable_float4_byval" + +# Check whether --enable-float4-byval was given. +if test "${enable_float4_byval+set}" = set; then + enableval=$enable_float4_byval; + case $enableval in + yes) + +cat >>confdefs.h <<\_ACEOF +#define USE_FLOAT4_BYVAL 1 +_ACEOF + + float4passbyval=true + ;; + no) + float4passbyval=false + ;; + *) + { { echo "$as_me:$LINENO: error: no argument expected for --enable-float4-byval option" >&5 +echo "$as_me: error: no argument expected for --enable-float4-byval option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + enable_float4_byval=yes + +cat >>confdefs.h <<\_ACEOF +#define USE_FLOAT4_BYVAL 1 +_ACEOF + + float4passbyval=true +fi + + +{ echo "$as_me:$LINENO: result: $enable_float4_byval" >&5 +echo "${ECHO_T}$enable_float4_byval" >&6; } + +cat >>confdefs.h <<_ACEOF +#define FLOAT4PASSBYVAL $float4passbyval +_ACEOF + + +# Decide whether float8 is passed by value. +# Note: this setting also controls int8 and related types such as timestamp. +# If sizeof(Datum) >= 8, this is user-selectable, enabled by default. +# If not, trying to select it is an error. +{ echo "$as_me:$LINENO: checking whether to build with float8 passed by value" >&5 +echo $ECHO_N "checking whether to build with float8 passed by value... $ECHO_C" >&6; } +if test $ac_cv_sizeof_unsigned_long -ge 8 ; then + +pgac_args="$pgac_args enable_float8_byval" + +# Check whether --enable-float8-byval was given. +if test "${enable_float8_byval+set}" = set; then + enableval=$enable_float8_byval; + case $enableval in + yes) + : + ;; + no) + : + ;; + *) + { { echo "$as_me:$LINENO: error: no argument expected for --enable-float8-byval option" >&5 +echo "$as_me: error: no argument expected for --enable-float8-byval option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + enable_float8_byval=yes + +fi + + +else + +pgac_args="$pgac_args enable_float8_byval" + +# Check whether --enable-float8-byval was given. +if test "${enable_float8_byval+set}" = set; then + enableval=$enable_float8_byval; + case $enableval in + yes) + : + ;; + no) + : + ;; + *) + { { echo "$as_me:$LINENO: error: no argument expected for --enable-float8-byval option" >&5 +echo "$as_me: error: no argument expected for --enable-float8-byval option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + enable_float8_byval=no + +fi + + + if test "$enable_float8_byval" = yes ; then + { { echo "$as_me:$LINENO: error: --enable-float8-byval is not supported on 32-bit platforms." >&5 +echo "$as_me: error: --enable-float8-byval is not supported on 32-bit platforms." >&2;} + { (exit 1); exit 1; }; } + fi +fi +if test "$enable_float8_byval" = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define USE_FLOAT8_BYVAL 1 +_ACEOF + + float8passbyval=true +else + float8passbyval=false +fi +{ echo "$as_me:$LINENO: result: $enable_float8_byval" >&5 +echo "${ECHO_T}$enable_float8_byval" >&6; } + +cat >>confdefs.h <<_ACEOF +#define FLOAT8PASSBYVAL $float8passbyval +_ACEOF + + +# Determine memory alignment requirements for the basic C data types. + +{ echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6; } +if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -23469,7 +23396,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef long ac__type_new_; +typedef short ac__type_new_; int main () { @@ -23498,24 +23425,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes + ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_long=no + ac_cv_type_short=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6; } # The cast to long int works around a bug in the HP C Compiler, # see AC_CHECK_SIZEOF for more information. -{ echo "$as_me:$LINENO: checking alignment of long" >&5 -echo $ECHO_N "checking alignment of long... $ECHO_C" >&6; } -if test "${ac_cv_alignof_long+set}" = set; then +{ echo "$as_me:$LINENO: checking alignment of short" >&5 +echo $ECHO_N "checking alignment of short... $ECHO_C" >&6; } +if test "${ac_cv_alignof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -23530,7 +23457,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long y; } ac__type_alignof_; +typedef struct { char x; short y; } ac__type_alignof_; int main () { @@ -23570,7 +23497,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long y; } ac__type_alignof_; +typedef struct { char x; short y; } ac__type_alignof_; int main () { @@ -23627,7 +23554,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long y; } ac__type_alignof_; +typedef struct { char x; short y; } ac__type_alignof_; int main () { @@ -23667,7 +23594,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long y; } ac__type_alignof_; +typedef struct { char x; short y; } ac__type_alignof_; int main () { @@ -23734,7 +23661,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long y; } ac__type_alignof_; +typedef struct { char x; short y; } ac__type_alignof_; int main () { @@ -23773,15 +23700,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_alignof_long=$ac_lo;; -'') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of long +?*) ac_cv_alignof_short=$ac_lo;; +'') if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of short See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of long +echo "$as_me: error: cannot compute alignment of short See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_long=0 + ac_cv_alignof_short=0 fi ;; esac else @@ -23795,7 +23722,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long y; } ac__type_alignof_; +typedef struct { char x; short y; } ac__type_alignof_; static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } #include @@ -23847,41 +23774,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_alignof_long=`cat conftest.val` + ac_cv_alignof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of long +if test "$ac_cv_type_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of short See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of long +echo "$as_me: error: cannot compute alignment of short See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_long=0 + ac_cv_alignof_short=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_alignof_long" >&5 -echo "${ECHO_T}$ac_cv_alignof_long" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_alignof_short" >&5 +echo "${ECHO_T}$ac_cv_alignof_short" >&6; } cat >>confdefs.h <<_ACEOF -#define ALIGNOF_LONG $ac_cv_alignof_long +#define ALIGNOF_SHORT $ac_cv_alignof_short _ACEOF -if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then - { echo "$as_me:$LINENO: checking for long long int" >&5 -echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long_int+set}" = set; then +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } +if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -23891,7 +23817,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef long long int ac__type_new_; +typedef int ac__type_new_; int main () { @@ -23920,24 +23846,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_long_long_int=yes + ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_long_long_int=no + ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 -echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } # The cast to long int works around a bug in the HP C Compiler, # see AC_CHECK_SIZEOF for more information. -{ echo "$as_me:$LINENO: checking alignment of long long int" >&5 -echo $ECHO_N "checking alignment of long long int... $ECHO_C" >&6; } -if test "${ac_cv_alignof_long_long_int+set}" = set; then +{ echo "$as_me:$LINENO: checking alignment of int" >&5 +echo $ECHO_N "checking alignment of int... $ECHO_C" >&6; } +if test "${ac_cv_alignof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -23952,7 +23878,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long long int y; } ac__type_alignof_; +typedef struct { char x; int y; } ac__type_alignof_; int main () { @@ -23992,7 +23918,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long long int y; } ac__type_alignof_; +typedef struct { char x; int y; } ac__type_alignof_; int main () { @@ -24049,7 +23975,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long long int y; } ac__type_alignof_; +typedef struct { char x; int y; } ac__type_alignof_; int main () { @@ -24089,7 +24015,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long long int y; } ac__type_alignof_; +typedef struct { char x; int y; } ac__type_alignof_; int main () { @@ -24156,7 +24082,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long long int y; } ac__type_alignof_; +typedef struct { char x; int y; } ac__type_alignof_; int main () { @@ -24195,15 +24121,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_alignof_long_long_int=$ac_lo;; -'') if test "$ac_cv_type_long_long_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of long long int +?*) ac_cv_alignof_int=$ac_lo;; +'') if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of int See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of long long int +echo "$as_me: error: cannot compute alignment of int See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_long_long_int=0 + ac_cv_alignof_int=0 fi ;; esac else @@ -24217,7 +24143,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; long long int y; } ac__type_alignof_; +typedef struct { char x; int y; } ac__type_alignof_; static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } #include @@ -24269,41 +24195,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_alignof_long_long_int=`cat conftest.val` + ac_cv_alignof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_long_long_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of long long int +if test "$ac_cv_type_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of int See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of long long int +echo "$as_me: error: cannot compute alignment of int See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_long_long_int=0 + ac_cv_alignof_int=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_alignof_long_long_int" >&5 -echo "${ECHO_T}$ac_cv_alignof_long_long_int" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_alignof_int" >&5 +echo "${ECHO_T}$ac_cv_alignof_int" >&6; } cat >>confdefs.h <<_ACEOF -#define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int +#define ALIGNOF_INT $ac_cv_alignof_int _ACEOF -fi -{ echo "$as_me:$LINENO: checking for double" >&5 -echo $ECHO_N "checking for double... $ECHO_C" >&6; } -if test "${ac_cv_type_double+set}" = set; then +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } +if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -24313,7 +24238,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef double ac__type_new_; +typedef long ac__type_new_; int main () { @@ -24342,24 +24267,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_double=yes + ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_double=no + ac_cv_type_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 -echo "${ECHO_T}$ac_cv_type_double" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } # The cast to long int works around a bug in the HP C Compiler, # see AC_CHECK_SIZEOF for more information. -{ echo "$as_me:$LINENO: checking alignment of double" >&5 -echo $ECHO_N "checking alignment of double... $ECHO_C" >&6; } -if test "${ac_cv_alignof_double+set}" = set; then +{ echo "$as_me:$LINENO: checking alignment of long" >&5 +echo $ECHO_N "checking alignment of long... $ECHO_C" >&6; } +if test "${ac_cv_alignof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -24374,7 +24299,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; double y; } ac__type_alignof_; +typedef struct { char x; long y; } ac__type_alignof_; int main () { @@ -24414,7 +24339,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; double y; } ac__type_alignof_; +typedef struct { char x; long y; } ac__type_alignof_; int main () { @@ -24471,7 +24396,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; double y; } ac__type_alignof_; +typedef struct { char x; long y; } ac__type_alignof_; int main () { @@ -24511,7 +24436,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; double y; } ac__type_alignof_; +typedef struct { char x; long y; } ac__type_alignof_; int main () { @@ -24578,7 +24503,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; double y; } ac__type_alignof_; +typedef struct { char x; long y; } ac__type_alignof_; int main () { @@ -24617,15 +24542,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in -?*) ac_cv_alignof_double=$ac_lo;; -'') if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of double +?*) ac_cv_alignof_long=$ac_lo;; +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of long See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of double +echo "$as_me: error: cannot compute alignment of long See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_double=0 + ac_cv_alignof_long=0 fi ;; esac else @@ -24639,7 +24564,7 @@ $ac_includes_default #ifndef offsetof # define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif -typedef struct { char x; double y; } ac__type_alignof_; +typedef struct { char x; long y; } ac__type_alignof_; static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } #include @@ -24691,61 +24616,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_alignof_double=`cat conftest.val` + ac_cv_alignof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute alignment of double +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of long See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute alignment of double +echo "$as_me: error: cannot compute alignment of long See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else - ac_cv_alignof_double=0 + ac_cv_alignof_long=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_alignof_double" >&5 -echo "${ECHO_T}$ac_cv_alignof_double" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define ALIGNOF_DOUBLE $ac_cv_alignof_double -_ACEOF - - +{ echo "$as_me:$LINENO: result: $ac_cv_alignof_long" >&5 +echo "${ECHO_T}$ac_cv_alignof_long" >&6; } -# Compute maximum alignment of any basic type. -# We assume long's alignment is at least as strong as char, short, or int; -# but we must check long long (if it exists) and double. -MAX_ALIGNOF=$ac_cv_alignof_long -if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then - MAX_ALIGNOF=$ac_cv_alignof_double -fi -if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then - MAX_ALIGNOF="$ac_cv_alignof_long_long_int" -fi cat >>confdefs.h <<_ACEOF -#define MAXIMUM_ALIGNOF $MAX_ALIGNOF +#define ALIGNOF_LONG $ac_cv_alignof_long _ACEOF - -# Some platforms predefine the types int8, int16, etc. Only check -# a (hopefully) representative subset. -{ echo "$as_me:$LINENO: checking for int8" >&5 -echo $ECHO_N "checking for int8... $ECHO_C" >&6; } -if test "${ac_cv_type_int8+set}" = set; then +if test x"$HAVE_LONG_LONG_INT_64" = x"yes" ; then + { echo "$as_me:$LINENO: checking for long long int" >&5 +echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -24754,12 +24659,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_SUPPORTDEFS_H -#include -#endif - -typedef int8 ac__type_new_; +$ac_includes_default +typedef long long int ac__type_new_; int main () { @@ -24788,50 +24689,142 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int8=yes + ac_cv_type_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int8=no + ac_cv_type_long_long_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int8" >&5 -echo "${ECHO_T}$ac_cv_type_int8" >&6; } -if test $ac_cv_type_int8 = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_INT8 1 +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ echo "$as_me:$LINENO: checking alignment of long long int" >&5 +echo $ECHO_N "checking alignment of long long int... $ECHO_C" >&6; } +if test "${ac_cv_alignof_long_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; long long int y; } ac__type_alignof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +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_compile") 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_objext; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; long long int y; } ac__type_alignof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +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_compile") 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_objext; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -{ echo "$as_me:$LINENO: checking for uint8" >&5 -echo $ECHO_N "checking for uint8... $ECHO_C" >&6; } -if test "${ac_cv_type_uint8+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_SUPPORTDEFS_H -#include +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif - -typedef uint8 ac__type_new_; +typedef struct { char x; long long int y; } ac__type_alignof_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) < 0)]; +test_array [0] = 0 + ; return 0; } @@ -24853,50 +24846,25 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uint8=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint8=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uint8" >&5 -echo "${ECHO_T}$ac_cv_type_uint8" >&6; } -if test $ac_cv_type_uint8 = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT8 1 -_ACEOF - - -fi -{ echo "$as_me:$LINENO: checking for int64" >&5 -echo $ECHO_N "checking for int64... $ECHO_C" >&6; } -if test "${ac_cv_type_int64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_SUPPORTDEFS_H -#include +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif - -typedef int64 ac__type_new_; +typedef struct { char x; long long int y; } ac__type_alignof_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -24918,50 +24886,52 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int64=yes + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int64=no + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int64" >&5 -echo "${ECHO_T}$ac_cv_type_int64" >&6; } -if test $ac_cv_type_int64 = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT64 1 -_ACEOF + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for uint64" >&5 -echo $ECHO_N "checking for uint64... $ECHO_C" >&6; } -if test "${ac_cv_type_uint64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#ifdef HAVE_SUPPORTDEFS_H -#include +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) #endif - -typedef uint64 ac__type_new_; +typedef struct { char x; long long int y; } ac__type_alignof_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -24983,34 +24953,28 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uint64=yes + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uint64=no + ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64" >&5 -echo "${ECHO_T}$ac_cv_type_uint64" >&6; } -if test $ac_cv_type_uint64 = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT64 1 -_ACEOF - - -fi - - -# We also check for sig_atomic_t, which *should* be defined per ANSI -# C, but is missing on some old platforms. -{ echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 -echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6; } -if test "${ac_cv_type_sig_atomic_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +done +case $ac_lo in +?*) ac_cv_alignof_long_long_int=$ac_lo;; +'') if test "$ac_cv_type_long_long_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of long long int +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute alignment of long long int +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_alignof_long_long_int=0 + fi ;; +esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25018,65 +24982,97 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - -typedef sig_atomic_t ac__type_new_; +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; long long int y; } ac__type_alignof_; +static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } +static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } +#include +#include int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) offsetof (ac__type_alignof_, y)) < 0) + { + long int i = longval (); + if (i != ((long int) offsetof (ac__type_alignof_, y))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) offsetof (ac__type_alignof_, y))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f 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_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 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_objext; then - ac_cv_type_sig_atomic_t=yes + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_alignof_long_long_int=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_sig_atomic_t=no +( exit $ac_status ) +if test "$ac_cv_type_long_long_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of long long int +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute alignment of long long int +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_alignof_long_long_int=0 + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 -echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6; } -if test $ac_cv_type_sig_atomic_t = yes; then +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_alignof_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_alignof_long_long_int" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_SIG_ATOMIC_T 1 +#define ALIGNOF_LONG_LONG_INT $ac_cv_alignof_long_long_int _ACEOF fi - - - -if test "$PORTNAME" != "win32" -then -{ echo "$as_me:$LINENO: checking for POSIX signal interface" >&5 -echo $ECHO_N "checking for POSIX signal interface... $ECHO_C" >&6; } -if test "${pgac_cv_func_posix_signals+set}" = set; then +{ echo "$as_me:$LINENO: checking for double" >&5 +echo $ECHO_N "checking for double... $ECHO_C" >&6; } +if test "${ac_cv_type_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -25085,27 +25081,27 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +$ac_includes_default +typedef double ac__type_new_; int main () { -struct sigaction act, oact; -sigemptyset(&act.sa_mask); -act.sa_flags = SA_RESTART; -sigaction(0, &act, &oact); +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" 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 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -25114,84 +25110,51 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 - pgac_cv_func_posix_signals=yes + } && test -s conftest.$ac_objext; then + ac_cv_type_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - pgac_cv_func_posix_signals=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: $pgac_cv_func_posix_signals" >&5 -echo "${ECHO_T}$pgac_cv_func_posix_signals" >&6; } -if test x"$pgac_cv_func_posix_signals" = xyes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_POSIX_SIGNALS -_ACEOF - -fi -HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals - -if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then - { { echo "$as_me:$LINENO: error: -Thread-safety requires POSIX signals, which are not supported by this -operating system." >&5 -echo "$as_me: error: -Thread-safety requires POSIX signals, which are not supported by this -operating system." >&2;} - { (exit 1); exit 1; }; } -fi + ac_cv_type_double=no fi -if test $ac_cv_func_fseeko = yes; then -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 +echo "${ECHO_T}$ac_cv_type_double" >&6; } -if test "$enable_largefile" != no; then - - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ echo "$as_me:$LINENO: checking alignment of double" >&5 +echo $ECHO_N "checking alignment of double... $ECHO_C" >&6; } +if test "${ac_cv_alignof_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; double y; } ac__type_alignof_; int main () { +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= 0)]; +test_array [0] = 0 ; return 0; } _ACEOF - rm -f conftest.$ac_objext +rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -25208,17 +25171,30 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; double y; } ac__type_alignof_; +int +main () +{ +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +test_array [0] = 0 -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; @@ -25235,51 +25211,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done else - while :; do - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; double y; } ac__type_alignof_; int main () { +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) < 0)]; +test_array [0] = 0 ; return 0; @@ -25302,34 +25268,24 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; double y; } ac__type_alignof_; int main () { +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) >= $ac_mid)]; +test_array [0] = 0 ; return 0; @@ -25352,55 +25308,51 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; double y; } ac__type_alignof_; int main () { +static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_, y)) <= $ac_mid)]; +test_array [0] = 0 ; return 0; @@ -25423,89 +25375,146 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_alignof_double=$ac_lo;; +'') if test "$ac_cv_type_double" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of double +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute alignment of double +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_alignof_double=0 + fi ;; +esac +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; +$ac_includes_default +#ifndef offsetof +# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0) +#endif +typedef struct { char x; double y; } ac__type_alignof_; +static long int longval () { return (long int) offsetof (ac__type_alignof_, y); } +static unsigned long int ulongval () { return (long int) offsetof (ac__type_alignof_, y); } +#include +#include int main () { + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) offsetof (ac__type_alignof_, y)) < 0) + { + long int i = longval (); + if (i != ((long int) offsetof (ac__type_alignof_, y))) + return 1; + fprintf (f, "%ld\n", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) offsetof (ac__type_alignof_, y))) + return 1; + fprintf (f, "%lu\n", i); + } + return ferror (f) || fclose (f) != 0; + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f 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_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 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_objext; then - ac_cv_sys_large_files=1; break + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (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_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_alignof_double=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - +( exit $ac_status ) +if test "$ac_cv_type_double" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute alignment of double +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute alignment of double +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } + else + ac_cv_alignof_double=0 + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) +rm -f conftest.val +fi +{ echo "$as_me:$LINENO: result: $ac_cv_alignof_double" >&5 +echo "${ECHO_T}$ac_cv_alignof_double" >&6; } + + + cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files +#define ALIGNOF_DOUBLE $ac_cv_alignof_double _ACEOF -;; -esac -rm -f conftest* - fi -fi + + +# Compute maximum alignment of any basic type. +# We assume long's alignment is at least as strong as char, short, or int; +# but we must check long long (if it exists) and double. + +MAX_ALIGNOF=$ac_cv_alignof_long +if test $MAX_ALIGNOF -lt $ac_cv_alignof_double ; then + MAX_ALIGNOF=$ac_cv_alignof_double +fi +if test x"$HAVE_LONG_LONG_INT_64" = xyes && test $MAX_ALIGNOF -lt $ac_cv_alignof_long_long_int ; then + MAX_ALIGNOF="$ac_cv_alignof_long_long_int" fi -# Check for largefile support (must be after AC_SYS_LARGEFILE) -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } -if test "${ac_cv_type_off_t+set}" = set; then +cat >>confdefs.h <<_ACEOF +#define MAXIMUM_ALIGNOF $MAX_ALIGNOF +_ACEOF + + + +# Some platforms predefine the types int8, int16, etc. Only check +# a (hopefully) representative subset. +{ echo "$as_me:$LINENO: checking for int8" >&5 +echo $ECHO_N "checking for int8... $ECHO_C" >&6; } +if test "${ac_cv_type_int8+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -25514,8 +25523,12 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef off_t ac__type_new_; +#include +#ifdef HAVE_SUPPORTDEFS_H +#include +#endif + +typedef int8 ac__type_new_; int main () { @@ -25544,81 +25557,50 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + ac_cv_type_int8=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + ac_cv_type_int8=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_int8" >&5 +echo "${ECHO_T}$ac_cv_type_int8" >&6; } +if test $ac_cv_type_int8 = yes; then -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_off_t+set}" = set; then +cat >>confdefs.h <<_ACEOF +#define HAVE_INT8 1 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking for uint8" >&5 +echo $ECHO_N "checking for uint8... $ECHO_C" >&6; } +if test "${ac_cv_type_uint8+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef off_t ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; -test_array [0] = 0 +#include +#ifdef HAVE_SUPPORTDEFS_H +#include +#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -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_compile") 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_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef off_t ac__type_sizeof_; +typedef uint8 ac__type_new_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -25640,39 +25622,50 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break + ac_cv_type_uint8=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_cv_type_uint8=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint8" >&5 +echo "${ECHO_T}$ac_cv_type_uint8" >&6; } +if test $ac_cv_type_uint8 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT8 1 +_ACEOF + - cat >conftest.$ac_ext <<_ACEOF +fi +{ echo "$as_me:$LINENO: checking for int64" >&5 +echo $ECHO_N "checking for int64... $ECHO_C" >&6; } +if test "${ac_cv_type_int64+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. */ -$ac_includes_default - typedef off_t ac__type_sizeof_; +#include +#ifdef HAVE_SUPPORTDEFS_H +#include +#endif + +typedef int64 ac__type_new_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -25694,22 +25687,50 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_int64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_int64=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_int64" >&5 +echo "${ECHO_T}$ac_cv_type_int64" >&6; } +if test $ac_cv_type_int64 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT64 1 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking for uint64" >&5 +echo $ECHO_N "checking for uint64... $ECHO_C" >&6; } +if test "${ac_cv_type_uint64+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. */ -$ac_includes_default - typedef off_t ac__type_sizeof_; +#include +#ifdef HAVE_SUPPORTDEFS_H +#include +#endif + +typedef uint64 ac__type_new_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -25731,49 +25752,51 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break + ac_cv_type_uint64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_cv_type_uint64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64" >&5 +echo "${ECHO_T}$ac_cv_type_uint64" >&6; } +if test $ac_cv_type_uint64 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT64 1 +_ACEOF + -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + +# We also check for sig_atomic_t, which *should* be defined per ANSI +# C, but is missing on some old platforms. +{ echo "$as_me:$LINENO: checking for sig_atomic_t" >&5 +echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6; } +if test "${ac_cv_type_sig_atomic_t+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. */ -$ac_includes_default - typedef off_t ac__type_sizeof_; +#include + +typedef sig_atomic_t ac__type_new_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -25795,28 +25818,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid + ac_cv_type_sig_atomic_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` + ac_cv_type_sig_atomic_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_off_t=$ac_lo;; -'') if test "$ac_cv_type_off_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_off_t=0 - fi ;; -esac +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 +echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6; } +if test $ac_cv_type_sig_atomic_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIG_ATOMIC_T 1 +_ACEOF + + +fi + + + +if test "$PORTNAME" != "win32" +then +{ echo "$as_me:$LINENO: checking for POSIX signal interface" >&5 +echo $ECHO_N "checking for POSIX signal interface... $ECHO_C" >&6; } +if test "${pgac_cv_func_posix_signals+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25824,97 +25854,69 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default - typedef off_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } -#include -#include +#include + int main () { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; - +struct sigaction act, oact; +sigemptyset(&act.sa_mask); +act.sa_flags = SA_RESTART; +sigaction(0, &act, &oact); ; return 0; } _ACEOF -rm -f conftest$ac_exeext +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>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (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_try") 2>&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); }; }; then - ac_cv_sizeof_off_t=`cat conftest.val` + (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 + pgac_cv_func_posix_signals=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -( exit $ac_status ) -if test "$ac_cv_type_off_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (off_t) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (off_t) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_off_t=0 - fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val + pgac_cv_func_posix_signals=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } - +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $pgac_cv_func_posix_signals" >&5 +echo "${ECHO_T}$pgac_cv_func_posix_signals" >&6; } +if test x"$pgac_cv_func_posix_signals" = xyes ; then -cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +cat >>confdefs.h <<\_ACEOF +#define HAVE_POSIX_SIGNALS _ACEOF +fi +HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals - -# If we don't have largefile support, can't handle segsize >= 2GB. -if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then - { { echo "$as_me:$LINENO: error: Large file support is not enabled. Segment size cannot be larger than 1GB." >&5 -echo "$as_me: error: Large file support is not enabled. Segment size cannot be larger than 1GB." >&2;} +if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then + { { echo "$as_me:$LINENO: error: +Thread-safety requires POSIX signals, which are not supported by this +operating system." >&5 +echo "$as_me: error: +Thread-safety requires POSIX signals, which are not supported by this +operating system." >&2;} { (exit 1); exit 1; }; } fi +fi # SunOS doesn't handle negative byte comparisons properly with +/- return { echo "$as_me:$LINENO: checking for working memcmp" >&5 @@ -28200,8 +28202,8 @@ python_libspec!$python_libspec$ac_delim python_additional_libs!$python_additional_libs$ac_delim ZIC!$ZIC$ac_delim OSSP_UUID_LIBS!$OSSP_UUID_LIBS$ac_delim -HAVE_IPV6!$HAVE_IPV6$ac_delim LIBOBJS!$LIBOBJS$ac_delim +HAVE_IPV6!$HAVE_IPV6$ac_delim acx_pthread_config!$acx_pthread_config$ac_delim PTHREAD_CC!$PTHREAD_CC$ac_delim PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim diff --git a/configure.in b/configure.in index f27ceb44bd..29a96d061f 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $PostgreSQL: pgsql/configure.in,v 1.602.2.3 2010/01/07 00:25:17 tgl Exp $ +dnl $PostgreSQL: pgsql/configure.in,v 1.602.2.4 2010/01/16 19:50:38 tgl Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -1132,6 +1132,20 @@ AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) fi +# Check largefile support. You might think this is a system service not a +# compiler characteristic, but you'd be wrong. We must check this before +# probing existence of related functions such as fseeko, since the largefile +# defines can affect what is generated for that. +AC_SYS_LARGEFILE + +# Check for largefile support (must be after AC_SYS_LARGEFILE) +AC_CHECK_SIZEOF([off_t]) + +# If we don't have largefile support, can't handle segsize >= 2GB. +if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then + AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.]) +fi + ## ## Functions, global variables @@ -1143,6 +1157,17 @@ PGAC_FUNC_GETTIMEOFDAY_1ARG AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs]) +AC_REPLACE_FUNCS(fseeko) +case $host_os in + # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos + # Mingw uses macros to access Win32 API calls + bsdi*|netbsd*|mingw*) + AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.]) + ac_cv_func_fseeko=yes;; + *) + AC_FUNC_FSEEKO;; +esac + # posix_fadvise() is a no-op on Solaris, so don't incur function overhead # by calling it, 2009-04-02 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/gen/posix_fadvise.c @@ -1350,17 +1375,6 @@ AC_CHECK_FUNCS(atexit, [], [AC_CHECK_FUNCS(on_exit, [], [AC_MSG_ERROR([neither atexit() nor on_exit() found])])]) -AC_REPLACE_FUNCS(fseeko) -case $host_os in - # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos - # Mingw uses macros to access Win32 API calls - bsdi*|netbsd*|mingw*) - AC_DEFINE(HAVE_FSEEKO, 1, [Define to 1 because replacement version used.]) - ac_cv_func_fseeko=yes;; - *) - AC_FUNC_FSEEKO;; -esac - # # Pthreads @@ -1641,18 +1655,6 @@ operating system.]) fi fi -if test $ac_cv_func_fseeko = yes; then -AC_SYS_LARGEFILE -fi - -# Check for largefile support (must be after AC_SYS_LARGEFILE) -AC_CHECK_SIZEOF([off_t]) - -# If we don't have largefile support, can't handle segsize >= 2GB. -if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then - AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.]) -fi - # SunOS doesn't handle negative byte comparisons properly with +/- return AC_FUNC_MEMCMP