]> git.sur5r.net Git - openldap/blobdiff - configure.in
Remove unused variables
[openldap] / configure.in
index 242be0d904b51f5ffd632a67ca2e27a376c9798e..82723eca2a88854e0e72f86410728ed9e11075cf 100644 (file)
@@ -49,7 +49,6 @@ OL_ARG_ENABLE(cldap,[  --enable-cldap enable connectionless ldap], no)dnl
 OL_ARG_ENABLE(x_compile,[  --enable-x-compile  enable cross compiling],
        no, [yes no])dnl
 
-
 dnl General "with" options
 OL_ARG_ENABLE(dmalloc,[  --enable-dmalloc      enable debug malloc support], no)dnl
 
@@ -59,6 +58,8 @@ OL_ARG_WITH(threads,[  --with-threads use threads],
        auto, [auto posix mach lwp yes no manual] )
 OL_ARG_WITH(yielding_select,[  --with-yielding-select  with implicitly yielding select],
        auto, [auto yes no manual] )
+OL_ARG_WITH(tls,[  --with-tls  with TLS/SSL support],
+       auto, [auto ssleay openssl yes no] )
 
 dnl Server options
 
@@ -261,11 +262,21 @@ SLAPD_PERL_CPPFLAGS=
 
 KRB_LIBS=
 TERMCAP_LIBS=
+TLS_LIBS=
 
 dnl ----------------------------------------------------------------
 dnl Checks for programs
 
 AC_PROG_INSTALL
+
+dnl
+dnl    We probably should use the vendor 'cc' by default
+dnl
+dnl The default compiler is cc (NOT gcc)
+dnl CC=${CC-"cc"}
+dnl The default CFLAGS is empty NOT whatever AC_PROG_CC sets.
+dnl CFLAGS=${CFLAGS-""}
+
 AM_PROG_LIBTOOL
 dnl AC_PROG_MAKE_SET
 
@@ -452,6 +463,48 @@ if test $ol_link_kerberos = yes ; then
        AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
 fi
 
+dnl
+dnl Check for SSL/TLS
+dnl
+ol_link_tls=no
+if test $ol_with_tls != no ; then
+       
+       AC_CHECK_HEADERS(ssl.h)
+       
+       if test $ac_cv_header_ssl_h = yes ; then
+               AC_CHECK_LIB(ssl, SSLeay_add_ssl_algorithms, 
+                       [have_ssleay=yes
+                       need_rsaref=no],
+                       [have_ssleay=no],
+                       [-lcrypto])
+                       
+               if test $have_ssleay = no ; then
+                       AC_CHECK_LIB(ssl, ssl3_accept, 
+                               [have_ssleay=yes
+                               need_rsaref=yes], [have_ssleay=no],
+                               [-lcrypto -lRSAglue -lrsaref])
+               fi
+
+               if test $have_ssleay = yes ; then
+                       ol_with_tls=found
+                       ol_link_tls=yes
+
+                       AC_DEFINE(HAVE_SSLEAY, 1, 
+                               [define if you have SSLeay or OpenSSL])
+
+                       if test $need_rsaref = yes; then
+                               TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
+                       else
+                               TLS_LIBS="-lssl -lcrypto"
+                       fi
+               fi
+       fi
+fi
+
+if test $ol_link_tls = yes ; then
+       AC_DEFINE(HAVE_TLS, 1, [define if you have TLS])
+fi     
+
 ol_link_threads=no
 if test $ol_with_threads = auto -o $ol_with_threads = yes \
        -o $ol_with_threads = posix ; then
@@ -493,6 +546,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)
@@ -522,8 +576,13 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                                dnl save the flags
                                save_LIBS="$LIBS"
                                LIBS="-kthread $LIBS"
