dnl in file LICENSE in the top-level directory of the distribution.
dnl
+dnl Disable config.cache!
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+
dnl Configure.in for OpenLDAP
AC_INIT(include/ldap.h)dnl
AC_CONFIG_AUX_DIR(build)dnl
AM_INIT_AUTOMAKE(openldap,[1.2], [no ac_define])dnl
-dnl We use autoconf features new to 2.13.
+dnl We use autoconf features new to 2.13.1
dnl aclocal.m4 should be built using aclocal from automake 1.4
-AC_PREREQ(2.13)dnl Required Autoconf version
+AC_PREREQ(2.13.1)dnl Required Autoconf version
AC_CONFIG_HEADER(include/portable.h)dnl
dnl SLAPD Backend options
OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend], yes)dnl
OL_ARG_WITH(ldbm_api,[ --with-ldbm-api use LDBM API], auto,
- [auto db2 db gdbm ndbm manual])
+ [auto db2 db mdbm gdbm ndbm manual])
OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto,
[auto btree hash])
$ol_with_ldbm_type = btree ; then
AC_MSG_ERROR([GDBM only supports LDBM type hash])
fi
+ if test $ol_with_ldbm_api = mdbm -a \
+ $ol_with_ldbm_type = btree ; then
+ AC_MSG_ERROR([MDBM only supports LDBM type hash])
+ fi
if test $ol_with_ldbm_api = ndbm -a \
$ol_with_ldbm_type = btree ; then
AC_MSG_ERROR([NDBM only supports LDBM type hash])
AC_ISC_POSIX
AC_MINIX
+dnl BeOS requires -lbe -lroot -lnet
+AC_CHECK_LIB(be, be_app,
+ [LIBS="$LIBS -lbe -lroot -lnet"], :,
+ [-lroot -lnet])
+
dnl OpenLDAP requires STDC features
AM_PROG_CC_STDC
if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
# ISODE tests
ol_link_isode=no
if test $ol_enable_ldapd != no ; then
+ AC_MSG_WARN([ldapd support deprecated. Manual intervention required.])
dnl look for ISODE libraries
AC_CHECK_LIB(xtpp, main, [
ol_link_isode=yes
LIBS="$save_LIBS"
])
- if test $ol_cv_var_des_debug= yes ; then
+ if test $ol_cv_var_des_debug = yes ; then
AC_DEFINE(HAVE_DES_DEBUG,1,
[define if you have Kerberos des_debug])
fi
dnl pthread_create() with -pthread (FreeBSD/Digital Unix)
dnl pthread_create() with -pthreads (?)
dnl pthread_create() with -thread (?)
+ dnl pthread_create() with -mt (Solaris)
dnl
dnl Check pthread (final) libraries
dnl pthread_mutex_unlock() in -lpthread -lmach -lexc -lc_r (OSF/1)
fi
fi
+ if test $ol_link_threads = no ; then
+ dnl try -mt
+ AC_CACHE_CHECK([for pthread_create with -mt],
+ [ol_cv_thread_flag], [
+ dnl save the flags
+ save_LIBS="$LIBS"
+ LIBS="-mt $LIBS"
+ AC_TRY_LINK([char pthread_create();],
+ [pthread_create();],
+ [ol_cv_thread_flag=yes], [ol_cv_thread_flag=no])
+ dnl restore the LIBS
+ LIBS="$save_LIBS"
+ ])
+
+ if test $ol_cv_thread_flag = yes ; then
+ LTHREAD_LIBS="$LTHREAD_LIBS -mt"
+ ol_link_threads=posix
+ fi
+ fi
+
if test $ol_link_threads = no ; then
dnl try DEC Threads -lpthread -lmach -lexc -lc_r
save_LIBS="$LIBS"
AC_DEFINE(_THREAD_SAFE,1)
AC_DEFINE(THREADSAFE,1)
AC_DEFINE(_THREADSAFE,1)
+ AC_DEFINE(_SGI_MP_SOURCE,1)
dnl this might cause the errno symbol to be
dnl replaced with a function to get a thread specific errno.
fi
fi
+if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
+ OL_MDBM
+
+ if test $ol_cv_mdbm = yes ; then
+ ol_link_ldbm=mdbm
+ ol_with_ldbm_api=mdbm
+ if test $ol_cv_lib_mdbm != yes ; then
+ LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
+ fi
+ fi
+fi
+
if test $ol_with_ldbm_api = auto ; then
AC_MSG_WARN([skipping automatic checking for NDBM, must be manually enabled.])
elif test $ol_with_ldbm_api = ndbm ; then
if test $ac_cv_header_tcpd_h != yes ; then
have_wrappers=no
else
- AC_CHECK_LIB(wrap, main,
- [have_wrappers=yes], [have_wrappers=no])
+ AC_TRY_COMPILE([
+int allow_severity = 0;
+int deny_severity = 0;
+ ],[hosts_access()],[have_wrappers=yes],[have_wrappers=no])
fi
if test $have_wrappers = yes ; then
AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
- SLAPD_LIBS="$SLAPD_LIBS -lwrap"
+ WRAP_LIBS="-lwrap"
+
+ dnl We add another check for -lnsl since some libwrap's
+ dnl need it, but it isn't always included from above
+ AC_CHECK_LIB(nsl, main)
else
AC_MSG_WARN(could not find -lwrap)
if test $ol_enable_wrappers = yes ; then
AC_MSG_WARN(disabling wrappers support)
ol_enable_wrappers=no
+ WRAP_LIBS=""
fi
fi
limits.h \
malloc.h \
memory.h \
+ netinet/tcp.h \
regex.h \
psap.h \
pwd.h \
sys/ioctl.h \
sys/param.h \
sys/resource.h \
+ sys/select.h \
sys/socket.h \
sys/syslog.h \
sys/time.h \
AC_CHECK_FUNCS( \
bcopy \
+ closesocket \
flock \
getdtablesize \
gethostname \
AC_SUBST(LDBM_LIBS)
AC_SUBST(LTHREAD_LIBS)
AC_SUBST(LUTIL_LIBS)
-
+AC_SUBST(WRAP_LIBS)
AC_SUBST(KRB_LIBS)
AC_SUBST(TERMCAP_LIBS)