OL_ARG_WITH(fetch,[ --with-fetch with fetch URL support],
auto, [auto yes no] )
OL_ARG_WITH(kerberos,[ --with-kerberos with Kerberos support],
- auto, [auto k5 k4 afs yes no])
+ auto, [auto k5 kth k4 afs yes no])
OL_ARG_WITH(readline,[ --with-readline with readline support],
auto, [auto yes no] )
OL_ARG_WITH(threads,[ --with-threads use threads],
OL_ARG_ENABLE(aci,[ --enable-aci enable per-object ACIs], no)dnl
OL_ARG_ENABLE(discreteaci,[ --enable-discreteaci enable discrete rights in ACIs], no)dnl
OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl
+OL_ARG_ENABLE(dynamic,[ --enable-dynamic enable linking built binaries with dynamic libs], no)dnl
dnl SLAPD Backend options
OL_ARG_ENABLE(bdb2,[ --enable-bdb2 enable bdb2 backend], no)dnl
ol_enable_aci=no
ol_enable_discreteaci=no
ol_enable_wrappers=no
+ ol_enable_dynamic=no
ol_with_ldbm_api=no
ol_with_ldbm_type=no
dnl (for now, let autoconf sort this out)
dnl CFLAGS=${CFLAGS-""}
+AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_MSG_ERROR([could not locate libtool ltdl.h])
fi
- AC_CHECK_LIB(ltdl, lt_dlinit)
+ AC_CHECK_LIB(ltdl, lt_dlinit, [
+ MODULES_LIBS=-lltdl
+ AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
+ ])
+
if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
AC_MSG_ERROR([could not locate libtool -lltdl])
fi
ol_link_modules=yes
-
else
ol_with_bdb2_module=static
ol_with_ldap_module=static
arpa/inet.h \
arpa/nameser.h \
assert.h \
+ conio.h \
crypt.h \
+ direct.h \
errno.h \
fcntl.h \
filio.h \
getopt.h \
grp.h \
+ io.h \
libutil.h \
limits.h \
locale.h \
memory.h \
psap.h \
pwd.h \
+ process.h \
resolv.h \
sgtty.h \
shadow.h \
unistd.h \
)
+dnl Check for winsock.h on a Mingw32 system
+if test "$ac_cv_mingw32" = yes ; then
+ AC_CHECK_HEADERS(winsock.h)
+fi
+
dnl ----------------------------------------------------------------
dnl Checks for libraries
dnl HP-UX requires -lV3
AC_CHECK_LIB(V3, sigset)
+dnl Gotta check for winsock manually
+if test "${ac_cv_header_winsock_h}" = yes; then
+ AC_MSG_CHECKING(for winsock support)
+ AC_TRY_LINK([
+#include <winsock.h>
+ ],[
+socket(0,0,0);
+select(0,NULL,NULL,NULL,NULL);
+closesocket(0);
+gethostname(NULL,0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_WINSOCK,1,[define if you have winsock])
+ ac_cv_func_socket=yes
+ ac_cv_func_select=yes
+ ac_cv_func_closesocket=yes
+ ac_cv_func_gethostname=yes
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+fi
+
dnl Find socket()
dnl Likely combinations:
dnl -lsocket [ -lnsl_s | -lnsl ]
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
dnl AC_CHECK_FUNCS(socketpair)
-dnl Select arg types
-dnl (if this detection becomes permenent, it and the select() detection
-dnl should be done before the yielding select test)
-AC_FUNC_SELECT_ARGTYPES
+if test "${ac_cv_header_winsock_h}" != yes; then
+ dnl Select arg types
+ dnl (if this detection becomes permenent, it and the select() detection
+ dnl should be done before the yielding select test)
+ AC_FUNC_SELECT_ARGTYPES
+fi
dnl check to see if system call automatically restart
dnl AC_SYS_RESTARTABLE_SYSCALLS
fi
fi
-if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
- AC_CHECK_HEADERS(krb.h des.h)
+if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
+ -o $ol_with_kerberos = kth ; then
+
+ AC_CHECK_HEADERS(krb.h des.h krb-archaeology.h )
if test $ac_cv_header_krb_h = yes ; then
AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes])
ol_link_kerberos=yes
KRB_LIBS="-lkrb -ldes"
+
+ if test $ac_cv_header_krb_archaeology_h = yes ; then
+ AC_DEFINE(HAVE_KTH_KERBEROS, 1,
+ [define if you have Kth Kerberos])
+ fi
fi
fi
fi
if test $ol_link_kerberos = yes ; then
AC_DEFINE(HAVE_KERBEROS, 1, [define if you have Kerberos])
+
+elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
+ AC_ERROR([Kerberos detection failed.])
fi
dnl ----------------------------------------------------------------
dnl ----------------------------------------------------------------
dnl Threads?
ol_link_threads=no
+
+dnl Not much to check. If we're in mingw32, we assume win32 threads.
+if test "$ac_cv_mingw32" = yes ; then
+ ol_link_threads=nt
+ ol_with_threads=found
+ ol_with_yielding_select=yes
+ AC_MSG_CHECKING(for NT threads)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NT_THREADS,1,[if you have NT threads])
+fi
+
if test $ol_with_threads = auto -o $ol_with_threads = yes \
-o $ol_with_threads = posix ; then
AC_CHECK_HEADERS(thread.h synch.h)
fi
-if test $ol_link_threads != no ; then
+if test $ol_link_threads != no -a $ol_link_threads != nt ; then
dnl needed to get reentrant/threadsafe versions
dnl
AC_DEFINE(REENTRANT,1)
ol_enable_ldbm=no
fi
+dnl ----------------------------------------------------------------
+if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
+ LINK_BINS_DYNAMIC="yes"
+else
+ LINK_BINS_DYNAMIC="no"
+fi
+
dnl ----------------------------------------------------------------
if test $ol_enable_wrappers != no ; then
AC_CHECK_HEADERS(tcpd.h)
dnl ----------------------------------------------------------------
dnl
-dnl Check for fetch URL support
-dnl should be extended to support other fetch URL APIs
+dnl Check for Cyrus SASL
dnl
ol_link_sasl=no
if test $ol_with_cyrus_sasl != no ; then
fi
fi
+dnl ----------------------------------------------------------------
+dnl Check for entropy sources
+if test $cross_compiling != yes ; then
+ dev=no
+ if test -r /dev/urandom ; then
+ dev="/dev/urandom";
+ elif test -r /idev/urandom ; then
+ dev="/idev/urandom";
+ elif test -r /dev/srandom ; then
+ dev="/dev/srandom";
+ elif test -r /dev/random ; then
+ dev="/dev/random";
+ elif test -r /idev/random ; then
+ dev="/idev/random";
+ fi
+
+ if test $dev != no ; then
+ AC_DEFINE_UNQUOTED(URANDOM_DEVICE,"$dev",[set to urandom device])
+ fi
+fi
+
dnl ----------------------------------------------------------------
dnl
dnl Check for fetch URL support
[have_setproctitle=yes
LUTIL_LIBS="$LUTIL_LIBS -lutil"],
[have_setproctitle=no
- LIBOBJS="$LIBOBJS setproctitle.o"])])
+ LIBOBJS="$LIBOBJS setproctitle.o"
+ LIBSRCS="$LIBSRCS setproctitle.c"])])
if test $have_setproctitle = yes ; then
AC_DEFINE(HAVE_SETPROCTITLE,1,
dnl ----------------------------------------------------------------
dnl Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_GETGROUPS dnl requires AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AM_TYPE_PTRDIFF_T
AC_TYPE_SIGNAL
-OL_TYPE_SIG_ATOMIC_T
AC_TYPE_SIZE_T
OL_TYPE_SOCKLEN_T
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM
-OL_STRUCT_PASSWD_PW_GECOS
-OL_STRUCT_PASSWD_PW_PASSWD
+AC_TYPE_UID_T
+OL_TYPE_SIG_ATOMIC_T
+
+dnl only check these if we're not Mingw32
+if test "$ac_cv_mingw32" != yes ; then
+ AC_TYPE_GETGROUPS
+ OL_STRUCT_PASSWD_PW_GECOS
+ OL_STRUCT_PASSWD_PW_PASSWD
+fi
OL_C_UPPER_LOWER
AC_C_CONST
OL_FUNC_INET_ATON
+dnl Check for Mingw32 specific functions.
+if test "$ac_cv_mingw32" = yes ; then
+ AC_CHECK_FUNC(_snprintf, [
+ ac_cv_func_snprintf=yes
+ AC_DEFINE(snprintf, _snprintf, [define to snprintf routine])
+ ])
+
+ AC_CHECK_FUNC(_vsnprintf, [
+ ac_cv_func_vsnprintf=yes
+ AC_DEFINE(vsnprintf, _vsnprintf, [define to vsnprintf routine])
+ ])
+
+ AC_CHECK_FUNC(_spawnlp, AC_DEFINE(HAVE_SPAWNLP,1,[if you have spawnlp()]))
+fi
+
dnl we should use vfork instead of fork in a number of places...
dnl AC_FUNC_VFORK
AC_FUNC_VPRINTF
dnl We actually may need to replace more than this.
AC_REPLACE_FUNCS(getopt tempnam)
+if test "$ac_cv_func_getopt" != yes; then
+ LIBSRCS="$LIBSRCS getopt.c"
+fi
+
+if test "$ac_cv_func_tempnam" != yes; then
+ LIBSRCS="$LIBSRCS tempnam.c"
+fi
+
dnl ----------------------------------------------------------------
# Check Configuration
OL_SYS_ERRLIST
if test "$ol_link_modules" != no ; then
AC_DEFINE(SLAPD_MODULES,1,[define to support modules])
BUILD_SLAPD=yes
- MODULES_LIBS=-lltdl
SLAPD_MODULES_LDFLAGS="-dlopen self"
fi
dnl ----------------------------------------------------------------
+if test "$LINK_BINS_DYNAMIC" = yes; then
+ LIB_LINKAGE=DYN
+ LT_LIB_LINKAGE=shared
+else
+ LIB_LINKAGE=STAT
+ LT_LIB_LINKAGE=static
+fi
+
+if test "$ac_cv_mingw32" = yes ; then
+ PLAT=NT
+ DYN_EXT=dll
+else
+ PLAT=UNIX
+ DYN_EXT=so
+fi
+
+AC_SUBST(LIBSRCS)
+
+AC_SUBST(PLAT)
+AC_SUBST(LIB_LINKAGE)
+AC_SUBST(LT_LIB_LINKAGE)
+AC_SUBST(DYN_EXT)
+
AC_SUBST(BUILD_LDAPD)
AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_BDB2)
AC_SUBST(LUTIL_LIBS)
AC_SUBST(WRAP_LIBS)
AC_SUBST(MOD_TCL_LIB)
+AC_SUBST(LINK_BINS_DYNAMIC)
AC_SUBST(SLAPD_MODULES_CPPFLAGS)
AC_SUBST(SLAPD_MODULES_LDFLAGS)