X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=configure.in;h=90713655c1fd858327dc2488c0dcae3da75ea4ae;hb=6dcb8b5c04335140226012892cb0ad0bb0cb887b;hp=61876214d785dfe0a9e28fb49e579576fe89a58c;hpb=c3962c1620d49b3cdf5984703c1d68ce1f8a833b;p=openldap
diff --git a/configure.in b/configure.in
index 61876214d7..90713655c1 100644
--- a/configure.in
+++ b/configure.in
@@ -39,29 +39,14 @@ echo " Restrictions apply, see COPYRIGHT and LICENSE files."
])dnl
dnl ----------------------------------------------------------------
dnl OpenLDAP Autoconf Macros
-dnl $OpenLDAP$
-dnl This work is part of OpenLDAP Software .
-dnl
-dnl Copyright 1998-2005 The OpenLDAP Foundation.
-dnl All rights reserved.
-dnl
-dnl Redistribution and use in source and binary forms, with or without
-dnl modification, are permitted only as authorized by the OpenLDAP
-dnl Public License.
-dnl
-dnl A copy of this license is available in the file LICENSE in the
-dnl top-level directory of the distribution or, alternatively, at
-dnl .
builtin(include, build/openldap.m4)dnl
-
dnl ----------------------------------------------------------------
dnl Disable config.cache!
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
dnl ================================================================
dnl Configure.in for OpenLDAP
-AC_INIT
-AC_CONFIG_SRCDIR([build/version.sh])dnl
+AC_INIT(build/version.sh)dnl
# set unset (borrowed from autoconf 2.49c)
if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
@@ -100,7 +85,7 @@ echo "Configuring ${TB}${OL_STRING}${TN} ${OPENLDAP_CVS}..."
dnl Determine host platform
dnl we try not to use this for much
-AC_CANONICAL_TARGET([])
+AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([$OL_PACKAGE],[$OL_VERSION], [no defines])dnl
AC_SUBST(PACKAGE)dnl
@@ -125,7 +110,7 @@ AC_SUBST(OPENLDAP_RELEASE_DATE)dnl
dnl We use autoconf features new to 2.13. Later versions like won't work.
dnl aclocal.m4 should be built using aclocal from automake 1.4
dnl libtool 1.4.3 should be installed.
-AC_PREREQ(2.59)dnl Required Autoconf version
+AC_PREREQ(2.13)dnl Required Autoconf version
AC_CONFIG_HEADER(include/portable.h include/ldap_features.h include/lber_types.h)dnl
@@ -676,18 +661,8 @@ dnl AC_MINIX
dnl ----------------------------------------------------------------
dnl Checks for system services
-AC_CANONICAL_HOST()
-AC_DIAGNOSE([obsolete],[AC_CYGWIN is obsolete: use AC_CANONICAL_HOST and $host_os])case $host_os in
- *cygwin* ) CYGWIN=yes;;
- * ) CYGWIN=no;;
-esac
-
-AC_CANONICAL_HOST()
-AC_DIAGNOSE([obsolete],[AC_MINGW32 is obsolete: use AC_CANONICAL_HOST and $host_os])case $host_os in
- *mingw32* ) MINGW32=yes;;
- * ) MINGW32=no;;
-esac
-
+AC_CYGWIN
+AC_MINGW32
AC_EXEEXT
AC_OBJEXT
@@ -699,14 +674,7 @@ AC_CHECK_LIB(be, be_app, [LIBS="$LIBS -lbe -lroot -lnet"], :, [-lroot -lnet])
dnl ----------------------------------------------------------------
dnl OpenLDAP requires STDC features
-AC_PROG_CC()
-AC_DIAGNOSE([obsolete],[AM_PROG_CC_STDC:
- your code should no longer depend upon `am_cv_prog_cc_stdc', but upon
- `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when
- you adjust the code. You can also remove the above call to
- AC_PROG_CC if you already called it elsewhere.])
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-
+AM_PROG_CC_STDC
if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
AC_MSG_ERROR([OpenLDAP requires compiler to support STDC constructs.])
fi
@@ -859,13 +827,15 @@ AC_CACHE_CHECK([for winsock], [ol_cv_winsock],
save_LIBS="$LIBS"
for curlib in ws2_32 wsock32; do
LIBS="$LIBS -l$curlib"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include
- ]], [[
+ AC_TRY_LINK([#include
+ ],
+ [
socket(0,0,0);
select(0,NULL,NULL,NULL,NULL);
closesocket(0);
gethostname(NULL,0);
- ]])],[ol_cv_winsock=yes],[ol_cv_winsock=no])
+ ],
+ ol_cv_winsock=yes, ol_cv_winsock=no)
if test $ol_cv_winsock = yes; then
AC_DEFINE(HAVE_WINSOCK, 1, [define if you have winsock])
@@ -920,12 +890,14 @@ dnl ----------------------------------------------------------------
AC_CHECK_HEADERS( sys/epoll.h )
if test "${ac_cv_header_sys_epoll_h}" = yes; then
AC_MSG_CHECKING(for epoll system call)
-AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(int argc, char *argv)
+AC_TRY_RUN(
+int main(int argc, char *argv[])
{
int epfd = epoll_create(256);
exit (epfd == -1 ? 1 : 0);
-}]])],[AC_MSG_RESULT(yes)
-AC_DEFINE(HAVE_EPOLL,1, [define if your system supports epoll])],[AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
+}, [AC_MSG_RESULT(yes)
+AC_DEFINE(HAVE_EPOLL,1, [define if your system supports epoll])],
+AC_MSG_RESULT(no),AC_MSG_RESULT(no))
fi
dnl ----------------------------------------------------------------
@@ -970,13 +942,15 @@ if test $have_uuid = no ; then
AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
save_LIBS="$LIBS"
LIBS="$LIBS -lrpcrt4"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
int __stdcall UuidCreate(void *);
int __stdcall UuidToStringA(void *,void **);
- ]], [[
+ ],
+ [
UuidCreate(0);
UuidToStringA(0,0);
- ]])],[need_rpcrt=yes],[need_rpcrt=no])
+ ],
+ need_rpcrt=yes, need_rpcrt=no)
if test $need_rpcrt = yes; then
SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
fi
@@ -1033,12 +1007,13 @@ elif test $ol_enable_ipv6 != no ; then
AC_CACHE_CHECK([struct sockaddr_storage],ol_cv_struct_sockaddr_storage,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_COMPILE([
#include
#include
-]], [[
+],[
struct sockaddr_storage ss;
-]])],[ol_cv_struct_sockaddr_storage=yes],[ol_cv_struct_sockaddr_storage=no])])
+], [ol_cv_struct_sockaddr_storage=yes],
+ [ol_cv_struct_sockaddr_storage=no])])
if test $ol_cv_inet6_addrstrlen = yes \
-a $ol_cv_struct_sockaddr_storage = yes ; then
@@ -1165,13 +1140,13 @@ if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
dnl save the flags
save_LIBS="$LIBS"
LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
#include
#include
extern int des_debug;
-]], [[
+],[
des_debug = 1;
-]])],[ol_cv_var_des_debug=yes],[ol_cv_var_des_debug=no])
+], ol_cv_var_des_debug=yes, ol_cv_var_des_debug=no)
dnl restore the LIBS
LIBS="$save_LIBS"
])
@@ -1284,7 +1259,7 @@ if test $ol_with_tls != no ; then
fi
else
- AC_MSG_WARN([TLS data protection not supported!])
+ AC_WARN([TLS data protection not supported!])
fi
WITH_TLS=no
@@ -1293,18 +1268,18 @@ if test $ol_link_tls = yes ; then
WITH_TLS=yes
elif test $ol_with_tls = auto ; then
- AC_MSG_WARN([Could not locate TLS/SSL package])
- AC_MSG_WARN([TLS data protection not supported!])
+ AC_WARN([Could not locate TLS/SSL package])
+ AC_WARN([TLS data protection not supported!])
elif test $ol_with_tls != no ; then
- AC_MSG_ERROR([Could not locate TLS/SSL package])
+ AC_ERROR([Could not locate TLS/SSL package])
fi
dnl ----------------------------------------------------------------
dnl LAN Manger password checking requires DES from OpenSSL
if test $ol_enable_lmpasswd != no; then
if test $ol_link_tls != yes ; then
- AC_MSG_ERROR([LAN Manager passwords require OpenSSL])
+ AC_ERROR([LAN Manager passwords require OpenSSL])
fi
AC_DEFINE(SLAPD_LMHASH, 1, [define to support LAN Manager passwords])
@@ -1394,7 +1369,10 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
dnl pthread_create in $LIBS
AC_CACHE_CHECK([for pthread_create in default libraries],
ol_cv_pthread_create,[
- AC_RUN_IFELSE([AC_LANG_SOURCE([[OL_PTHREAD_TEST_PROGRAM]])],[ol_cv_pthread_create=yes],[ol_cv_pthread_create=no],[_au_changequote([,])AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
+ AC_TRY_RUN(OL_PTHREAD_TEST_PROGRAM,
+ [ol_cv_pthread_create=yes],
+ [ol_cv_pthread_create=no],
+ [AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
[ol_cv_pthread_create=yes],
[ol_cv_pthread_create=no])])])
@@ -1472,12 +1450,15 @@ dnl [ol_cv_pthread_lpthread_lexc])
AC_CACHE_CHECK([for pthread_detach with ],
[ol_cv_func_pthread_detach], [
dnl save the flags
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
#include
#ifndef NULL
#define NULL (void*)0
#endif
-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+],
+ [pthread_detach(NULL);],
+ [ol_cv_func_pthread_detach=yes],
+ [ol_cv_func_pthread_detach=no])
])
if test $ol_cv_func_pthread_detach = no ; then
@@ -1504,7 +1485,10 @@ dnl [ol_cv_pthread_lpthread_lexc])
AC_CACHE_CHECK([if pthread_create() works],
ol_cv_pthread_create_works,[
- AC_RUN_IFELSE([AC_LANG_SOURCE([[OL_PTHREAD_TEST_PROGRAM]])],[ol_cv_pthread_create_works=yes],[ol_cv_pthread_create_works=no],[dnl assume yes
+ AC_TRY_RUN(OL_PTHREAD_TEST_PROGRAM,
+ [ol_cv_pthread_create_works=yes],
+ [ol_cv_pthread_create_works=no],
+ [dnl assume yes
ol_cv_pthread_create_works=yes])])
if test $ol_cv_pthread_create_works = no ; then
@@ -1515,7 +1499,7 @@ dnl [ol_cv_pthread_lpthread_lexc])
if test $ol_with_yielding_select = auto ; then
AC_CACHE_CHECK([if select yields when using pthreads],
ol_cv_pthread_select_yields,[
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ AC_TRY_RUN([
#include
#include
#include
@@ -1588,7 +1572,10 @@ int main(argc, argv)
#endif
exit(2);
-}]])],[ol_cv_pthread_select_yields=no],[ol_cv_pthread_select_yields=yes],[ol_cv_pthread_select_yields=cross])])
+}],
+ [ol_cv_pthread_select_yields=no],
+ [ol_cv_pthread_select_yields=yes],
+ [ol_cv_pthread_select_yields=cross])])
if test $ol_cv_pthread_select_yields = cross ; then
AC_MSG_ERROR([crossing compiling: use --with-yielding_select=yes|no|manual])
@@ -1631,9 +1618,9 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
dnl save the flags
save_LIBS="$LIBS"
LIBS="-all_load $LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[
+ AC_TRY_LINK([#include ],[
cthread_fork((void *)0, (void *)0);
- ]])],[ol_cv_cthread_all_load=yes],[ol_cv_cthread_all_load=no])
+ ], ol_cv_cthread_all_load=yes, ol_cv_cthread_all_load=no)
dnl restore the LIBS
LIBS="$save_LIBS"
])
@@ -1777,14 +1764,18 @@ if test $ol_link_threads != no -a $ol_link_threads != nt ; then
dnl If it does, we must link with thread support.
AC_CACHE_CHECK([for thread specific errno],
[ol_cv_errno_thread_specific], [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[errno = 0;]])],[ol_cv_errno_thread_specific=yes],[ol_cv_errno_thread_specific=no])
+ AC_TRY_LINK([#include ], [errno = 0;],
+ [ol_cv_errno_thread_specific=yes],
+ [ol_cv_errno_thread_specific=no])
])
dnl The h_errno declaration may dependent upon _REENTRANT.
dnl If it does, we must link with thread support.
AC_CACHE_CHECK([for thread specific h_errno],
[ol_cv_h_errno_thread_specific], [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[h_errno = 0;]])],[ol_cv_h_errno_thread_specific=yes],[ol_cv_h_errno_thread_specific=no])
+ AC_TRY_LINK([#include ], [h_errno = 0;],
+ [ol_cv_h_errno_thread_specific=yes],
+ [ol_cv_h_errno_thread_specific=no])
])
if test $ol_cv_errno_thread_specific != yes \
@@ -2008,20 +1999,20 @@ if test $ol_enable_wrappers != no ; then
AC_MSG_CHECKING([for TCP wrappers library])
save_LIBS="$LIBS"
LIBS="$LIBS -lwrap"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_TRY_LINK([
#include
int allow_severity = 0;
int deny_severity = 0;
struct request_info *req;
- ]], [[
+ ],[
hosts_access(req)
- ]])],[AC_MSG_RESULT([-lwrap])
+ ],[AC_MSG_RESULT([-lwrap])
have_wrappers=yes
LIBS="$save_LIBS"],[
dnl try with -lnsl
LIBS="$LIBS -lnsl"
- _au_changequote([,])AC_TRY_LINK([
+ AC_TRY_LINK([
#include
int allow_severity = 0;
int deny_severity = 0;
@@ -2034,7 +2025,8 @@ hosts_access(req)
LIBS="$save_LIBS -lnsl"],[
AC_MSG_RESULT(no)
have_wrappers=no
- LIBS=$save_LIBS])])],[have_wrappers=no])
+ LIBS=$save_LIBS])],[
+ have_wrappers=no])],[have_wrappers=no])
if test $have_wrappers = yes ; then
AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
@@ -2347,7 +2339,9 @@ dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for long long
AC_CACHE_CHECK([long long], ol_cv_type_long_long, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x;]])],[ol_cv_type_long_long=yes],[ol_cv_type_long_long=no])])
+ AC_TRY_COMPILE([], [long long x;],
+ [ol_cv_type_long_long=yes],
+ [ol_cv_type_long_long=no])])
if test $ol_cv_type_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG, 1, [define if you have 'long long'])
fi
@@ -2355,7 +2349,7 @@ fi
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
-AC_CHECK_TYPES([ptrdiff_t])
+AM_TYPE_PTRDIFF_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
@@ -2363,15 +2357,7 @@ AC_CHECK_TYPE(ssize_t, [signed int])
AC_CHECK_TYPE(caddr_t, [char *])
OL_TYPE_SOCKLEN_T
-AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_BLKSIZE:
- your code should no longer depend upon `HAVE_ST_BLKSIZE', but
- `HAVE_STRUCT_STAT_ST_BLKSIZE'. Remove this warning and
- the `AC_DEFINE' when you adjust the code.])
-AC_CHECK_MEMBERS([struct stat.st_blksize],[AC_DEFINE(HAVE_ST_BLKSIZE, 1,
- [Define to 1 if your `struct stat' has
- `st_blksize'. Deprecated, use
- `HAVE_STRUCT_STAT_ST_BLKSIZE' instead.])])
-
+AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UID_T
@@ -2419,9 +2405,9 @@ if test $ac_cv_func_memcmp_working = no ; then
[define if memcmp is not 8-bit clean or is otherwise broken])
fi
-dnl AC_FUNC_MKTIME([]) dnl checks for sys/time.h and unistd.h
+dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
AC_FUNC_STRFTIME
-dnl AC_FUNC_STRTOD([])
+dnl AM_FUNC_STRTOD
OL_FUNC_INET_ATON
@@ -3055,7 +3041,7 @@ dnl ----------------------------------------------------------------
dnl final output
dnl
-AC_CONFIG_FILES([\
+AC_OUTPUT( \
Makefile:build/top.mk:Makefile.in:build/dir.mk \
doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
@@ -3096,8 +3082,7 @@ servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
tests/run \
tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
-])
-AC_CONFIG_COMMANDS([default],[[
+,[
chmod +x tests/run
date > stamp-h
BACKENDSC="servers/slapd/backends.c"
@@ -3153,5 +3138,4 @@ ENDX
fi
echo Please run \"make depend\" to build dependencies
-]],[[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"]])
-AC_OUTPUT
+],[STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS"])