]> git.sur5r.net Git - openldap/blobdiff - configure.in
Add back-shell warning. Ready for release.
[openldap] / configure.in
index e58d85c3d3b96908947d993681a7499a53a7b35a..a0da9385b2ac212265461cba88aae5f18b46493d 100644 (file)
@@ -713,6 +713,14 @@ AC_CHECK_LIB(s, afopen, [
        AC_DEFINE(HAVE_AIX_SECURITY,1,[define if you have AIX security lib])
 ])
 
+dnl ----------------------------------------------------------------
+dnl Check for IBM OS/390
+case "$target" in
+*-ibm-openedition)
+       ac_cv_func_getopt=no
+       AC_DEFINE(BOTH_STRINGS_H,1,[define to use both <string.h> and <strings.h>])
+       ;;
+esac
 
 dnl ----------------------------------------------------------------
 dnl Check for module support
@@ -1353,12 +1361,9 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
        if test $ac_cv_header_pthread_h = yes ; then
                OL_POSIX_THREAD_VERSION
 
-               if test $ol_cv_pthread_version = final ; then
-                       AC_DEFINE(HAVE_PTHREADS_FINAL,1,
-                               [define if pthreads API compatible with final spec])
-               elif test $ol_cv_pthread_version = draft4 ; then
-                       AC_DEFINE(HAVE_PTHREADS_D4,1,
-                               [define if pthreads API compatible with draft4 spec])
+               if test $ol_cv_pthread_version != 0 ; then
+                       AC_DEFINE_UNQUOTED(HAVE_PTHREADS,$ol_cv_pthread_version,
+                               [define to pthreads API spec revision])
                else
                        AC_MSG_ERROR([unknown pthread version])
                fi
@@ -1453,9 +1458,6 @@ dnl                       [ol_cv_pthread_lpthread_lexc])
                OL_PTHREAD_TRY([-lpthreads],[ol_cv_pthread_lib_lpthreads])
 
                if test $ol_link_threads != no ; then
-                       AC_DEFINE(HAVE_PTHREADS,1,
-                               [define if you have POSIX Threads])
-
                        LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
 
                        dnl save flags
@@ -1465,11 +1467,12 @@ dnl                     [ol_cv_pthread_lpthread_lexc])
 
                        dnl All POSIX Thread (final) implementations should have
                        dnl sched_yield instead of pthread yield.
-                       dnl check for both
-                       AC_CHECK_FUNCS(sched_yield pthread_yield)
+                       dnl check for both, and thr_yield for Solaris
+                       AC_CHECK_FUNCS(sched_yield pthread_yield thr_yield)
 
                        if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
+                               $ac_cv_func_pthread_yield = no -a \
+                               $ac_cv_func_thr_yield = no ; then
                                dnl Digital UNIX has sched_yield() in -lrt
                                AC_CHECK_LIB(rt, sched_yield,
                                        [LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
@@ -1478,12 +1481,6 @@ dnl                      [ol_cv_pthread_lpthread_lexc])
                                        ac_cv_func_sched_yield=yes],
                                        [ac_cv_func_sched_yield=no])
                        fi
-                       if test $ac_cv_func_sched_yield = no -a \
-                               $ac_cv_func_pthread_yield = no ; then
-                               dnl Solaris has sched_yield() stub in -lposix4
-                               dnl but we'll use thr_yield instead.
-                               AC_CHECK_FUNCS(thr_yield)
-                       fi
                        if test $ac_cv_func_sched_yield = no -a \
                                $ac_cv_func_pthread_yield = no -a \
                                "$ac_cv_func_thr_yield" = no ; then
@@ -1604,18 +1601,19 @@ int main(argc, argv)
 #endif
 #endif
 
-#if HAVE_PTHREADS_D4
+#if HAVE_PTHREADS < 6
        pthread_create(&t, pthread_attr_default, task, NULL);
 #else
        pthread_create(&t, NULL, task, NULL);
 #endif
 
-#if HAVE_SCHED_YIELD
-       sched_yield();  /* make sure task runs first */
-#else
-#ifdef HAVE_PTHREAD_YIELD
-       pthread_yield();        /* make sure task runs first */
-#endif
+       /* make sure task runs first */
+#if HAVE_THR_YIELD
+       thr_yield();
+#elif defined( HAVE_SCHED_YIELD )
+       sched_yield();
+#elif defined( HAVE_PTHREAD_YIELD )
+       pthread_yield();
 #endif
 
        exit(2);
@@ -2249,10 +2247,16 @@ fi
 dnl ----------------------------------------------------------------
 dnl FreeBSD (and others) have crypt(3) in -lcrypt
 if test $ol_enable_crypt != no ; then
+       save_LIBS="$LIBS"
+       LIBS="$TLS_LIBS $LIBS"
+
        AC_CHECK_FUNC(crypt, [have_crypt=yes], [
+               LIBS="$save_LIBS"
                AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
                        have_crypt=yes], [have_crypt=no])])
 
+       LIBS="$save_LIBS"
+
        if test $have_crypt = yes ; then
                AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available])
        else
@@ -2374,7 +2378,7 @@ AC_FUNC_VPRINTF
 
 if test $ac_cv_func_vprintf = yes ; then
        dnl check for vsnprintf
-       AC_CHECK_FUNCS(vsnprintf vsprintf)
+       AC_CHECK_FUNCS(snprintf vsnprintf)
 fi
 
 AC_CHECK_FUNCS(                \
@@ -2405,7 +2409,6 @@ AC_CHECK_FUNCS(           \
        read                    \
        recv                    \
        recvfrom                \
-       recvmsg                 \
        setpwfile               \
        setgid                  \
        setegid                 \
@@ -2439,6 +2442,14 @@ AC_REPLACE_FUNCS(getopt)
 if test "$ac_cv_func_getopt" != yes; then
        LIBSRCS="$LIBSRCS getopt.c"
 fi
+if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
+       if test "$ac_cv_func_snprintf" != yes; then
+               AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
+       fi
+       if test "$ac_cv_func_vsnprintf" != yes; then
+               AC_DEFINE(vsnprintf, ber_pvt_vsnprintf, [define to snprintf routine])
+       fi
+fi
 
 dnl ----------------------------------------------------------------
 # Check Configuration
@@ -2650,6 +2661,9 @@ if test "$ol_link_perl" != no ; then
 fi
 
 if test "$ol_enable_shell" != no ; then
+       if( "$ol_link_thread" != no ; then
+               AC_MSG_WARN([Use of --without-threads is recommended with back-shell])
+       fi
        AC_DEFINE(SLAPD_SHELL,1,[define to support SHELL backend])
        BUILD_SLAPD=yes
        BUILD_SHELL=yes
@@ -2703,6 +2717,12 @@ else
        PLAT=UNIX
 fi
 
+if test -z "$SLAPD_STATIC_BACKENDS"; then
+       SLAPD_NO_STATIC='#'
+else
+       SLAPD_NO_STATIC=
+fi
+
 AC_SUBST(LIBSRCS)
 AC_SUBST(PLAT)
 AC_SUBST(BUILD_LIBS_DYNAMIC)
@@ -2744,6 +2764,7 @@ AC_SUBST(WRAP_LIBS)
 AC_SUBST(SLAPD_MODULES_CPPFLAGS)
 AC_SUBST(SLAPD_MODULES_LDFLAGS)
 
+AC_SUBST(SLAPD_NO_STATIC)
 AC_SUBST(SLAPD_STATIC_BACKENDS)
 AC_SUBST(SLAPD_DYNAMIC_BACKENDS)