Index: configure =================================================================== RCS file: /projects/cvsroot/pgsql-server/configure,v retrieving revision 1.237 diff -c -r1.237 configure *** configure 2003/01/07 06:37:49 1.237 --- configure 2003/01/09 13:59:13 *************** *** 10675,10680 **** --- 10675,11333 ---- + echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 + echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 + if test "${ac_cv_have_decl_strerror_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + #ifndef strerror_r + char *p = (char *) strerror_r; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_strerror_r=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_have_decl_strerror_r=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 + echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 + if test $ac_cv_have_decl_strerror_r = yes; then + + cat >>confdefs.h <<_ACEOF + #define HAVE_DECL_STRERROR_R 1 + _ACEOF + + + else + cat >>confdefs.h <<_ACEOF + #define HAVE_DECL_STRERROR_R 0 + _ACEOF + + + fi + + + + for ac_func in strerror_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 eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func (); + char (*f) (); + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* 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 + #else + f = $ac_func; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_var=no" + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&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 + + echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 + echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 + if test "${ac_cv_func_strerror_r_char_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then + : + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + extern char *strerror_r (); + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + exit (!isalpha (x)); + ; + return 0; + } + _ACEOF + rm -f conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strerror_r_char_p=yes + else + echo "$as_me: program exited with status $ac_status" >&5 + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + + fi + echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 + echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 + if test $ac_cv_func_strerror_r_char_p = yes; then + + cat >>confdefs.h <<\_ACEOF + #define STRERROR_R_CHAR_P 1 + _ACEOF + + fi + + + + for ac_func in crypt_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 eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func (); + char (*f) (); + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* 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 + #else + f = $ac_func; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_var=no" + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&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 + + + if test "$ac_cv_header_pwd_h" = "yes"; then + echo "$as_me:$LINENO: checking for posix getpwuid_r" >&5 + echo $ECHO_N "checking for posix getpwuid_r... $ECHO_C" >&6 + if test "${ac_cv_func_posix_getpwuid_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5 + echo "$as_me: error: cannot run test program while cross compiling" >&2;} + { (exit 1); exit 1; }; } + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #define _THREAD_SAFE + #define _REENTRANT + #define _POSIX_PTHREAD_SEMANTICS + #include + #include + int main () { + char buffer[10000]; + struct passwd pwd, *pwptr = &pwd; + int error; + errno = 0; + error = getpwuid_r (0, &pwd, buffer, + sizeof (buffer), &pwptr); + return (error < 0 && errno == ENOSYS) + || error == ENOSYS; + } + _ACEOF + rm -f conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_posix_getpwuid_r=yes + else + echo "$as_me: program exited with status $ac_status" >&5 + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ( exit $ac_status ) + ac_cv_func_posix_getpwuid_r=no + fi + rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_func_posix_getpwuid_r" >&5 + echo "${ECHO_T}$ac_cv_func_posix_getpwuid_r" >&6 + if test "$ac_cv_func_posix_getpwuid_r" = yes; then + + cat >>confdefs.h <<\_ACEOF + #define HAVE_POSIX_GETPWUID_R 1 + _ACEOF + + else + echo "$as_me:$LINENO: checking for nonposix getpwuid_r" >&5 + echo $ECHO_N "checking for nonposix getpwuid_r... $ECHO_C" >&6 + if test "${ac_cv_func_nonposix_getpwuid_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + char buffer[10000]; + struct passwd pwd; + getpwuid_r (0, &pwd, buffer, + sizeof (buffer)); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_nonposix_getpwuid_r=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_func_nonposix_getpwuid_r=no + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_func_nonposix_getpwuid_r" >&5 + echo "${ECHO_T}$ac_cv_func_nonposix_getpwuid_r" >&6 + if test "$ac_cv_func_nonposix_getpwuid_r" = yes; then + + cat >>confdefs.h <<\_ACEOF + #define HAVE_NONPOSIX_GETPWUID_R 1 + _ACEOF + + fi + fi + fi + + + + + for ac_func in 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 eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func (); + char (*f) (); + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* 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 + #else + f = $ac_func; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_var=no" + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&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 + + if test "$ac_cv_func_gethostbyname_r" = yes ; then + echo "$as_me:$LINENO: checking number of arguments of gethostbyname_r" >&5 + echo $ECHO_N "checking number of arguments of gethostbyname_r... $ECHO_C" >&6 + if test "${ol_cv_func_gethostbyname_r_nargs+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #include + #include + #include + #define BUFSIZE (sizeof(struct hostent)+10) + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + struct hostent hent; char buffer[BUFSIZE]; + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyname_r("localhost", &hent, + buffer, bufsize, &h_errno); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ol_cv_func_gethostbyname_r_nargs5=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ol_cv_func_gethostbyname_r_nargs5=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #include + #include + #include + #define BUFSIZE (sizeof(struct hostent)+10) + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + struct hostent hent;struct hostent *rhent; + char buffer[BUFSIZE]; + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyname_r("localhost", &hent, buffer, bufsize, + &rhent, &h_errno); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ol_cv_func_gethostbyname_r_nargs6=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ol_cv_func_gethostbyname_r_nargs6=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + + if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \ + $ol_cv_func_gethostbyname_r_nargs6 = no ; then + + ol_cv_func_gethostbyname_r_nargs=5 + + elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \ + $ol_cv_func_gethostbyname_r_nargs6 = yes ; then + + ol_cv_func_gethostbyname_r_nargs=6 + + else + ol_cv_func_gethostbyname_r_nargs=0 + fi + + fi + echo "$as_me:$LINENO: result: $ol_cv_func_gethostbyname_r_nargs" >&5 + echo "${ECHO_T}$ol_cv_func_gethostbyname_r_nargs" >&6 + if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then + + cat >>confdefs.h <<_ACEOF + #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs + _ACEOF + + fi + + else + ol_cv_func_gethostbyname_r_nargs=0 + fi + # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos # We override the previous test that said fseeko/ftello didn't exist # OS tests are also done in include/c.h and port/fseeko.c Index: configure.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/configure.in,v retrieving revision 1.230 diff -c -r1.230 configure.in *** configure.in 2003/01/07 06:43:20 1.230 --- configure.in 2003/01/09 13:59:13 *************** *** 846,851 **** --- 846,956 ---- AC_REPLACE_FUNCS([fseeko gethostname getopt_long getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul]) + AC_FUNC_STRERROR_R + + AC_CHECK_FUNCS(crypt_r) + + if test "$ac_cv_header_pwd_h" = "yes"; then + AC_CACHE_CHECK([for posix getpwuid_r], + ac_cv_func_posix_getpwuid_r, + [AC_TRY_RUN([ + #define _THREAD_SAFE + #define _REENTRANT + #define _POSIX_PTHREAD_SEMANTICS + #include + #include + int main () { + char buffer[10000]; + struct passwd pwd, *pwptr = &pwd; + int error; + errno = 0; + error = getpwuid_r (0, &pwd, buffer, + sizeof (buffer), &pwptr); + return (error < 0 && errno == ENOSYS) + || error == ENOSYS; + } ], + [ac_cv_func_posix_getpwuid_r=yes], + [ac_cv_func_posix_getpwuid_r=no])]) + if test "$ac_cv_func_posix_getpwuid_r" = yes; then + AC_DEFINE(HAVE_POSIX_GETPWUID_R,1, + [Have POSIX function getpwuid_r]) + else + AC_CACHE_CHECK([for nonposix getpwuid_r], + ac_cv_func_nonposix_getpwuid_r, + [AC_TRY_LINK([#include ], + [char buffer[10000]; + struct passwd pwd; + getpwuid_r (0, &pwd, buffer, + sizeof (buffer));], + [ac_cv_func_nonposix_getpwuid_r=yes], + [ac_cv_func_nonposix_getpwuid_r=no])]) + if test "$ac_cv_func_nonposix_getpwuid_r" = yes; then + AC_DEFINE(HAVE_NONPOSIX_GETPWUID_R,1, + [Have non-POSIX function getpwuid_r]) + fi + fi + fi + + + dnl ==================================================================== + dnl check no of arguments for gethostbyname_r + AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS, + [AC_CACHE_CHECK(number of arguments of gethostbyname_r, + ol_cv_func_gethostbyname_r_nargs, + [AC_TRY_COMPILE([#include + #include + #include + #include + #define BUFSIZE (sizeof(struct hostent)+10)], + [struct hostent hent; char buffer[BUFSIZE]; + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyname_r("localhost", &hent, + buffer, bufsize, &h_errno);], + ol_cv_func_gethostbyname_r_nargs5=yes, + ol_cv_func_gethostbyname_r_nargs5=no) + + AC_TRY_COMPILE([#include + #include + #include + #include + #define BUFSIZE (sizeof(struct hostent)+10)], + [struct hostent hent;struct hostent *rhent; + char buffer[BUFSIZE]; + int bufsize=BUFSIZE;int h_errno; + (void)gethostbyname_r("localhost", &hent, buffer, bufsize, + &rhent, &h_errno);], + ol_cv_func_gethostbyname_r_nargs6=yes, + ol_cv_func_gethostbyname_r_nargs6=no) + + if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \ + $ol_cv_func_gethostbyname_r_nargs6 = no ; then + + ol_cv_func_gethostbyname_r_nargs=5 + + elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \ + $ol_cv_func_gethostbyname_r_nargs6 = yes ; then + + ol_cv_func_gethostbyname_r_nargs=6 + + else + ol_cv_func_gethostbyname_r_nargs=0 + fi + ]) + if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then + AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS, + $ol_cv_func_gethostbyname_r_nargs, + [set to the number of arguments gethostbyname_r() expects]) + fi + ])dnl + dnl + + AC_CHECK_FUNCS(gethostbyname_r) + if test "$ac_cv_func_gethostbyname_r" = yes ; then + OL_FUNC_GETHOSTBYNAME_R_NARGS + else + ol_cv_func_gethostbyname_r_nargs=0 + fi + # BSD/OS & NetBSD use a custom fseeko/ftello built on fsetpos/fgetpos # We override the previous test that said fseeko/ftello didn't exist # OS tests are also done in include/c.h and port/fseeko.c Index: src/include/pg_config.h.in =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/pg_config.h.in,v retrieving revision 1.37 diff -c -r1.37 pg_config.h.in *** src/include/pg_config.h.in 2003/01/06 06:07:20 1.37 --- src/include/pg_config.h.in 2003/01/09 13:59:14 *************** *** 426,431 **** --- 426,452 ---- /* Set to 1 if you have strerror() */ #undef HAVE_STRERROR + /* Set to 1 if you have strerror_r() */ + #undef HAVE_STRERROR_R + + /* Set to 1 if strerror_r() returns 'char *' */ + #undef STRERROR_R_CHAR_P + + /* Set to 1 if you have crypt_r() */ + #undef HAVE_CRYPT_R + + /* Set to 1 if you have POSIX getpwuid_r() */ + #undef HAVE_POSIX_GETPWUID_R + + /* Set to 1 if you have non-POSIX getpwuid_r(), returning 'struct passwd*' */ + #undef HAVE_NONPOSIX_GETPWUID_R + + /* Set to 1 if you have gethostbyname_r() */ + #undef HAVE_GETHOSTBYNAME_R + + /* Set to the number of paramters gethostbyname_r() takes */ + #undef GETHOSTBYNAME_R_NARGS + /* Set to 1 if you have isinf() */ #undef HAVE_ISINF