From 8895f5d071639e820a9e27eb66e44c3038caccf9 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 3 Mar 1999 21:32:22 +0000 Subject: [PATCH] Add first cut of ctime_r return type test. --- build/openldap.m4 | 12 ++++++++ configure | 74 ++++++++++++++++++++++++++++++++++------------- configure.in | 3 +- 3 files changed, 68 insertions(+), 21 deletions(-) diff --git a/build/openldap.m4 b/build/openldap.m4 index 21171f9abc..eb40345992 100644 --- a/build/openldap.m4 +++ b/build/openldap.m4 @@ -443,6 +443,18 @@ AC_DEFUN(OL_FUNC_CTIME_R_NARGS, AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs) fi ])dnl +dnl -------------------------------------------------------------------- +dnl check return type of ctime_r() +AC_DEFUN(OL_FUNC_CTIME_R_TYPE, + [AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type, + [AC_TRY_COMPILE([#include ], + [int ctime_r();], + ol_cv_func_ctime_r_type="int", ol_cv_func_ctime_r_type="charp") + ]) + if test $ol_cv_func_ctime_r_type = "int" ; then + AC_DEFINE_UNQUOTED(CTIME_R_RETURNS_INT, 1) + fi +])dnl dnl ==================================================================== dnl check no of arguments for gethostbyname_r AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS, diff --git a/configure b/configure index b8a44154b8..e36a8d9f93 100755 --- a/configure +++ b/configure @@ -9544,22 +9544,56 @@ echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6 if test $ol_cv_func_ctime_r_nargs -gt 1 ; then cat >> confdefs.h <&6 +echo "configure:9553: checking return type of ctime_r" >&5 +if eval "test \"`echo '$''{'ol_cv_func_ctime_r_type'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +int ctime_r(); +; return 0; } +EOF +if { (eval echo configure:9565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_func_ctime_r_type="int" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_func_ctime_r_type="charp" +fi +rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_func_ctime_r_type" 1>&6 + if test $ol_cv_func_ctime_r_type = "int" ; then + cat >> confdefs.h <&6 -echo "configure:9558: checking number of arguments of gethostbyname_r" >&5 +echo "configure:9592: checking number of arguments of gethostbyname_r" >&5 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -9573,7 +9607,7 @@ struct hostent hent; char buffer[BUFSIZE]; return 0; ; return 0; } EOF -if { (eval echo configure:9577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_func_gethostbyname_r_nargs=5 else @@ -9585,7 +9619,7 @@ fi rm -f conftest* if test $ol_cv_func_gethostbyname_r_nargs = 0 ; then cat > conftest.$ac_ext < #include @@ -9600,7 +9634,7 @@ struct hostent hent;struct hostent *rhent; return 0; ; return 0; } EOF -if { (eval echo configure:9604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_func_gethostbyname_r_nargs=6 else @@ -9628,12 +9662,12 @@ fi if test "$ac_cv_func_gethostbyaddr_r" = yes ; then echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6 -echo "configure:9632: checking number of arguments of gethostbyaddr_r" >&5 +echo "configure:9666: checking number of arguments of gethostbyaddr_r" >&5 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -9650,7 +9684,7 @@ struct hostent hent; char buffer[BUFSIZE]; return 0; ; return 0; } EOF -if { (eval echo configure:9654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_func_gethostbyaddr_r_nargs=7 else @@ -9662,7 +9696,7 @@ fi rm -f conftest* if test $ol_cv_func_gethostbyaddr_r_nargs = 0 ; then cat > conftest.$ac_ext < #include @@ -9680,7 +9714,7 @@ struct hostent hent; struct hostent *rhent; char buffer[BUFSIZE]; return 0; ; return 0; } EOF -if { (eval echo configure:9684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_func_gethostbyaddr_r_nargs=8 else @@ -9730,12 +9764,12 @@ fi for ac_func in getopt tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9734: checking for $ac_func" >&5 +echo "configure:9768: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9788,13 +9822,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:9792: checking declaration of sys_errlist" >&5 +echo "configure:9826: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -9804,7 +9838,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:9808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -9825,20 +9859,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:9829: checking existence of sys_errlist" >&5 +echo "configure:9863: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:9842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index b275a2437b..eda466144a 100644 --- a/configure.in +++ b/configure.in @@ -1547,8 +1547,9 @@ AC_CHECK_FUNCS( \ if test "$ac_cv_func_ctime_r" = yes ; then OL_FUNC_CTIME_R_NARGS + OL_FUNC_CTIME_R_TYPE else - ol_cv_func_ctime_r=0 + ol_cv_func_ctime_r_nargs=0 fi if test "$ac_cv_func_gethostbyname_r" = yes ; then -- 2.39.5