OL_ARG_WITH(readline,[ --with-readline with readline support],
auto, [auto yes no] )
OL_ARG_WITH(threads,[ --with-threads use threads],
- auto, [auto posix mach pth lwp yes no manual] )
+ auto, [auto nt posix mach pth lwp yes no manual] )
OL_ARG_WITH(tls,[ --with-tls with TLS/SSL support],
auto, [auto ssleay openssl yes no] )
OL_ARG_WITH(yielding_select,[ --with-yielding-select with implicitly yielding select],
dnl (for now, let autoconf sort this out)
dnl CFLAGS=${CFLAGS-""}
+AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
else
PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
- if test x"$ol_with_perl_module" == "xstatic" ; then
+ if test x"$ol_with_perl_module" = "xstatic" ; then
SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
else
MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
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 \
syslog.h \
termios.h \
unistd.h \
+ winsock.h \
)
+
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_CACHE_CHECK([for winsock], [ol_cv_winsock],
+ AC_TRY_LINK([#include <winsock.h>],[
+ socket(0,0,0);
+ select(0,NULL,NULL,NULL,NULL);
+ closesocket(0);
+ gethostname(NULL,0);
+ ],[ol_cv_winsock=yes],[ol_cv_winsock=no])])
+
+ if test $ol_cv_winsock = yes ; then
+ 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
+ fi
+fi
+
dnl Find socket()
dnl Likely combinations:
dnl -lsocket [ -lnsl_s | -lnsl ]
dnl hopefully we won't include too many libraries
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(net, main)
- AC_CHECK_LIB(net, socket)
AC_CHECK_LIB(nsl_s, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(inet, socket)
dnl require select
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
if test $ac_cv_header_kerberosIV_krb_h = yes ; then
AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no],
- [-lkrb5 -ldes425])
+ [-lkrb5 -ldes425 -lcrypto -lcom_err])
if test $have_k5 = yes ; then
ol_with_kerberos=found
ol_link_kerberos=yes
- KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
+ KRB_LIBS="-lkrb4 -lkrb5 -ldes425 -lcrypto -lcom_err"
LIBS="$KRB_LIBS $LIBS"
dnl ----------------------------------------------------------------
dnl Threads?
ol_link_threads=no
+
+if test $ol_with_threads = auto -o $ol_with_threads = yes \
+ -o $ol_with_threads = nt ; then
+
+ OL_NT_THREADS
+
+ if test "$ol_cv_nt_threads" = yes ; then
+ ol_link_threads=nt
+ ol_with_threads=found
+ ol_with_yielding_select=yes
+
+ AC_DEFINE(HAVE_NT_SERVICE_MANAGER,1,[if you have NT Service Manager])
+ AC_DEFINE(HAVE_NT_EVENT_LOG,1,[if you have NT Event Log])
+ fi
+
+ if test $ol_with_threads = nt ; then
+ AC_MSG_ERROR([could not locate NT Threads])
+ fi
+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)
for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
AC_CHECK_LIB($lib,main,
[have_tcl=yes
- if test x"$ol_with_tcl_module" == "xstatic" ; then
+ if test x"$ol_with_tcl_module" = "xstatic" ; then
SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
else
MOD_TCL_LIB="-l${lib}"
[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
+
+AC_CHECK_TYPE(ssize_t, [signed int])
+AC_CHECK_TYPE(caddr_t, [char *])
+
OL_TYPE_SOCKLEN_T
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM
+AC_TYPE_UID_T
+OL_TYPE_SIG_ATOMIC_T
+
+dnl AC_TYPE_GETGROUPS
+
OL_STRUCT_PASSWD_PW_GECOS
OL_STRUCT_PASSWD_PW_PASSWD
if test $cross_compiling = yes ; then
AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
-
- AC_DEFINE(LBER_INT_T,long)
- AC_DEFINE(LBER_TAG_T,long)
- AC_DEFINE(LBER_SOCKET_T,int)
-
else
AC_C_BIGENDIAN
- AC_CHECK_SIZEOF(short)
- AC_CHECK_SIZEOF(int)
- AC_CHECK_SIZEOF(long)
+fi
- if test "$ac_cv_sizeof_int" -lt 4 ; then
- AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
+AC_COMPILE_CHECK_SIZEOF(short)
+AC_COMPILE_CHECK_SIZEOF(int)
+AC_COMPILE_CHECK_SIZEOF(long)
- AC_DEFINE(LBER_INT_T,long)
- AC_DEFINE(LBER_TAG_T,long)
- AC_DEFINE(LBER_SOCKET_T,int)
- else
- AC_DEFINE(LBER_INT_T,int)
- AC_DEFINE(LBER_TAG_T,long)
- AC_DEFINE(LBER_SOCKET_T,int)
- fi
+if test "$ac_cv_sizeof_int" -lt 4 ; then
+ AC_MSG_WARN([OpenLDAP requires 'int' to be 32 bits or greater.])
+
+ AC_DEFINE(LBER_INT_T,long)
+else
+ AC_DEFINE(LBER_INT_T,int)
fi
AC_DEFINE(LBER_LEN_T,long)
+AC_DEFINE(LBER_SOCKET_T,int)
+AC_DEFINE(LBER_TAG_T,long)
dnl ----------------------------------------------------------------
dnl Checks for library functions.
OL_FUNC_INET_ATON
-dnl we should use vfork instead of fork in a number of places...
-dnl AC_FUNC_VFORK
+dnl Check for NT specific routines
+AC_CHECK_FUNC(_spawnlp, AC_DEFINE(HAVE_SPAWNLP,1,[if you have spawnlp()]))
+
+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_FUNC_VPRINTF
if test $ac_cv_func_vprintf = yes ; then
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)