dnl $OpenLDAP$
dnl
-dnl Copyright 1998-2001 The OpenLDAP Foundation. All Rights Reserved.
+dnl Copyright 1998-2002 The OpenLDAP Foundation. All Rights Reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted only as authorized by the OpenLDAP
# $]OpenLDAP[$
# from] translit([$OpenLDAP$], $")] [
-# Copyright 1998-2001 The OpenLDAP Foundation. All Rights Reserved.
+# Copyright 1998-2002 The OpenLDAP Foundation. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted only as authorized by the OpenLDAP
# http://www.OpenLDAP.org/license.html or in file LICENSE in the
# top-level directory of the distribution.
-echo "Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved."
+echo "Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved."
echo "Restrictions apply, see COPYRIGHT and LICENSE files."
])dnl
dnl ----------------------------------------------------------------
if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
if test $ol_with_kerberos = no ; then
AC_MSG_ERROR([options require --with-kerberos])
- elif $ol_with_kerberos = auto ; then
+ elif test $ol_with_kerberos = auto ; then
ol_with_kerberos=yes
fi
SLAPD_MODULES_CPPFLAGS=
SLAPD_MODULES_LIST=
+SLAPD_STATIC_BACKENDS=
+SLAPD_DYNAMIC_BACKENDS=
+
SLAPD_PERL_LDFLAGS=
MOD_PERL_LDFLAGS=
PERL_CPPFLAGS=
dnl (for now, let autoconf sort this out)
dnl CFLAGS=${CFLAGS-""}
+AC_CHECK_PROGS(AR,ar gar,ar)
+
AC_LIBTOOL_WIN32_DLL
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
fi
AC_CHECK_LIB(ltdl, lt_dlinit, [
- MODULES_LIBS=-lltdl
- AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
+ MODULES_LIBS=-lltdl
+ AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
])
if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
termios.h \
unistd.h \
winsock.h \
+ winsock2.h \
)
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])
+dnl The following is INTENTIONALLY scripted out because shell does not
+dnl support variable names with the '@' character, which is what
+dnl autoconf would try to generate if one merely used AC_SEARCH_LIBS
+AC_MSG_CHECKING(for winsock)
+save_LIBS="$LIBS"
+for curlib in ws2_32 wsock32; do
+ LIBS="$LIBS -l$curlib"
+ AC_TRY_LINK([
+ char socket@12();
+ char select@20();
+ char closesocket@4();
+ char gethostname@8();
+ ],
+ [
+ socket@12();
+ select@20();
+ closesocket@4();
+ gethostname@8();
+ ],
+ have_winsock=yes, have_winsock=no)
+
+ if test $have_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
+ if test $curlib = ws2_32; then
+ have_winsock=winsock2
+ AC_DEFINE(HAVE_WINSOCK2, 1,
+ [define if you have winsock2])
+ fi
+ break
fi
-fi
+ LIBS="$save_LIBS"
+done
+AC_MSG_RESULT($have_winsock)
dnl Find socket()
dnl Likely combinations:
AC_CHECK_FUNC(select, :, AC_MSG_ERROR([select() required.]))
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
+ 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
if test "$ac_cv_header_regex_h" != yes ; then
AC_MSG_ERROR([POSIX regex.h required.])
fi
-AC_CHECK_FUNC(regfree, :, AC_MSG_ERROR([POSIX regex required.]))
+AC_SEARCH_LIBS(regfree, [regex gnuregex],
+ :, AC_MSG_ERROR([POSIX regex required.]))
OL_POSIX_REGEX
if test "$ol_cv_c_posix_regex" = no ; then
AC_MSG_ERROR([broken POSIX regex!])
fi
+dnl ----------------------------------------------------------------
+dnl For windows, check for the need of RPCRT for UUID function support
+AC_MSG_CHECKING(to see if -lrpcrt4 is needed for win32 UUID support)
+save_LIBS="$LIBS"
+LIBS="$LIBS -lrpcrt4"
+AC_TRY_LINK([
+ char UuidCreate@4();
+ char UuidToStringA@8();
+ ],
+ [
+ UuidCreate@4();
+ UuidToStringA@8();
+ ],
+ need_rpcrt=yes, need_rpcrt=no)
+if test $need_rpcrt = yes; then
+ SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
+fi
+LIBS="$save_LIBS"
+AC_MSG_RESULT($need_rpcrt)
+
dnl ----------------------------------------------------------------
dnl Check for resolver routines
dnl need to check for both res_query and __res_query
dnl ----------------------------------------------------------------
dnl PF_INET6 support requires getaddrinfo and INET6_ADDRSTRLEN
dnl PF_LOCAL may use getaddrinfo in available
-AC_CHECK_FUNCS( getaddrinfo inet_ntop )
+AC_CHECK_FUNCS( getaddrinfo gai_strerror inet_ntop )
ol_link_ipv6=no
if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
if test $ol_enable_ipv6 = yes ; then
AC_MSG_ERROR([IPv6 support requires getaddrinfo() and inet_ntop()])
fi
-else
- AC_CHECK_FUNCS( gai_strerror )
-
+elif test $ol_enable_ipv6 != no ; then
AC_CACHE_CHECK([INET6_ADDRSTRLEN],[ol_cv_inet6_addrstrlen],[
AC_EGREP_CPP(__has_inet6_addrstrlen__,[
# include <netinet/in.h>
OL_NT_THREADS
if test "$ol_cv_nt_threads" = yes ; then
- ol_link_threads=nt
- ol_with_threads=found
- ol_with_yielding_select=yes
+ 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
fi
- elif test $ac_cv_header_cthreads_h = yes ; then
+ elif test $ac_cv_header_cthreads_h = yes ; then
dnl Hurd variant of Mach Cthreads
dnl uses <cthreads.h> and -lthreads
dnl dnl check for reentrant/threadsafe functions
dnl dnl
dnl dnl note: these should only be used when linking
-dnl dnl with $LTHREAD_LIBS
+dnl dnl with $LTHREAD_LIBS
dnl dnl
dnl save_CPPFLAGS="$CPPFLAGS"
dnl save_LIBS="$LIBS"
dnl ----------------------------------------------------------------
if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
- LINK_BINS_DYNAMIC="yes"
+ BUILD_LIBS_DYNAMIC=shared
+ AC_DEFINE(LDAP_LIBS_DYNAMIC, 1, [define if LDAP libs are dynamic])
else
- LINK_BINS_DYNAMIC="no"
+ BUILD_LIBS_DYNAMIC=static
fi
dnl ----------------------------------------------------------------
AC_CHECK_LIB($lib,main,
[have_tcl=yes
if test x"$ol_with_tcl_module" = "xstatic" ; then
- SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
+ SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
else
- MOD_TCL_LIB="-l${lib}"
+ MOD_TCL_LIB="-l${lib}"
fi;break],[have_tcl=no])
done
fi
dnl ----------------------------------------------------------------
dnl Check for entropy sources
-if test $cross_compiling != yes ; then
+if test $cross_compiling != yes -a $ac_cv_mingw32 != yes ; then
dev=no
if test -r /dev/urandom ; then
dev="/dev/urandom";
lockf \
memcpy \
memmove \
+ mkstemp \
+ mktemp \
pipe \
read \
recv \
AC_REPLACE_FUNCS(getopt)
if test "$ac_cv_func_getopt" != yes; then
- LIBSRCS="$LIBSRCS getopt.c"
+ LIBSRCS="$LIBSRCS getopt.c"
fi
dnl ----------------------------------------------------------------
BUILD_BDB=mod
BUILD_BDB_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
fi
fi
BUILD_DNSSRV=mod
BUILD_DNSSRV_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
fi
fi
BUILD_LDAP=mod
BUILD_LDAP_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
fi
fi
BUILD_LDBM=mod
BUILD_LDBM_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
fi
fi
BUILD_META=mod
BUILD_META_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
fi
fi
BUILD_MONITOR=mod
BUILD_MONITOR_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
fi
fi
BUILD_PASSWD=mod
BUILD_PASSWD_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
fi
fi
BUILD_PERL=mod
BUILD_PERL_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
fi
fi
BUILD_SHELL=mod
BUILD_SHELL_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
fi
fi
BUILD_TCL=mod
BUILD_TCL_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
fi
fi
BUILD_SQL=mod
BUILD_SQL_DYNAMIC=shared
SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
+ SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
+ else
+ SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
fi
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
+dnl
+dnl For Windows build, we don't want to include -dlopen flags.
+dnl They hurt more than they help.
+dnl
if test "$ac_cv_mingw32" = yes ; then
- PLAT=NT
- DYN_EXT=dll
+ PLAT=NT
+ SLAPD_MODULES_LDFLAGS=
+ SLAPD_MODULES_LIST=
else
- PLAT=UNIX
- DYN_EXT=so
+ PLAT=UNIX
fi
AC_SUBST(LIBSRCS)
-
AC_SUBST(PLAT)
-AC_SUBST(LIB_LINKAGE)
-AC_SUBST(LT_LIB_LINKAGE)
-AC_SUBST(DYN_EXT)
+AC_SUBST(BUILD_LIBS_DYNAMIC)
AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_BDB)
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)
AC_SUBST(SLAPD_MODULES_LIST)
+AC_SUBST(SLAPD_STATIC_BACKENDS)
+AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
+
AC_SUBST(PERL_CPPFLAGS)
AC_SUBST(SLAPD_PERL_LDFLAGS)
AC_SUBST(MOD_PERL_LDFLAGS)
libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk \
libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk \
libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk \
-libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
+libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \