Skip to content
Snippets Groups Projects
configure.in 78.2 KiB
Newer Older
  • Learn to ignore specific revisions
  • struct request_info *req;
    		],[
    hosts_access(req)
    		],[AC_MSG_RESULT([-lwrap])
    		have_wrappers=yes
    		LIBS="$save_LIBS"],[
    		dnl try with -lnsl
    		LIBS="$LIBS -lnsl"
    		AC_TRY_LINK([
    #include <tcpd.h>
    
    int allow_severity = 0;
    int deny_severity  = 0;
    
    
    struct request_info *req;
    		],[
    hosts_access(req)
    		],[AC_MSG_RESULT([-lwrap -lnsl])
    		have_wrappers=yes
    		LIBS="$save_LIBS -lnsl"],[
    		AC_MSG_RESULT(no)
    		have_wrappers=no
    		LIBS=$save_LIBS])],[
    		have_wrappers=no])],[have_wrappers=no])
    
    
    	if test $have_wrappers = yes ; then
    
    		AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
    
    	elif test $ol_enable_wrappers = yes ; then
    		AC_MSG_ERROR([could not find TCP wrappers, select apppropriate options ore disable])
    
    		AC_MSG_WARN([could not find TCP wrappers, support disabled])
    
    dnl ----------------------------------------------------------------
    
    if test $ol_enable_syslog != no ; then
    	AC_CHECK_FUNC(openlog)
    	if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
    		AC_MSG_ERROR(could not find syslog, select appropriate options or disable)
    	fi
    	ol_enable_syslog=$ac_cv_func_openlog
    fi
    
    
    dnl ----------------------------------------------------------------
    
    dnl dmalloc support (deprecated in favor of -DCSRIMALLOC support)
    dnl if test $ol_enable_dmalloc != no ; then
    dnl 	AC_CHECK_HEADERS(dmalloc.h)
    dnl 	AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
    dnl fi
    
    
    dnl ----------------------------------------------------------------
    dnl SQL
    ol_link_sql=no
    if test $ol_enable_sql != no ; then
    	AC_CHECK_LIB(iodbc,SQLDriverConnect,[have_iodbc=yes],[have_iodbc=no])
    	if test $have_iodbc = yes ; then
    		ol_link_sql="-liodbc"
    	else
    		AC_CHECK_LIB(odbc,SQLDriverConnect,[have_odbc=yes],[have_odbc=no])
    		if test $have_odbc = yes ; then
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    			ol_link_sql="-lodbc"
    
    		fi
    	fi
    
    	if test $ol_link_sql != no ; then
    		SLAPD_SQL_LIBS="$ol_link_sql"
    
    	elif test $ol_enable_sql != auto ; then
    		AC_MSG_ERROR([could not locate suitable ODBC library])
    	fi
    fi
    
    
    dnl ----------------------------------------------------------------
    dnl TCL
    
    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
    
    		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
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    					SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    					MOD_TCL_LIB="-l${lib}"
    
    	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
    
    
    dnl ----------------------------------------------------------------
    dnl ud needs termcap (should insert check here)
    
    ol_link_termcap=no
    AC_CHECK_HEADERS(termcap.h ncurses.h)
    
    if test $ol_link_termcap = no ; then
    	AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
    	if test $have_termcap = yes ; then
    
    		AC_DEFINE(HAVE_TERMCAP, 1, [define if you have -ltermcap])
    
    		ol_link_termcap=yes
    		TERMCAP_LIBS=-ltermcap
    	fi
    fi
    
    if test $ol_link_termcap = no ; then
    	AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
    	if test $have_ncurses = yes ; then
    
    		AC_DEFINE(HAVE_NCURSES, 1, [define if you have -lncurses])
    
    		ol_link_termcap=yes
    		TERMCAP_LIBS=-lncurses
    	fi
    fi
    
    if test $ol_link_termcap = no ; then
    
    	AC_DEFINE(NO_TERMCAP,1, [define if you have no termcap support])
    
    	TERMCAP_LIBS=
    fi
    
    
    dnl ----------------------------------------------------------------
    
    dnl
    ol_link_sasl=no
    
    if test $ol_with_cyrus_sasl != no ; then
    
    	AC_CHECK_HEADERS(sasl/sasl.h sasl.h)
    
    	if test $ac_cv_header_sasl_sasl_h = yes -o $ac_cv_header_sasl_h = yes; then
    
    Howard Chu's avatar
    Howard Chu committed
    		AC_CHECK_LIB(sasl2, sasl_client_init,
    
    			[ol_link_sasl="-lsasl2"],
    			[AC_CHECK_LIB(sasl, sasl_client_init,
    				[ol_link_sasl="-lsasl"])])
    
    	if test $ol_link_sasl = no ; then
    		if test $ol_with_cyrus_sasl != auto ; then
    			AC_MSG_ERROR([Could not locate Cyrus SASL])
    		else
    			AC_MSG_WARN([Could not locate Cyrus SASL])
    			AC_MSG_WARN([SASL authentication not supported!])
    			if test $ol_link_tls = no ; then
    				AC_MSG_WARN([Strong authentication not supported!])
    			fi
    		fi
    
    Howard Chu's avatar
    Howard Chu committed
    	else
    		AC_DEFINE(HAVE_CYRUS_SASL,1,[define if you have Cyrus SASL])
    
    Howard Chu's avatar
    Howard Chu committed
    		if test $ol_enable_spasswd != no ; then
    			ol_link_spasswd=yes
    		fi
    
    else
    	AC_MSG_WARN([SASL authentication not supported!])
    	if test $ol_link_tls = no ; then
    		AC_MSG_WARN([Strong authentication not supported!])
    
    dnl ----------------------------------------------------------------
    dnl Check for entropy sources
    
    Howard Chu's avatar
    Howard Chu committed
    if test $cross_compiling != yes -a "$ac_cv_mingw32" != 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
    dnl		should be extended to support other fetch URL APIs
    dnl
    ol_link_fetch=no
    if test $ol_with_fetch != no ; then
    	OL_LIB_FETCH
    
    	if test $ol_cv_lib_fetch != no ; then
    		LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
    		ol_link_fetch=freebsd
    
    	elif test $ol_with_fetch != auto ; then
    		AC_MSG_ERROR(no suitable API for --with-fetch=$ol_with_fetch)
    	fi 
    fi
    
    
    dnl ----------------------------------------------------------------
    
    dnl
    dnl Check for GNU readline
    dnl
    ol_link_readline=no
    if test $ol_with_readline != no ; then
    	AC_CHECK_HEADERS(readline/readline.h readline/history.h)
    
    	if test $ac_cv_header_readline_readline_h = yes ; then
    		save_LIBS="$LIBS"
    		LIBS="$TERMCAP_LIBS $LIBS"
    		AC_CHECK_LIB(readline, readline, 
    			[have_readline=yes], [have_readline=no])
    		LIBS="$save_LIBS"
    			
    		if test $have_readline = yes ; then
    			ol_with_readline=found
    			ol_link_readline=yes
    
    			READLINE_LIBS="-lreadline"
    		fi
    	fi
    fi
    
    if test $ol_link_readline = yes ; then
    	AC_DEFINE(HAVE_READLINE, 1, [define if you have -lreadline])
    fi
    
    
    
    dnl ----------------------------------------------------------------
    dnl FreeBSD (and others) have crypt(3) in -lcrypt
    
    if test $ol_enable_crypt != no ; then
    	AC_CHECK_FUNC(crypt, [have_crypt=yes], [
    		AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
    			have_crypt=yes], [have_crypt=no])])
    
    	if test $have_crypt = yes ; then
    
    		AC_DEFINE(HAVE_CRYPT,1, [define if crypt(3) is available])
    
    	else
    		AC_MSG_WARN(could not find crypt)
    		if test $ol_enable_crypt = yes ; then
    			AC_MSG_ERROR(could not find crypt, select appropriate options or disable)
    		fi
    
    		AC_MSG_WARN(disabling crypt support)
    		ol_enable_crypt=no
    	fi
    fi
    
    
    dnl ----------------------------------------------------------------
    dnl FreeBSD (and others) have setproctitle(3) in -lutil
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    if test $ol_enable_proctitle != no ; then
    	AC_CHECK_FUNC(setproctitle,	[have_setproctitle=yes], [
    		AC_CHECK_LIB(util, setproctitle,
    			[have_setproctitle=yes
    			LUTIL_LIBS="$LUTIL_LIBS -lutil"],
    			[have_setproctitle=no
    
    Howard Chu's avatar
    Howard Chu committed
    			LIBOBJS="$LIBOBJS setproctitle.o"
    			LIBSRCS="$LIBSRCS setproctitle.c"])])
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    
    	if test $have_setproctitle = yes ; then
    
    		AC_DEFINE(HAVE_SETPROCTITLE,1,
    			[define if setproctitle(3) is available])
    
    dnl ----------------------------------------------------------------
    dnl Check for SLPv2 Compliant API Library
    if test $ol_enable_slp != no ; then
    	AC_CHECK_HEADERS( slp.h )
    
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	if test $ac_cv_header_slp_h = yes ; then
    
    		AC_CHECK_LIB(slp, SLPOpen, [have_slp=yes], [have_slp=no])
    		if test $have_slp = yes ; then
    			AC_DEFINE(HAVE_SLP, 1, [define if you have -lslp])
    			SLAPD_SLP_LIBS=-lslp
    		fi
    
    	elif test $ol_enable_slp = yes ; then
    		AC_MSG_ERROR([SLP not found])
    	fi
    fi
    
    
    dnl ----------------------------------------------------------------
    dnl Checks for typedefs, structures, and compiler characteristics.
    AC_TYPE_MODE_T
    AC_TYPE_OFF_T
    AC_TYPE_PID_T
    
    AC_TYPE_SIGNAL
    AC_TYPE_SIZE_T
    
    
    AC_CHECK_TYPE(ssize_t, [signed int])
    AC_CHECK_TYPE(caddr_t,	[char *])
    
    
    AC_STRUCT_ST_BLKSIZE
    AC_HEADER_TIME
    AC_STRUCT_TM
    
    Howard Chu's avatar
    Howard Chu committed
    AC_TYPE_UID_T
    OL_TYPE_SIG_ATOMIC_T
    
    
    dnl AC_TYPE_GETGROUPS
    
    OL_STRUCT_PASSWD_PW_GECOS
    OL_STRUCT_PASSWD_PW_PASSWD
    
    
    OL_C_UPPER_LOWER
    AC_C_CONST
    
    if test $cross_compiling = yes ; then
    
    	AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
    
    else
    	AC_C_BIGENDIAN
    fi
    
    AC_COMPILE_CHECK_SIZEOF(short) 
    AC_COMPILE_CHECK_SIZEOF(int) 
    AC_COMPILE_CHECK_SIZEOF(long)
    
    
    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)
    
    AC_DEFINE(LBER_LEN_T,long)
    
    AC_DEFINE(LBER_SOCKET_T,int)
    AC_DEFINE(LBER_TAG_T,long)
    
    dnl ----------------------------------------------------------------
    dnl Checks for library functions.
    AC_FUNC_MEMCMP
    
    dnl AM_FUNC_MKTIME dnl checks for sys/time.h and unistd.h
    
    AC_FUNC_STRFTIME
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    
    
    OL_FUNC_INET_ATON
    
    
    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 check for vsnprintf
    
    	AC_CHECK_FUNCS(vsnprintf vsprintf)
    
    AC_CHECK_FUNCS(		\
    	bcopy			\
    
    	closesocket		\
    
    	flock			\
    
    	gethostname		\
    
    	lockf			\
    	memcpy			\
    	memmove			\
    
    	recv			\
    	recvfrom		\
    
    	setpwfile		\
    
    	setsid			\
    
    	signal			\
    	sigset			\
    
    	strerror		\
    
    	strrchr			\
    	strsep			\
    
    	strtol			\
    	strtoul			\
    
    Bart Hartgers's avatar
     
    Bart Hartgers committed
    	strspn			\
    
    	sysconf			\
    
    	waitpid			\
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	wait4			\
    
    dnl We actually may need to replace more than this.
    
    Howard Chu's avatar
    Howard Chu committed
    if test "$ac_cv_func_getopt" != yes; then
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	LIBSRCS="$LIBSRCS getopt.c"
    
    dnl ----------------------------------------------------------------
    # Check Configuration
    OL_SYS_ERRLIST
    
    
    dnl ----------------------------------------------------------------
    
    dnl Sort out defines
    
    
    if test "$ol_enable_debug" != no ; then
    
    	AC_DEFINE(LDAP_DEBUG,1,
    		[define this to add debugging code])
    
    if test "$ol_enable_syslog" = yes ; then
    
    	AC_DEFINE(LDAP_SYSLOG,1,
    		[define this to add syslog code])
    
    if test "$ol_enable_cache" = no ; then
    
    	AC_DEFINE(LDAP_NOCACHE,1,
    		[define this to remove -lldap cache support])
    
    if test "$ol_link_kbind" != no ; then
    
    	AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND,LDAP_VENDOR_VERSION)
    fi
    
    if test "$ol_enable_proctitle" != no ; then
    
    	AC_DEFINE(LDAP_PROCTITLE,1,
    		[define this for LDAP process title support])
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    fi
    
    if test "$ol_enable_referrals" != no ; then
    
    	AC_DEFINE(LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS,LDAP_VENDOR_VERSION)
    
    if test "$ol_enable_local" != no; then
    	AC_DEFINE(LDAP_PF_LOCAL,1,[define to support PF_LOCAL])
    
    if test "$ol_link_ipv6" != no; then
    
    	AC_DEFINE(LDAP_PF_INET6,1,[define to support PF_INET6])
    
    if test "$ol_enable_cleartext" != no ; then
    	AC_DEFINE(SLAPD_CLEARTEXT,1,[define to support cleartext passwords])
    fi
    
    if test "$ol_enable_crypt" != no ; then
    
    	AC_DEFINE(SLAPD_CRYPT,1,[define to support crypt(3) passwords])
    
    if test "$ol_link_kpasswd" != no ; then
    
    	AC_DEFINE(SLAPD_KPASSWD,1,[define to support Kerberos passwords])
    
    if test "$ol_link_spasswd" != no ; then
    	AC_DEFINE(SLAPD_SPASSWD,1,[define to support SASL passwords])
    fi
    
    dnl if test "$ol_enable_multimaster" != no ; then
    dnl	AC_DEFINE(SLAPD_MULTIMASTER,1,[define to support multimaster replication])
    dnl fi
    
    if test "$ol_enable_phonetic" != no ; then
    
    	AC_DEFINE(SLAPD_PHONETIC,1,[define to support phonetic])
    
    if test "$ol_enable_rlookups" != no ; then
    
    	AC_DEFINE(SLAPD_RLOOKUPS,1,[define to support reverse lookups])
    
    if test "$ol_enable_aci" != no ; then
    	AC_DEFINE(SLAPD_ACI_ENABLED,1,[define to support per-object ACIs])
    fi
    
    if test "$ol_link_modules" != no ; then
    
    	AC_DEFINE(SLAPD_MODULES,1,[define to support modules])
    
    	SLAPD_MODULES_LDFLAGS="-dlopen self"
    
    if test "$ol_enable_bdb" != no ; then
    	AC_DEFINE(SLAPD_BDB,1,[define to support BDB backend])
    	BUILD_SLAPD=yes
    	BUILD_BDB=yes
    	if test "$ol_with_bdb_module" != static ; then
    		AC_DEFINE(SLAPD_BDB_DYNAMIC,1,
    			[define to support dynamic BDB backend])
    		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"
    
    if test "$ol_link_dnssrv" != no ; then
    
    	AC_DEFINE(SLAPD_DNSSRV,1,[define to support DNS SRV backend])
    	BUILD_SLAPD=yes
    	BUILD_DNSSRV=yes
    	if test "$ol_with_dnssrv_module" != static ; then
    		AC_DEFINE(SLAPD_DNSSRV_DYNAMIC,1,
    			[define to support dynamic DNS SRV backend])
    		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"
    
    if test "$ol_enable_ldap" != no ; then
    
    	AC_DEFINE(SLAPD_LDAP,1,[define to support LDAP backend])
    
    	if test "$ol_with_ldap_module" != static ; then
    
    		AC_DEFINE(SLAPD_LDAP_DYNAMIC,1,
    			[define to support dynamic LDAP backend])
    
    		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"
    
    if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
    
    	AC_DEFINE(SLAPD_LDBM,1,[define to support LDBM backend])
    
    	BUILD_SLAPD=yes
    	BUILD_LDBM=yes
    
    	LDBM_LIB="-lldbm"
    
    	if test "$ol_with_ldbm_module" != static ; then
    
    		AC_DEFINE(SLAPD_LDBM_DYNAMIC,1,
    			[define to support dynamic LDBM backend])
    
    		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"
    
    if test "$ol_enable_meta" != no ; then
    	if test "$ol_enable_ldap" = no ; then
    		AC_MSG_ERROR([need --enable-ldap to use --enable-meta])
    	fi
    	if test "$ol_enable_rewrite" = no ; then
    		AC_MSG_ERROR([need --enable-rewrite to use --enable-meta])
    	fi
    	AC_DEFINE(SLAPD_META,1,[define to support LDAP Metadirectory backend])
    	BUILD_SLAPD=yes
    	BUILD_META=yes
    	if test "$ol_with_meta_module" != static ; then
    		AC_DEFINE(SLAPD_META_DYNAMIC,1,
    			[define to support dynamic LDAP Metadirectory backend])
    		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"
    
    if test "$ol_enable_monitor" != no ; then
    	AC_DEFINE(SLAPD_MONITOR,1,[define to support cn=Monitor backend])
    	BUILD_SLAPD=yes
    	BUILD_MONITOR=yes
    	if test "$ol_with_monitor_module" != static ; then
    		AC_DEFINE(SLAPD_MONITOR_DYNAMIC,1,
    			[define to support dynamic cn=Monitor backend])
    		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"
    
    if test "$ol_enable_passwd" != no ; then
    
    	AC_DEFINE(SLAPD_PASSWD,1,[define to support PASSWD backend])
    
    	BUILD_SLAPD=yes
    	BUILD_PASSWD=yes
    
    	if test "$ol_with_passwd_module" != static ; then
    
    		AC_DEFINE(SLAPD_PASSWD_DYNAMIC,1,
    			[define to support dynamic PASSWD backend])
    
    		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"
    
    if test "$ol_link_perl" != no ; then
    
    	AC_DEFINE(SLAPD_PERL,1,[define to support PERL backend])
    
    	BUILD_SLAPD=yes
    	BUILD_PERL=yes
    
    	if test "$ol_with_perl_module" != static ; then
    
    		AC_DEFINE(SLAPD_PERL_DYNAMIC,1,
    			[define to support dynamic PERL backend])
    
    		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"
    
    if test "$ol_enable_shell" != no ; then
    
    	AC_DEFINE(SLAPD_SHELL,1,[define to support SHELL backend])
    
    	BUILD_SLAPD=yes
    	BUILD_SHELL=yes
    
    	if test "$ol_with_shell_module" != static ; then
    
    		AC_DEFINE(SLAPD_SHELL_DYNAMIC,1,
    			[define to support dynamic SHELL backend])
    
    		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"
    
    if test "$ol_enable_tcl" != no ; then
    
    	AC_DEFINE(SLAPD_TCL,1,[define to support TCL backend])
    
    	if test "$ol_with_tcl_module" != static; then
    
    		AC_DEFINE(SLAPD_TCL_DYNAMIC,1,
    			[define to support dynamic TCL backend])
    
    		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"
    
    if test "$ol_link_sql" != no ; then
    
    	AC_DEFINE(SLAPD_SQL,1,[define to support SQL backend])
    	BUILD_SLAPD=yes
    	BUILD_SQL=yes
    	if test "$ol_with_sql_module" != static; then
    		AC_DEFINE(SLAPD_SQL_DYNAMIC,1,
    			[define to support dynamic SQL backend])
    		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"
    
    if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
    
    	$BUILD_SLAPD = yes ; then
    	BUILD_SLURPD=yes
    fi
    
    
    if test "$ol_enable_rewrite" != no ; then
    	AC_DEFINE(ENABLE_REWRITE,1,[define to enable rewriting in back-ldap and back-meta])
    	BUILD_REWRITE=yes
    fi
    
    
    dnl ----------------------------------------------------------------
    
    
    dnl
    dnl For Windows build, we don't want to include -dlopen flags.
    dnl They hurt more than they help.
    dnl
    
    Howard Chu's avatar
    Howard Chu committed
    
    if test "$ac_cv_mingw32" = yes ; then
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	PLAT=NT
    	SLAPD_MODULES_LDFLAGS=
    	SLAPD_MODULES_LIST=
    
    Howard Chu's avatar
    Howard Chu committed
    else
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	PLAT=UNIX
    
    Howard Chu's avatar
    Howard Chu committed
    fi
    
    AC_SUBST(LIBSRCS)
    AC_SUBST(PLAT)
    
    AC_SUBST(BUILD_LIBS_DYNAMIC)
    
    AC_SUBST(BUILD_SLAPD)
    
      AC_SUBST(BUILD_BDB)
    
      AC_SUBST(BUILD_DNSSRV)
    
      AC_SUBST(BUILD_LDBM)
    
      AC_SUBST(BUILD_META)
    
      AC_SUBST(BUILD_PASSWD)
    
      AC_SUBST(BUILD_PERL)
    
      AC_SUBST(BUILD_SHELL)
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
      AC_SUBST(BUILD_BDB_DYNAMIC)
    
      AC_SUBST(BUILD_DNSSRV_DYNAMIC)
    
      AC_SUBST(BUILD_LDAP_DYNAMIC)
      AC_SUBST(BUILD_LDBM_DYNAMIC)
    
      AC_SUBST(BUILD_META_DYNAMIC)
    
      AC_SUBST(BUILD_PASSWD_DYNAMIC)
      AC_SUBST(BUILD_PERL_DYNAMIC)
      AC_SUBST(BUILD_SHELL_DYNAMIC)
    
      AC_SUBST(BUILD_SQL_DYNAMIC)
    
      AC_SUBST(BUILD_TCL_DYNAMIC)
    
    AC_SUBST(BUILD_SLURPD)
    
    
    AC_SUBST(LDAP_LIBS)
    
    AC_SUBST(LDIF_LIBS)
    
    AC_SUBST(SLAPD_LIBS)
    AC_SUBST(SLURPD_LIBS)
    AC_SUBST(LDBM_LIBS)
    AC_SUBST(LTHREAD_LIBS)
    AC_SUBST(LUTIL_LIBS)
    
    Julio Sánchez Fernández's avatar
     
    Julio Sánchez Fernández committed
    AC_SUBST(WRAP_LIBS)
    
    AC_SUBST(SLAPD_MODULES_CPPFLAGS)
    AC_SUBST(SLAPD_MODULES_LDFLAGS)
    
    AC_SUBST(SLAPD_STATIC_BACKENDS)
    AC_SUBST(SLAPD_DYNAMIC_BACKENDS)
    
    
    AC_SUBST(SLAPD_PERL_LDFLAGS)
    
    AC_SUBST(KRB4_LIBS)
    AC_SUBST(KRB5_LIBS)
    
    AC_SUBST(SASL_LIBS)
    
    AC_SUBST(TERMCAP_LIBS)
    
    Bart Hartgers's avatar
     
    Bart Hartgers committed
    AC_SUBST(TLS_LIBS)
    
    AC_SUBST(AUTH_LIBS)
    
    AC_SUBST(SLAPD_SQL_LDFLAGS)
    AC_SUBST(SLAPD_SQL_LIBS)
    AC_SUBST(SLAPD_SQL_INCLUDES)
    
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    dnl ----------------------------------------------------------------
    dnl final help output
    AC_ARG_WITH(xxinstall,[
    See INSTALL file for further details.])
    
    
    dnl ----------------------------------------------------------------
    dnl final output
    dnl
    
    AC_OUTPUT( \
    Makefile:build/top.mk:Makefile.in:build/dir.mk \
    doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
    doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
    doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
    doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
    doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
    doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
    clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
    clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
    clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
    clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
    
    clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
    
    clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
    include/Makefile:build/top.mk:include/Makefile.in \
    libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk 	\
    
    libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk	\
    libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk	\
    libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk	\
    
    libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk	\
    
    libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk	\
    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	\
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    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 \
    
    servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
    
    servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
    
    servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
    
    servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
    
    servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
    
    servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
    servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
    servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
    
    servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
    
    servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.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:build/dir.mk \
    tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    ,[
    date > stamp-h
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    echo Please run \"make depend\" to build dependencies
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    ])