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
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 use tls/ssl],
+ auto, [auto ssleay openssl yes no] )
dnl Server options
OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl
OL_ARG_ENABLE(perl,[ --enable-perl enable perl backend], no)dnl
OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend], no)dnl
+OL_ARG_ENABLE(tcl,[ --enable-tcl enable tcl backend], no)dnl
dnl SLURPD OPTIONS
AC_ARG_WITH(xxslurpdoptions,[SLURPD Options:])
if test $ol_enable_shell = yes ; then
AC_MSG_WARN([slapd disabled, ignoring --enable_shell argument])
fi
+ if test $ol_enable_tcl = yes ; then
+ AC_MSG_WARN([slapd disabled, ignoring --enable_tcl argument])
+ fi
if test $ol_enable_aclgroups = yes ; then
AC_MSG_WARN([slapd disabled, ignoring --enable_aclgroups argument])
fi
ol_enable_passwd=no
ol_enable_perl=no
ol_enable_shell=no
+ ol_enable_tcl=no
ol_enable_aclgroups=no
ol_enable_wrappers=no
ol_enable_phonetic=no
if test $ol_enable_passwd = no -a \
$ol_enable_perl = no -a \
- $ol_enable_shell = no ; then
+ $ol_enable_shell = no -a \
+ $ol_enable_tcl = no ; then
AC_MSG_ERROR([slapd requires a backend])
fi
BUILD_PASSWD=no
BUILD_PERL=no
BUILD_SHELL=no
+BUILD_TCL=no
BUILD_THREAD=no
SLAPD_PERL_LDFLAGS=
KRB_LIBS=
TERMCAP_LIBS=
+TLS_LIBS=
dnl ----------------------------------------------------------------
dnl Checks for programs
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 = auto -o $ol_with_tls = ssleay \
+ -o $ol_with_tls = openssl ; 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], [have_ssleay=no], [-lcrypto])
+
+ if test $have_ssleay = yes ; then
+ ol_with_tls=found
+ ol_link_tls=yes
+
+ AC_DEFINE( HAVE_SSLEAY, 1,
+ [define if you have SSLeay] )
+
+ TLS_LIBS="-lssl -lcrypto"
+ 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
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)
dnl pthread_create() in -lc_r (FreeBSD)
dnl pthread_create() in -lpthreads (many)
dnl pthread_join() -Wl,-woff,85 -lpthreads (IRIX)
- dnl pthread_create() in HP-UX -lpthread (HP-UX 11)
dnl
- dnl Check pthread (draft4) flags (to be depreciated)
+ dnl Check pthread (draft4) flags (depreciated)
dnl pthread_create() with -threads (OSF/1)
dnl
- dnl Check pthread (final) libraries (to be depreciated)
+ dnl Check pthread (final) libraries (depreciated)
dnl pthread_mutex_unlock() in -lpthreads -lmach -lexc -lc_r (OSF/1)
dnl pthread_mutex_lock() in -lpthreads -lmach -lexc (OSF/1)
dnl pthread_mutex_trylock() in -lpthreads -lexc (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"
LIBS="$save_LIBS"
fi
- dnl HP-UX 11 Pthread check
- if test $ol_link_threads = no; then
- save_LIBS="$LIBS"
- LIBS="$LIBS -lpthread"
- AC_MSG_CHECKING([for pthread_create() in HP-UX -lpthread])
- ol_try_pthread_hpux_11=no
- AC_CACHE_VAL(ol_cv_pthread_hpux_11,[
- AC_TRY_LINK([
-#include <pthread.h>
-#include <elf.h>
-#ifndef ELFABI_HPUX_REL11
- die horribly
-#endif
- ], [pthread_create(NULL, NULL, NULL, NULL);],
- ol_try_pthread_hpux_11=yes
- ol_cv_pthread_hpux_11=yes,
- ol_cv_pthread_hpux_11=no)])
- AC_MSG_RESULT(yes)
- LIBS="$save_LIBS"
-
- if test $ol_cv_pthread_hpux_11=yes ; then
- ol_link_threads=posix
- LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
- if test $ol_try_pthread_hpux_11=yes ; then
- dnl Some tests below may fail, cause we aint including
- dnl pthread.h. Force appropriate ones to yes
- ac_cv_func_pthread_attr_init=yes
- fi
- fi
- fi
-
if test $ol_link_threads = no ; then
dnl try -threads
AC_CACHE_CHECK([for pthread_create with -threads],
dnl save_LIBS="$LIBS"
dnl LIBS="$LTHREAD_LIBS $LIBS"
dnl AC_CHECK_FUNCS( \
-dnl strtok_r \
dnl gmtime_r \
dnl gethostbyaddr_r gethostbyname_r \
dnl feof_unlocked unlocked_feof \
AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
fi
+if test $ol_enable_tcl != no ; then
+ AC_CHECK_HEADERS(tcl.h)
+
+ if test $ac_cv_header_tcl_h != yes ; then
+ have_tcl=no
+ else
+ AC_CHECK_LIB(tcl,main,
+ [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"],
+ [have_tcl=no])
+
+ if test $have_tcl != yes; then
+ AC_CHECK_LIB(tcl7.6,main,
+ [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"],
+ [have_tcl=no])
+ fi
+
+ if test $have_tcl != yes; then
+ AC_CHECK_LIB(tcl8.0,main,
+ [have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"],
+ [have_tcl=no])
+ fi
+ fi
+
+ if test $have_tcl != yes ; then
+ AC_MSG_WARN([could not find -ltcl])
+ if test $ol_enable_tcl = yes ; then
+ AC_MSG_ERROR([could not find tcl, select appropriate options or disable])
+ fi
+
+ ol_enable_tcl=no
+ fi
+fi
+
# ud needs termcap (should insert check here)
ol_link_termcap=no
AC_CHECK_HEADERS(termcap.h ncurses.h)
getopt.h \
libutil.h \
limits.h \
+ locale.h \
malloc.h \
memory.h \
regex.h \
strrchr \
strsep \
strstr \
- strtok \
strtol \
strtoul \
strspn \
# these functions are required to build a thread_safe -lldap
AC_CHECK_FUNCS( \
- strtok_r \
ctime_r \
gethostbyaddr_r \
gethostbyname_r \
ol_cv_func_ctime_r=0
fi
-if test "$ac_cv_func_strtok_r" = yes \
- -a "$ac_cv_func_ctime_r" = yes \
+if test "$ac_cv_func_gethostbyname_r" = yes ; then
+ OL_FUNC_GETHOSTBYNAME_R_NARGS
+else
+ ol_cv_func_gethostbyname_r=0
+fi
+
+if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
+ OL_FUNC_GETHOSTBYADDR_R_NARGS
+else
+ ol_cv_func_gethostbyaddr_r=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
BUILD_SHELL=yes
fi
+if test "$ol_enable_tcl" != no ; then
+ AC_DEFINE(SLAPD_TCL,1)
+ BUILD_SLAPD=yes
+ BUILD_TCL=yes
+fi
+
if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
$BUILD_SLAPD = yes ; then
BUILD_SLURPD=yes
AC_SUBST(BUILD_PASSWD)
AC_SUBST(BUILD_PERL)
AC_SUBST(BUILD_SHELL)
+ AC_SUBST(BUILD_TCL)
AC_SUBST(BUILD_SLURPD)
AC_SUBST(LDAP_LIBS)
AC_SUBST(KRB_LIBS)
AC_SUBST(TERMCAP_LIBS)
+AC_SUBST(TLS_LIBS)
dnl ----------------------------------------------------------------
dnl final output
servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
+servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
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