Relocate reentrant checks to before thread checks.

Change default to cc instead of gcc (experimental change).
This commit is contained in:
Kurt Zeilenga 1999-03-07 03:18:51 +00:00
parent 9e71e09bac
commit c0c673485b
3 changed files with 636 additions and 651 deletions

View file

@ -366,7 +366,7 @@ if test $ol_cv_c_upper_lower != no ; then
AC_DEFINE(C_UPPER_LOWER,1, [define if toupper() requires islower()]) AC_DEFINE(C_UPPER_LOWER,1, [define if toupper() requires islower()])
fi fi
]) ])
dnl
dnl ==================================================================== dnl ====================================================================
dnl Check for declaration of sys_errlist in one of stdio.h and errno.h. dnl Check for declaration of sys_errlist in one of stdio.h and errno.h.
dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration. dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
@ -383,7 +383,6 @@ AC_CACHE_VAL(ol_cv_dcl_sys_errlist,[
[ol_cv_dcl_sys_errlist=yes], [ol_cv_dcl_sys_errlist=yes],
[ol_cv_dcl_sys_errlist=no])]) [ol_cv_dcl_sys_errlist=no])])
AC_MSG_RESULT($ol_cv_dcl_sys_errlist) AC_MSG_RESULT($ol_cv_dcl_sys_errlist)
# It's possible (for near-UNIX clones) that sys_errlist doesn't exist # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
if test $ol_cv_dcl_sys_errlist = no ; then if test $ol_cv_dcl_sys_errlist = no ; then
AC_DEFINE(DECL_SYS_ERRLIST,1, AC_DEFINE(DECL_SYS_ERRLIST,1,
@ -414,7 +413,7 @@ AC_DEFUN(OL_C_VOLATILE,
AC_DEFINE(volatile,) AC_DEFINE(volatile,)
fi fi
])dnl ])dnl
dnl
dnl ==================================================================== dnl ====================================================================
dnl Define sig_atomic_t if not defined in signal.h dnl Define sig_atomic_t if not defined in signal.h
AC_DEFUN(OL_TYPE_SIG_ATOMIC_T, AC_DEFUN(OL_TYPE_SIG_ATOMIC_T,
@ -425,26 +424,24 @@ AC_DEFUN(OL_TYPE_SIG_ATOMIC_T,
AC_DEFINE(sig_atomic_t, int) AC_DEFINE(sig_atomic_t, int)
fi fi
])dnl ])dnl
dnl
dnl ==================================================================== dnl ====================================================================
dnl check no of arguments for ctime_r dnl check no of arguments for ctime_r
AC_DEFUN(OL_FUNC_CTIME_R_NARGS, AC_DEFUN(OL_FUNC_CTIME_R_NARGS,
[AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs, [AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
[AC_TRY_COMPILE([#include <time.h>], [AC_TRY_COMPILE([#include <time.h>],
[time_t ti; char *buffer; ctime_r(&ti,buffer,32);], [time_t ti; char *buffer; ctime_r(&ti,buffer,32);],
ol_cv_func_ctime_r_nargs=3, ol_cv_func_ctime_r_nargs=0) ol_cv_func_ctime_r_nargs=3,
if test $ol_cv_func_ctime_r_nargs = 0 ; then [AC_TRY_COMPILE([#include <time.h>],
AC_TRY_COMPILE([#include <time.h>], [time_t ti; char *buffer; ctime_r(&ti,buffer);],
[time_t ti; char *buffer; ol_cv_func_ctime_r_nargs=2,
ctime_r(&ti,buffer);], ol_cv_func_ctime_r_nargs=0)])])
ol_cv_func_ctime_r_nargs=2, ol_cv_func_ctime_r_nargs=0)
fi
])
if test $ol_cv_func_ctime_r_nargs -gt 1 ; then if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs, AC_DEFINE_UNQUOTED(CTIME_R_NARGS, $ol_cv_func_ctime_r_nargs,
[set to the number of arguments ctime_r() expects]) [set to the number of arguments ctime_r() expects])
fi fi
])dnl ])dnl
dnl
dnl -------------------------------------------------------------------- dnl --------------------------------------------------------------------
dnl check return type of ctime_r() dnl check return type of ctime_r()
AC_DEFUN(OL_FUNC_CTIME_R_TYPE, AC_DEFUN(OL_FUNC_CTIME_R_TYPE,
@ -460,7 +457,8 @@ AC_DEFUN(OL_FUNC_CTIME_R_TYPE,
dnl ==================================================================== dnl ====================================================================
dnl check no of arguments for gethostbyname_r dnl check no of arguments for gethostbyname_r
AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS, AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS,
[AC_CACHE_CHECK(number of arguments of gethostbyname_r, ol_cv_func_gethostbyname_r_nargs, [AC_CACHE_CHECK(number of arguments of gethostbyname_r,
ol_cv_func_gethostbyname_r_nargs,
[AC_TRY_COMPILE([#include <sys/types.h> [AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -468,11 +466,11 @@ AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS,
#define BUFSIZE (sizeof(struct hostent)+10)], #define BUFSIZE (sizeof(struct hostent)+10)],
[struct hostent hent; char buffer[BUFSIZE]; [struct hostent hent; char buffer[BUFSIZE];
int bufsize=BUFSIZE;int h_errno; int bufsize=BUFSIZE;int h_errno;
(void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &h_errno); (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
buffer, bufsize, &h_errno);
return 0;], return 0;],
ol_cv_func_gethostbyname_r_nargs=5, ol_cv_func_gethostbyname_r_nargs=0) ol_cv_func_gethostbyname_r_nargs=5,
if test $ol_cv_func_gethostbyname_r_nargs = 0 ; then [AC_TRY_COMPILE([#include <sys/types.h>
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
@ -480,20 +478,22 @@ AC_DEFUN(OL_FUNC_GETHOSTBYNAME_R_NARGS,
[struct hostent hent;struct hostent *rhent; [struct hostent hent;struct hostent *rhent;
char buffer[BUFSIZE]; char buffer[BUFSIZE];
int bufsize=BUFSIZE;int h_errno; int bufsize=BUFSIZE;int h_errno;
(void)gethostbyname_r( "segovia.cs.purdue.edu", &hent, buffer, bufsize, &rhent, &h_errno); (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
&rhent, &h_errno);
return 0;], return 0;],
ol_cv_func_gethostbyname_r_nargs=6, ol_cv_func_gethostbyname_r_nargs=0) ol_cv_func_gethostbyname_r_nargs=6,
fi ol_cv_func_gethostbyname_r_nargs=0)])])
])
if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS, AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_NARGS,
$ol_cv_func_gethostbyname_r_nargs, $ol_cv_func_gethostbyname_r_nargs,
[set to the number of arguments gethostbyname_r() expects]) [set to the number of arguments gethostbyname_r() expects])
fi fi
])dnl ])dnl
dnl
dnl check no of arguments for gethostbyaddr_r dnl check no of arguments for gethostbyaddr_r
AC_DEFUN(OL_FUNC_GETHOSTBYADDR_R_NARGS, AC_DEFUN(OL_FUNC_GETHOSTBYADDR_R_NARGS,
[AC_CACHE_CHECK(number of arguments of gethostbyaddr_r, ol_cv_func_gethostbyaddr_r_nargs, [AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
[ol_cv_func_gethostbyaddr_r_nargs],
[AC_TRY_COMPILE([#include <sys/types.h> [AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
@ -507,14 +507,13 @@ AC_DEFUN(OL_FUNC_GETHOSTBYADDR_R_NARGS,
alen, AF_INET, &hent, buffer, bufsize, &h_errno); alen, AF_INET, &hent, buffer, bufsize, &h_errno);
return 0;], return 0;],
ol_cv_func_gethostbyaddr_r_nargs=7, ol_cv_func_gethostbyaddr_r_nargs=7,
ol_cv_func_gethostbyaddr_r_nargs=0) [AC_TRY_COMPILE([#include <sys/types.h>
if test $ol_cv_func_gethostbyaddr_r_nargs = 0 ; then
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)], #define BUFSIZE (sizeof(struct hostent)+10)],
[struct hostent hent; struct hostent *rhent; char buffer[BUFSIZE]; [struct hostent hent;
struct hostent *rhent; char buffer[BUFSIZE];
struct in_addr add={0x70707070}; struct in_addr add={0x70707070};
size_t alen=sizeof(struct in_addr); size_t alen=sizeof(struct in_addr);
int bufsize=BUFSIZE;int h_errno; int bufsize=BUFSIZE;int h_errno;
@ -523,13 +522,11 @@ AC_DEFUN(OL_FUNC_GETHOSTBYADDR_R_NARGS,
&rhent, &h_errno); &rhent, &h_errno);
return 0;], return 0;],
ol_cv_func_gethostbyaddr_r_nargs=8, ol_cv_func_gethostbyaddr_r_nargs=8,
ol_cv_func_gethostbyaddr_r_nargs=0) ol_cv_func_gethostbyaddr_r_nargs=0)])])
fi
])
if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS, AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_NARGS,
$ol_cv_func_gethostbyaddr_r_nargs, $ol_cv_func_gethostbyaddr_r_nargs,
[set to the number of arguments gethostbyaddr_r() expects]) [set to the number of arguments gethostbyaddr_r() expects])
fi fi
])dnl ])dnl
dnl