-                               AC_TRY_LINK([#include <pthread.h>],
-                                       [pthread_create(NULL,NULL,NULL,NULL);],
+                               AC_TRY_LINK([#include <pthread.h>],[
+#if HAVE_PTHREADS_D4
+       pthread_create(NULL,pthread_attr_default,NULL,NULL);
+#else
+       pthread_create(NULL,NULL,NULL,NULL);
+#endif
+],
                                        [ol_cv_kthread_flag=yes], [ol_cv_kthread_flag=no])
                                dnl restore the LIBS
                                LIBS="$save_LIBS"
@@ -542,8 +601,13 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                                dnl save the flags
                                save_LIBS="$LIBS"
                                LIBS="-pthread $LIBS"
-                               AC_TRY_LINK([#include <pthread.h>],
-                                       [pthread_create(NULL,NULL,NULL,NULL);],
+                               AC_TRY_LINK([#include <pthread.h>],[
+#if HAVE_PTHREADS_D4
+       pthread_create(NULL,pthread_attr_default,NULL,NULL);
+#else
+       pthread_create(NULL,NULL,NULL,NULL);
+#endif
+],
                                        [ol_cv_pthread_flag=yes], [ol_cv_pthread_flag=no])
                                dnl restore the LIBS
                                LIBS="$save_LIBS"
@@ -562,8 +626,13 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \
                                dnl save the flags
                                save_LIBS="$LIBS"
                                LIBS="-pthreads $LIBS"
-                               AC_TRY_LINK([#include <pthread.h>],
-                                       [pthread_create(NULL,NULL,NULL,NULL);],
+                               AC_TRY_LINK([#include <pthread.h>],[
+#if HAVE_PTHREADS_D4
+       pthread_create(NULL,pthread_attr_default,NULL,NULL);
+#else
+       pthread_create(NULL,NULL,NULL,NULL);
+#endif
+],
                                        [ol_cv_pthreads_flag=yes], [ol_cv_pthreads_flag=no])
                                dnl restore the LIBS
                                LIBS="$save_LIBS"
@@ -595,6 +664,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"
@@ -814,7 +903,11 @@ int main(argc, argv)
        char **argv;
 {
        pthread_t t;
+#if HAVE_PTHREADS_D4
+       exit(pthread_create(&t, pthread_attr_default, task, NULL));
+#else
        exit(pthread_create(&t, NULL, task, NULL));
+#endif
 }
 ],
                                [ol_cv_pthread_create_works=yes],
@@ -888,7 +981,11 @@ int main(argc, argv)
 #endif
 #endif
 
+#if HAVE_PTHREADS_D4
+       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 */
@@ -1383,6 +1480,7 @@ AC_CHECK_HEADERS( \
        getopt.h                \
        libutil.h               \
        limits.h                \
+       locale.h                \
        malloc.h                \
        memory.h                \
        regex.h                 \
@@ -1490,12 +1588,27 @@ AC_CHECK_FUNCS(         \
 
 if test "$ac_cv_func_ctime_r" = yes ; then
        OL_FUNC_CTIME_R_NARGS
+       OL_FUNC_CTIME_R_TYPE
+else
+       ol_cv_func_ctime_r_nargs=0
+fi
+
+if test "$ac_cv_func_gethostbyname_r" = yes ; then
+       OL_FUNC_GETHOSTBYNAME_R_NARGS
+else
+       ol_cv_func_gethostbyname_r_nargs=0
+fi
+if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
+       OL_FUNC_GETHOSTBYADDR_R_NARGS
 else
-       ol_cv_func_ctime_r=0
+       ol_cv_func_gethostbyaddr_r_nargs=0
 fi
 
 if test "$ac_cv_func_ctime_r" = yes \
        -a "$ol_cv_func_ctime_r_nargs" -ge 2 -a "$ol_cv_func_ctime_r_nargs" -le 3 \
+       -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
+       -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
        -a "$ac_cv_func_gethostbyaddr_r" = yes \
        -a "$ac_cv_func_gethostbyname_r" = yes \
        ; then
@@ -1628,6 +1741,7 @@ AC_SUBST(SLAPD_PERL_LDFLAGS)
 
 AC_SUBST(KRB_LIBS)
 AC_SUBST(TERMCAP_LIBS)
+AC_SUBST(TLS_LIBS)
 
 dnl ----------------------------------------------------------------
 dnl final output
@@ -1670,7 +1784,8 @@ servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:
 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
-tests/Makefile:build/top.mk:tests/Makefile.in \
+tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
+tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
 ,[
 date > stamp-h
 echo Please \"make depend\" to build dependencies