Add first cut of ctime_r return type test.

This commit is contained in:
Kurt Zeilenga 1999-03-03 21:32:22 +00:00
parent b2e0e58a22
commit 8895f5d071
3 changed files with 68 additions and 21 deletions

View File

@ -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 <time.h>],
[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,

74
configure vendored
View File

@ -9548,18 +9548,52 @@ EOF
fi
echo $ac_n "checking return type of ctime_r""... $ac_c" 1>&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
ol_cv_func_ctime_r=0
cat > conftest.$ac_ext <<EOF
#line 9558 "configure"
#include "confdefs.h"
#include <time.h>
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 <<EOF
#define CTIME_R_RETURNS_INT 1
EOF
fi
else
ol_cv_func_ctime_r_nargs=0
fi
if test "$ac_cv_func_gethostbyname_r" = yes ; then
echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&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 <<EOF
#line 9563 "configure"
#line 9597 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -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 <<EOF
#line 9589 "configure"
#line 9623 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -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 <<EOF
#line 9637 "configure"
#line 9671 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -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 <<EOF
#line 9666 "configure"
#line 9700 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -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 <<EOF
#line 9739 "configure"
#line 9773 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -9758,7 +9792,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:9762: \"$ac_link\") 1>&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 <<EOF
#line 9798 "configure"
#line 9832 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -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 <<EOF
#line 9835 "configure"
#line 9869 "configure"
#include "confdefs.h"
#include <errno.h>
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

View File

@ -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