]> git.sur5r.net Git - openldap/blobdiff - configure.in
Allow using real db1 on glibc 2.1 instead of the db1 compatiblity in db2.
[openldap] / configure.in
index 7926eadd6bad664df1383fc5ba28c4f1ee6ef38e..ad02027c7bba6771c139e7940ab2d09fd5e85e71 100644 (file)
@@ -7,14 +7,18 @@ dnl license is available at http://www.OpenLDAP.org/license.html or
 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
 
@@ -77,7 +81,7 @@ OL_ARG_ENABLE(rlookups,[    --enable-rlookups enable reverse lookups], auto)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])
 
@@ -175,6 +179,10 @@ else
                $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])
@@ -246,6 +254,11 @@ AC_AIX
 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
@@ -293,6 +306,7 @@ AC_CHECK_LIB(V3, sigset)
 # 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
@@ -356,7 +370,7 @@ des_debug = 1;
                                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
@@ -426,6 +440,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                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)
@@ -529,6 +544,26 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                        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"
@@ -1007,6 +1042,7 @@ if test $ol_link_threads != no ; then
        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.
@@ -1112,6 +1148,18 @@ if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
        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
@@ -1143,13 +1191,19 @@ if test $ol_enable_wrappers != no ; 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
@@ -1158,6 +1212,7 @@ if test $ol_enable_wrappers != no ; then
 
                AC_MSG_WARN(disabling wrappers support)
                ol_enable_wrappers=no
+               WRAP_LIBS=""
        fi
 fi
 
@@ -1253,6 +1308,7 @@ AC_CHECK_HEADERS( \
        limits.h                \
        malloc.h                \
        memory.h                \
+       netinet/tcp.h   \
        regex.h                 \
        psap.h                  \
        pwd.h                   \
@@ -1268,6 +1324,7 @@ AC_CHECK_HEADERS( \
        sys/ioctl.h             \
        sys/param.h             \
        sys/resource.h  \
+       sys/select.h    \
        sys/socket.h    \
        sys/syslog.h    \
        sys/time.h              \
@@ -1317,6 +1374,7 @@ fi
 
 AC_CHECK_FUNCS(                \
        bcopy                   \
+       closesocket             \
        flock                   \
        getdtablesize   \
        gethostname             \
@@ -1436,7 +1494,7 @@ AC_SUBST(SLURPD_LIBS)
 AC_SUBST(LDBM_LIBS)
 AC_SUBST(LTHREAD_LIBS)
 AC_SUBST(LUTIL_LIBS)
-
+AC_SUBST(WRAP_LIBS)
 AC_SUBST(KRB_LIBS)
 AC_SUBST(TERMCAP_LIBS)