Skip to content
Snippets Groups Projects
configure.in 76.9 KiB
Newer Older

dnl ----------------------------------------------------------------
dnl SQL
ol_link_sql=no
if test $ol_enable_sql != no ; then
	AC_CHECK_HEADERS(sql.h sqlext.h,[],[
		AC_MSG_ERROR([could not locate SQL headers])
	])

	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
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
		OL_SASL_COMPAT
		if test $ol_cv_sasl_compat = no ; then
			ol_link_sasl=no
Kurt Zeilenga's avatar
Kurt Zeilenga committed
			AC_MSG_ERROR([Cyrus SASL library located but is incompatible])
Howard Chu's avatar
Howard Chu committed
		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

		ac_save_LIBS="$LIBS"
		LIBS="$LIBS $ol_link_sasl"
		AC_CHECK_FUNC(sasl_version, [AC_DEFINE(HAVE_SASL_VERSION,1,
			[define if your SASL library has sasl_version()])])
		LIBS="$ac_save_LIBS"
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
Kurt Zeilenga's avatar
Kurt Zeilenga committed
		LUTIL_LIBS="$LUTIL_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 FreeBSD (and others) have crypt(3) in -lcrypt
if test $ol_enable_crypt != no ; then
	save_LIBS="$LIBS"
	LIBS="$TLS_LIBS $LIBS"

	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])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
		AC_MSG_WARN([could not find crypt])
		if test $ol_enable_crypt = yes ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
			AC_MSG_ERROR([could not find crypt, select appropriate options or disable])
Kurt Zeilenga's avatar
Kurt Zeilenga committed
		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
			LIBOBJS="$LIBOBJS setproctitle.o"
Howard Chu's avatar
Howard Chu committed
			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.
Hallvard Furuseth's avatar
Hallvard Furuseth committed

dnl Checks for long long
AC_CACHE_CHECK([long long], ol_cv_type_long_long, [
	AC_TRY_COMPILE([], [long long x;],
		[ol_cv_type_long_long=yes],
		[ol_cv_type_long_long=no])])
if test $ol_cv_type_long_long = yes; then
	AC_DEFINE(HAVE_LONG_LONG, 1, [define if you have 'long long'])
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_MSG_WARN([Crossing compiling... all bets are off!])
	AC_DEFINE(CROSS_COMPILING, 1, [define if cross compiling])
AC_COMPILE_CHECK_SIZEOF(short) 
AC_COMPILE_CHECK_SIZEOF(int) 
AC_COMPILE_CHECK_SIZEOF(long)
AC_COMPILE_CHECK_SIZEOF(wchar_t)
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(		\
	bcopy			\
	closesocket		\
	flock			\
	gethostname		\
	lockf			\
	memcpy			\
	memmove			\
	recv			\
	recvfrom		\
	setpwfile		\
	setsid			\
	signal			\
	sigset			\
	strerror		\
	strrchr			\
	strsep			\
	strtol			\
	strtoul			\
Luke Howard's avatar
Luke Howard committed
	strtoq			\
	strtouq			\
Luke Howard's avatar
Luke Howard committed
	strtoll			\
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"
Howard Chu's avatar
Howard Chu committed
fi
if test "$ac_cv_func_getpeereid" != yes; then
	OL_MSGHDR_MSG_ACCRIGHTS
if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
	if test "$ac_cv_func_snprintf" != yes; then
		AC_DEFINE(snprintf, ber_pvt_snprintf, [define to snprintf routine])
	fi
	if test "$ac_cv_func_vsnprintf" != yes; then
		AC_DEFINE(vsnprintf, ber_pvt_vsnprintf, [define to snprintf routine])
dnl ----------------------------------------------------------------
# Check Configuration
OL_SYS_ERRLIST

dnl ----------------------------------------------------------------
dnl Sort out defines

Kurt Zeilenga's avatar
Kurt Zeilenga committed
	dnl This check is done also if --enable-modules is used;
	dnl it is duplicated here, 'cause it'd be cached anyway
	AC_CHECK_HEADERS(ltdl.h)

	if test $ac_cv_header_ltdl_h != yes ; then
		AC_MSG_ERROR([could not locate <ltdl.h>])
	fi
	AC_CHECK_LIB(ltdl, lt_dlinit, [
		SLAPI_LIBS=-lltdl
Pierangelo Masarati's avatar
Pierangelo Masarati committed
		LIBSLAPITOOLS=../libslapi.a
		AC_DEFINE(HAVE_LIBLTDL,1,[define if you have libtool -ltdl])
	],[AC_MSG_ERROR([could not locate libtool -lltdl])])

	AC_DEFINE(LDAP_SLAPI,1, [define this to add SLAPI code])
fi

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_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_spasswd" != no ; then
	AC_DEFINE(SLAPD_SPASSWD,1,[define to support SASL passwords])
fi
if test "$ol_enable_multimaster" != no ; then
	AC_DEFINE(SLAPD_MULTIMASTER,1,[define to support multimaster replication])
fi
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"
Howard Chu's avatar
Howard Chu committed
AC_DEFINE(SLAPD_MOD_STATIC,1,[statically linked module])
AC_DEFINE(SLAPD_MOD_DYNAMIC,2,[dynamically linked module])

if test "$ol_enable_bdb" != no ; then
	BUILD_SLAPD=yes
	BUILD_BDB=$ol_enable_bdb
	if test "$ol_enable_bdb" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_BDB,$MFLAG,[define to support BDB backend])
if test "$ol_enable_dnssrv" != no ; then
	BUILD_DNSSRV=$ol_enable_dnssrv
	if test "$ol_enable_dnssrv" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_DNSSRV,$MFLAG,[define to support DNS SRV backend])
Howard Chu's avatar
Howard Chu committed
if test "$ol_enable_hdb" != no ; then
	BUILD_SLAPD=yes
	BUILD_HDB=$ol_enable_hdb
	if test "$ol_enable_hdb" = mod ; then
Howard Chu's avatar
Howard Chu committed
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-hdb"
		MFLAG=SLAPD_MOD_DYNAMIC
Howard Chu's avatar
Howard Chu committed
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-hdb"
		MFLAG=SLAPD_MOD_STATIC
Howard Chu's avatar
Howard Chu committed
	fi
	AC_DEFINE_UNQUOTED(SLAPD_HDB,$MFLAG,[define to support HDB backend])
Howard Chu's avatar
Howard Chu committed
fi

if test "$ol_enable_ldap" != no ; then
	BUILD_LDAP=$ol_enable_ldap
	if test "$ol_enable_ldap" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_LDAP,$MFLAG,[define to support LDAP backend])
if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
	BUILD_SLAPD=yes
	BUILD_LDBM=$ol_enable_ldbm
	if test "$ol_enable_ldbm" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_LDBM,$MFLAG,[define to support LDBM backend])
if test "$ol_enable_meta" != no ; then
	BUILD_SLAPD=yes
	BUILD_META=$ol_enable_meta
	if test "$ol_enable_meta" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_META,$MFLAG,[define to support LDAP Metadirectory backend])
if test "$ol_enable_monitor" != no ; then
	BUILD_SLAPD=yes
	BUILD_MONITOR=$ol_enable_monitor
	if test "$ol_enable_monitor" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_MONITOR,$MFLAG,[define to support cn=Monitor backend])
if test "$ol_enable_null" != no ; then
	BUILD_SLAPD=yes
	BUILD_NULL=$ol_enable_null
	if test "$ol_enable_null" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-null"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-null"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_NULL,$MFLAG,[define to support NULL backend])
if test "$ol_enable_passwd" != no ; then
	BUILD_SLAPD=yes
	BUILD_PASSWD=$ol_enable_passwd
	if test "$ol_enable_passwd" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_PASSWD,$MFLAG,[define to support PASSWD backend])