1022
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -269,13 +269,10 @@ dnl Checks for programs
AC_PROG_INSTALL AC_PROG_INSTALL
dnl
dnl We probably should use the vendor 'cc' by default
dnl
dnl The default compiler is cc (NOT gcc) dnl The default compiler is cc (NOT gcc)
dnl CC=${CC-"cc"} CC=${CC-"cc"}
dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets. dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
dnl CFLAGS=${CFLAGS-""} CFLAGS=${CFLAGS-""}
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
dnl AC_PROG_MAKE_SET dnl AC_PROG_MAKE_SET
@ -505,21 +502,18 @@ if test $ol_link_tls = yes ; then
AC_DEFINE(HAVE_TLS, 1, [define if you have TLS]) AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
fi fi
dnl
dnl Tests for reentrant functions necessary to build a dnl Tests for reentrant functions necessary to build a
dnl thread_safe -lldap. dnl thread_safe -lldap.
dnl
AC_CHECK_FUNCS( \ AC_CHECK_FUNCS( \
ctime_r \ ctime_r \
gethostbyaddr_r \ gethostbyname_r gethostbyaddr_r \
gethostbyname_r \
) )
if test "$ac_cv_func_ctime_r" = yes ; then if test "$ac_cv_func_ctime_r" = no ; then
ol_cv_func_ctime_r_nargs=0
else
OL_FUNC_CTIME_R_NARGS OL_FUNC_CTIME_R_NARGS
dnl OL_FUNC_CTIME_R_TYPE dnl OL_FUNC_CTIME_R_TYPE
else
ol_cv_func_ctime_r_nargs=0
fi fi
if test "$ac_cv_func_gethostbyname_r" = yes ; then if test "$ac_cv_func_gethostbyname_r" = yes ; then
@ -535,21 +529,19 @@ else
fi fi
if test "$ac_cv_func_ctime_r" = yes \ if test "$ac_cv_func_ctime_r" = yes \
-a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \ -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
-a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \ -a "$ol_cv_func_ctime_r_nargs" -le 3 \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
-a "$ac_cv_func_gethostbyaddr_r" = yes \
-a "$ac_cv_func_gethostbyname_r" = yes \ -a "$ac_cv_func_gethostbyname_r" = yes \
-a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
-a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
-a "$ac_cv_func_gethostbyaddr_r" = yes \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
-a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
; then ; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1) AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_REENTRANT,1)
fi fi
if test $ol_link_threads != no ; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE, 1)
fi
ol_link_threads=no ol_link_threads=no
if test $ol_with_threads = auto -o $ol_with_threads = yes \ if test $ol_with_threads = auto -o $ol_with_threads = yes \
-o $ol_with_threads = posix ; then -o $ol_with_threads = posix ; then
@ -1253,8 +1245,6 @@ dnl CPPFLAGS="$save_CPPFLAGS"
dnl LIBS="$save_LIBS" dnl LIBS="$save_LIBS"
fi fi
dnl ----------------------------------------------------------------
if test $ol_link_threads = no ; then if test $ol_link_threads = no ; then
if test $ol_with_threads = yes ; then if test $ol_with_threads = yes ; then
AC_MSG_ERROR([no suitable thread support]) AC_MSG_ERROR([no suitable thread support])
@ -1270,6 +1260,12 @@ if test $ol_link_threads = no ; then
LTHREAD_LIBS="" LTHREAD_LIBS=""
fi fi
if test $ol_link_threads != no ; then
AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE,1)
fi
dnl ----------------------------------------------------------------
ol_link_ldbm=no ol_link_ldbm=no
if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
OL_BERKELEY_DB2 OL_BERKELEY_DB2