]> git.sur5r.net Git - openldap/blobdiff - configure.in
Import op -> slap_op , conn -> slap_conn change from rel eng 1.1.
[openldap] / configure.in
index 0bbb59347c1d6865f0f6a5d3f0dfdc9a12e3efbe..8c240b3b6ff89c36786b1f85df3238b11199efb2 100644 (file)
@@ -10,7 +10,7 @@ dnl
 dnl Configure.in for OpenLDAP
 AC_INIT(include/ldap.h)dnl
 AC_CONFIG_AUX_DIR(build)dnl
-AM_INIT_AUTOMAKE(OpenLDAP,[1.1-beta], [no ac_define])dnl
+AM_INIT_AUTOMAKE(openldap,[1.2], [no ac_define])dnl
 
 dnl Do not use AutoConf 2.12; it produces a configuration script
 dnl that causes an "internal 2K buffer" error on HPUX when run
@@ -270,8 +270,19 @@ dnl
        AC_CHECK_LIB(gen, main)
 ])
 
-dnl Check for resolv
-AC_CHECK_LIB(resolv, res_search)
+dnl Check for resolver routines
+AC_CHECK_FUNCS(res_search)
+if test $ac_cv_func_res_search = "no" ; then 
+       AC_CHECK_LIB(bind, res_search)
+       if test "$ac_cv_lib_bind_res_search" = "yes" ; then
+               AC_DEFINE(HAVE_RES_SEARCH,1)
+       else
+               AC_CHECK_LIB(resolv, res_search)
+               if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
+                       AC_DEFINE(HAVE_RES_SEARCH,1)
+               fi
+       fi
+fi
 
 dnl HP-UX requires -lV3
 AC_CHECK_LIB(V3, sigset)
@@ -445,7 +456,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                if test $ol_link_threads = no ; then
                        dnl try DEC Threads -lpthread -lexc
                        save_LIBS="$LIBS"
-                       AC_CHECK_LIB(pthread, pthread_join, [
+                       AC_CHECK_LIB(pthread, pthread_mutex_lock, [
                                ol_link_threads=posix
                                LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
                                if test $ol_with_yielding_select = auto ; then
@@ -458,7 +469,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                if test $ol_link_threads = no ; then
                        dnl try DEC Threads -lpthreads -lmach -lexc -lc_r
                        save_LIBS="$LIBS"
-                       AC_CHECK_LIB(pthreads, pthread_join, [
+                       AC_CHECK_LIB(pthreads, pthread_mutex_unlock, [
                                ol_link_threads=posix
                                LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
                                if test $ol_with_yielding_select = auto ; then
@@ -495,7 +506,18 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                        LIBS="$save_LIBS"
                fi
 
-               dnl HP-UX 11 check
+               dnl IRIX Pthread check
+               if test $ol_link_threads = no ; then
+                       dnl try IRIX Pthreads -Wl,-woff,85 -lpthreads
+                       save_LIBS="$LIBS"
+                       AC_CHECK_LIB(pthreads, pthread_join, [
+                               ol_link_threads=posix
+                               LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
+                               ],[-Wl,-woff,85])
+                       LIBS="$save_LIBS"
+               fi
+
+               dnl HP-UX 11 Pthread check
                if test $ol_link_threads = no; then
                        save_LIBS="$LIBS"
                        LIBS="$LIBS -lpthread"
@@ -560,11 +582,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no ; then
                                AC_MSG_WARN([could not locate sched_yield() or pthread_yield()])
-                               AC_MSG_ERROR([POSIX Threads are not usable])
                        fi
 
                        dnl Check functions for compatibility
-                       AC_CHECK_FUNCS(pthread_kill)
+                       AC_CHECK_FUNCS(pthread_kill pthread_detach)
+
                        AC_CHECK_FUNCS( \
                                pthread_attr_create pthread_attr_init \
                                pthread_attr_destroy pthread_attr_delete \
@@ -766,6 +788,22 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                        if test $ol_with_yielding_select = auto ; then
                                ol_with_yielding_select=yes
                        fi
+
+                       AC_CACHE_CHECK([for misplaced posix thread in headers],
+                               [ol_cv_header_misplaced_pthreads], [
+                               AC_TRY_COMPILE([
+#include <sys/types.h>
+typedef double pthread_t;
+                               ], [
+                               pthread_t thread = 0.0;
+                               ],
+                               [ol_cv_header_misplaced_pthreads=no],
+                               [ol_cv_header_misplaced_pthreads=yes])
+                       ])
+
+                       if test "$ol_cv_header_misplaced_pthreads" = yes ; then
+                               AC_MSG_ERROR([pthread types are misplaced, use --with-threads=posix]);
+                       fi
                fi
        fi
 
@@ -834,25 +872,6 @@ int x = errno;
                LIBS="$LTHREAD_LIBS $LIBS"
                LTHREAD_LIBS=""
        fi
-
-       dnl check for reentrant/threadsafe functions
-       dnl
-       dnl note: these should only be used when linking
-       dnl       with $LTHREAD_LIBS
-       dnl
-       save_CPPFLAGS="$CPPFLAGS"
-       save_LIBS="$LIBS"
-       LIBS="$LTHREAD_LIBS $LIBS"
-       AC_CHECK_FUNCS( \
-               strtok_r \
-               gmtime_r \
-               gethostbyaddr_r gethostbyname_r \
-               feof_unlocked unlocked_feof \
-               putc_unlocked unlocked_putc \
-               flockfile ftrylockfile \
-       )
-       CPPFLAGS="$save_CPPFLAGS"
-       LIBS="$save_LIBS"
 fi  
 
 dnl ----------------------------------------------------------------
@@ -867,6 +886,22 @@ if test $ol_link_threads = no ; then
                ol_with_threads=no
        fi
 
+       AC_CACHE_CHECK([for misplaced posix thread in headers],
+               [ol_cv_header_misplaced_pthreads], [
+               AC_TRY_COMPILE([
+#include <sys/types.h>
+typedef double pthread_t;
+                       ], [
+                               pthread_t thread = 0.0;
+                       ],
+                       [ol_cv_header_misplaced_pthreads=no],
+                       [ol_cv_header_misplaced_pthreads=yes])
+       ])
+
+       if test "$ol_cv_header_misplaced_pthreads" = yes ; then
+               AC_MSG_ERROR([pthread types are misplaced, use --with-threads=posix]);
+       fi
+
        AC_DEFINE(NO_THREADS,1)
        LTHREAD_LIBS=""
 fi
@@ -1144,7 +1179,6 @@ AC_CHECK_FUNCS(           \
        memcpy                  \
        memmove                 \
        mkstemp                 \
-       res_search              \
        select                  \
        setpwfile               \
        setsid                  \
@@ -1251,7 +1285,6 @@ AC_SUBST(BUILD_SLAPD)
   AC_SUBST(BUILD_SHELL)
 AC_SUBST(BUILD_SLURPD)
 
-
 AC_SUBST(LDAP_LIBS)
 AC_SUBST(LDAPD_LIBS)
 AC_SUBST(SLAPD_LIBS)