if test "$ol_link_perl" != no ; then
	BUILD_PERL=$ol_enable_perl
	if test "$ol_enable_perl" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_PERL,$MFLAG,[define to support PERL backend])
if test "$ol_enable_relay" != no ; then
	BUILD_SLAPD=yes
	BUILD_RELAY=$ol_enable_relay
	if test "$ol_enable_relay" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-relay"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-relay"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_RELAY,$MFLAG,[define to support relay backend])
if test "$ol_enable_shell" != no ; then
Kurt Zeilenga's avatar
Kurt Zeilenga committed
	if test "$ol_link_thread" != no ; then
		AC_MSG_WARN([Use of --without-threads is recommended with back-shell])
	fi
	BUILD_SLAPD=yes
	BUILD_SHELL=$ol_enable_shell
	if test "$ol_enable_shell" = mod ; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_SHELL,$MFLAG,[define to support SHELL backend])
if test "$ol_link_sql" != no ; then
	BUILD_SQL=$ol_enable_sql
	if test "$ol_enable_sql" = mod; then
		SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
		MFLAG=SLAPD_MOD_DYNAMIC
	else
		SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
		MFLAG=SLAPD_MOD_STATIC
	AC_DEFINE_UNQUOTED(SLAPD_SQL,$MFLAG,[define to support SQL backend])
if test "$ol_enable_chain" != no ; then
	BUILD_CHAIN=$ol_enable_chain
	if test "$ol_enable_chain" = mod ; then
Pierangelo Masarati's avatar
Pierangelo Masarati committed
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS chain.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_CHAIN,$MFLAG,[define for Dynamic Group overlay])
fi

if test "$ol_enable_denyop" != no ; then
	BUILD_DENYOP=$ol_enable_denyop
	if test "$ol_enable_denyop" = mod ; then
Pierangelo Masarati's avatar
Pierangelo Masarati committed
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS denyop.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_DENYOP,$MFLAG,[define for Dynamic Group overlay])
fi

if test "$ol_enable_dyngroup" != no ; then
	BUILD_DYNGROUP=$ol_enable_dyngroup
	if test "$ol_enable_dyngroup" = mod ; then
Howard Chu's avatar
Howard Chu committed
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS dyngroup.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_DYNGROUP,$MFLAG,[define for Dynamic Group overlay])
fi

if test "$ol_enable_lastmod" != no ; then
	BUILD_LASTMOD=$ol_enable_lastmod
	if test "$ol_enable_lastmod" = mod ; then
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS lastmod.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_LASTMOD,$MFLAG,[define for Last Modification overlay])
fi

if test "$ol_enable_ppolicy" != no ; then
	BUILD_PPOLICY=$ol_enable_ppolicy
	if test "$ol_enable_ppolicy" = mod ; then
Howard Chu's avatar
Howard Chu committed
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS ppolicy.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_PPOLICY,$MFLAG,[define for Password Policy overlay])
fi

if test "$ol_enable_proxycache" != no ; then
	BUILD_PROXYCACHE=$ol_enable_proxycache
	if test "$ol_enable_proxycache" = mod ; then
Howard Chu's avatar
Howard Chu committed
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS pcache.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_PROXYCACHE,$MFLAG,[define for Proxy Cache overlay])
fi

Kurt Zeilenga's avatar
Kurt Zeilenga committed
if test "$ol_enable_rwm" != no ; then
	BUILD_RWM=$ol_enable_rwm
	if test "$ol_enable_rwm" = mod ; then
		MFLAG=SLAPD_MOD_DYNAMIC
		SLAPD_DYNAMIC_OVERLAYS="$SLAPD_DYNAMIC_OVERLAYS rwm.la"
	else
		MFLAG=SLAPD_MOD_STATIC
	fi
	AC_DEFINE_UNQUOTED(SLAPD_OVER_RWM,$MFLAG,[define for Rewrite/Remap overlay])
fi

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

if test "$ol_enable_slapi" != no ; then
	AC_DEFINE(ENABLE_SLAPI,1,[define to enable slapi library])
	BUILD_SLAPI=yes
	SLAPD_SLAPI_DEPEND=libslapi.a
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=
Howard Chu's avatar
Howard Chu committed
else
Kurt Zeilenga's avatar
Kurt Zeilenga committed
	PLAT=UNIX
if test -z "$SLAPD_STATIC_BACKENDS"; then
	SLAPD_NO_STATIC='#'
else
	SLAPD_NO_STATIC=
fi

Howard Chu's avatar
Howard Chu committed
AC_SUBST(LIBSRCS)
AC_SUBST(PLAT)
AC_SUBST(BUILD_LIBS_DYNAMIC)
AC_SUBST(BUILD_SLAPD)
Pierangelo Masarati's avatar
Pierangelo Masarati committed
dnl slapi
  AC_SUBST(BUILD_SLAPI)
  AC_SUBST(SLAPD_SLAPI_DEPEND)
Pierangelo Masarati's avatar
Pierangelo Masarati committed
dnl backends
  AC_SUBST(BUILD_BDB)
  AC_SUBST(BUILD_DNSSRV)
Howard Chu's avatar
Howard Chu committed
  AC_SUBST(BUILD_HDB)
  AC_SUBST(BUILD_LDBM)
  AC_SUBST(BUILD_META)
  AC_SUBST(BUILD_PASSWD)
  AC_SUBST(BUILD_PERL)
  AC_SUBST(BUILD_SHELL)
Pierangelo Masarati's avatar
Pierangelo Masarati committed
dnl overlays
  AC_SUBST(BUILD_CHAIN)
  AC_SUBST(BUILD_DENYOP)
Howard Chu's avatar
Howard Chu committed
  AC_SUBST(BUILD_DYNGROUP)
  AC_SUBST(BUILD_LASTMOD)
Howard Chu's avatar
Howard Chu committed
  AC_SUBST(BUILD_PPOLICY)
Howard Chu's avatar
Howard Chu committed
  AC_SUBST(BUILD_PROXYCACHE)
AC_SUBST(BUILD_SLURPD)

AC_SUBST(LDAP_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)
Howard Chu's avatar
Howard Chu committed
AC_SUBST(SLAPD_DYNAMIC_OVERLAYS)
AC_SUBST(SLAPD_PERL_LDFLAGS)
AC_SUBST(KRB4_LIBS)
AC_SUBST(KRB5_LIBS)
AC_SUBST(SASL_LIBS)
Bart Hartgers's avatar
 
Bart Hartgers committed
AC_SUBST(TLS_LIBS)
Pierangelo Masarati's avatar
Pierangelo Masarati committed
AC_SUBST(LIBSLAPI)
AC_SUBST(LIBSLAPITOOLS)
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/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/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/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 \
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 \
Howard Chu's avatar
Howard Chu committed
servers/slapd/back-hdb/Makefile:build/top.mk:servers/slapd/back-hdb/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-null/Makefile:build/top.mk:servers/slapd/back-null/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-relay/Makefile:build/top.mk:servers/slapd/back-relay/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/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
servers/slapd/slapi/Makefile:build/top.mk:servers/slapd/slapi/Makefile.in:build/lib.mk:build/lib-shared.mk  \
servers/slapd/overlays/Makefile:build/top.mk:servers/slapd/overlays/Makefile.in:build/lib.mk \
servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
Kurt Zeilenga's avatar
Kurt Zeilenga committed
tests/run \
tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
,[
Kurt Zeilenga's avatar
Kurt Zeilenga committed
chmod +x tests/run
date > stamp-h
echo Please run \"make depend\" to build dependencies
])