Codebase list slapi-nis / post-sch configure.ac
post-sch

Tree @post-sch (Download .tar.gz)

configure.ac @post-schraw · history · blame

AC_INIT(slapi-nis,0.0)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_LIBTOOL
AM_CONDITIONAL(GCC,[test x$GCC = xyes])
AM_MAINTAINER_MODE

AC_ARG_WITH(tcp-wrappers,
	    AS_HELP_STRING([--with-tcp-wrappers=AUTO]
	    		   [use tcp-wrappers]),
	    tcp_wrappers=$withval,tcp_wrappers=AUTO)
AC_CHECK_HEADERS(tcpd.h)
if test x$ac_cv_header_tcpd_h != xyes ; then
	if test x$tcp_wrappers = xyes ; then
		AC_MSG_ERROR([tcp-wrappers enabled but tcpd.h not found])
	elif test x$tcp_wrappers != xno ; then
		AC_MSG_WARN([tcp-wrappers enabled but tcpd.h not found])
	fi
else
	saved_LIBS="$LIBS"
	LIBS=
	AC_CHECK_FUNC(hosts_access,,AC_CHECK_LIB(wrap,hosts_access))
	LIBWRAP="$LIBS"
	LIBS="$saved_LIBS"
fi
AC_SUBST(LIBWRAP)
AC_ARG_WITH(tcp-wrappers-name,
	    AS_HELP_STRING([--with-tcp-wrappers-name=nis-plugin]
	    		   [tcp-wrappers and network service name]),
	    tcpwrapname=$withval,tcpwrapname=nis-plugin)
AC_DEFINE_UNQUOTED(DEFAULT_TCPWRAP_NAME,"$tcpwrapname",
		   [Define to the default application name to use when evaluating hosts.allow and hosts.deny.])
AC_SUBST(tcpwrapname)

AC_ARG_WITH(domain,
	    AS_HELP_STRING([--with-domain=[[example.com]]],
	    		   [select a default domain name]),
	    mydomain=$withval,
	    mydomain=example.com)
mysuffix=`echo "$mydomain" | sed -e 's:^:dc=:g' -e 's:\.:, dc=:g'`
AC_ARG_WITH(server,
	    AS_HELP_STRING([--with-server=[[dirsrv]]],
	    		   [select a specific server implementation (dirsrv)]),
	    server=$withval,
	    server=dirsrv)
case "$server" in
dirsrv)
	PKG_CHECK_MODULES(RUNTIME,nss nspr)
	saved_CFLAGS="$CFLAGS"
	saved_LIBS="$LIBS"
	CFLAGS="$CFLAGS $RUNTIME_CFLAGS"
	LIBS="$LIBS $RUNTIME_LIBS"
	AC_CHECK_HEADER(dirsrv/slapi-plugin.h,
			AC_DEFINE(HAVE_DIRSRV_SLAPI_PLUGIN_H,1,
				[Define if you have <dirsrv/slapi-plugin.h>]),,[
			#include <nspr.h>
			#include <nss.h>
			])
	if test x$ac_cv_header_dirsrv_slapi_plugin_h = xno ; then
		AC_ERROR([<dirsrv/slapi-plugin.h> not found])
	fi
	CFLAGS="$saved_CFLAGS"
	LIBS="$saved_LIBS"
	AC_DEFINE(USE_NSPR_THREADS,1,[Define to use NSPR's threading functions.])
	;;
*)
	RUNTIME_CFLAGS=
	RUNTIME_LIBS=
	AC_CHECK_HEADERS(slapi-plugin.h)
	if test x$ac_cv_header_slapi_plugin_h = xno ; then
		AC_ERROR([<slapi-plugin.h> not found])
	fi
	AC_DEFINE(USE_PTHREADS,1,[Define to use POSIX threading functions.])
	saved_LIBS="$LIBS"
	LIBS=
	AC_CHECK_FUNC(pthread_create,,AC_CHECK_LIB(pthread,pthread_create))
	LIBPTHREAD="$LIBS"
	LIBS="$saved_LIBS"
esac
AC_SUBST(LIBPTHREAD)

mylibdir=`eval echo "$libdir" | sed "s,NONE,${ac_default_prefix},g"`
mylibdir=`eval echo "$mylibdir" | sed "s,NONE,${ac_prefix},g"`
case "$server" in
dirsrv)
	myplugindir="$mylibdir/dirsrv/plugins"
	;;
openldap)
	myplugindir="$mylibdir/openldap"
	;;
*)
	myplugindir="$mylibdir/$PACKAGE"
	;;
esac

AC_SUBST(myplugindir)
AC_SUBST(mydomain)
AC_SUBST(mysuffix)

AC_ARG_WITH(users,
	    AS_HELP_STRING([--with-users=cn=Users],
	    		   [select a specific user entry container (cn=Users)]),
	    people=$withval,
	    people=[cn=Users])
AC_SUBST(people)
AC_ARG_WITH(groups,
	    AS_HELP_STRING([--with-groups=cn=Groups],
	    		   [select a specific group entry container (cn=Groups)]),
	    groups=$withval,
	    groups=[cn=Groups])
AC_SUBST(groups)

AC_DEFINE(DEFAULT_MAX_DGRAM_SIZE,YPMAXRECORD,[Define to the default maximum datagram reply size.])
AC_DEFINE(DEFAULT_MAX_VALUE_SIZE,(256 * 1024),[Define to the default maximum map entry key and value size.])
AC_DEFINE(DEFAULT_TARGET_REPLY_SIZE,(4 * 1024),[Define to the default target size for a connected reply fragment.])

AM_CONDITIONAL(NIS,true)
nisbaseattr=nis-base
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_BASE_ATTR,"$nisbaseattr",
		   [Define to name of the attribute which lists the containers for entries for a given map.])
nisfilterattr=nis-filter
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_FILTER_ATTR,"$nisfilterattr",
		   [Define to name of the attribute which holds the filter for selecting entries for a given map.])
niskeyformatattr=nis-key-format
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_KEY_ATTR,"$niskeyformatattr",
		   [Define to name of the map configuration attribute which holds the format specifier for single keys for a map entry.])
niskeysformatattr=nis-keys-format
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_KEYS_ATTR,"$niskeysformatattr",
		   [Define to name of the map configuration attribute which holds the format specifier for possibly-multiple keys for a map entry.])
nisvalueformatattr=nis-value-format
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_VALUE_ATTR,"$nisvalueformatattr",
		   [Define to name of the map configuration attribute which holds the format specifier for the value for a map entry.])
domainattr=nis-domain
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_DOMAIN_ATTR,"$domainattr",
		   [Define to name of the map configuration attribute which holds the name of the domain of the map.])
mapattr=nis-map
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_MAP_ATTR,"$mapattr",
		   [Define to name of the map configuration attribute which holds the name of the map.])
disallowedcharsattr=nis-disallowed-chars
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_DISALLOWED_CHARS_ATTR,"$disallowedcharsattr",
		   [Define to the list of characters which should not be allowed in attribute values which are being considered.])
secureattr=nis-secure
AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_SECURE_ATTR,"$secureattr",
		   [Define to name of the map configuration attribute which determines whether or not the map is treated a 'secure' map.])

AM_CONDITIONAL(SCHEMA,true)
schbaseattr=schema-compat-base
AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_BASE_ATTR,"$schbaseattr",
		   [Define to name of the attribute which lists the containers to search when locating entries to be used for constructing entries for a given container.])
schfilterattr=schema-compat-filter
AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_FILTER_ATTR,"$schfilterattr",
		   [Define to name of the attribute which holds the filter for selecting entries to be used for constructing entries for a given container.])
schentryformatattr=schema-compat-entry-format
AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_ENTRY_FORMAT_ATTR,
		   "$schentryformatattr",
		   [Define to name of the attribute which holds the format specifier used for constructing entries for a given container.])
groupattr=schema-compat-container-group
AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_GROUP_ATTR,"$groupattr",
		   [Define to name of the attribute which holds the name of the top-level container used for this set of compatibility containers.])
containerattr=schema-compat-container-name
AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_CONTAINER_ATTR,"$containerattr",
		   [Define to name of the attribute which holds the value for the compatibility container's RDN.])

maxvalue_attr=nis-max-value-size
AC_DEFINE_UNQUOTED(NIS_PLUGIN_CONFIGURATION_MAXVALUE_ATTR,"$maxvalue_attr",
		   [Define to the name of the plugin configuration attribute which holds the maximum size for a NIS entry value.])
maxdgram_attr=nis-max-dgram-size
AC_DEFINE_UNQUOTED(NIS_PLUGIN_CONFIGURATION_MAXDGRAM_ATTR,"$maxdgram_attr",
		   [Define to the name of the plugin configuration attribute which holds the maximum size for a NIS datagram response.])
securenet_attr=nis-securenet
AC_DEFINE_UNQUOTED(NIS_PLUGIN_CONFIGURATION_SECURENET_ATTR,"$securenet_attr",
		   [Define to the name of the plugin configuration attribute which holds a securenets entry.])
tcpwrapname_attr=nis-tcp-wrappers-name
AC_DEFINE_UNQUOTED(NIS_PLUGIN_CONFIGURATION_TCPWRAPNAME_ATTR,"$tcpwrapname_attr",
		   [Define to the name of the plugin configuration attribute which holds service name that will be used when evaluating hosts.allow and hosts.deny.])
port_attr=nsslapd-pluginarg0
AC_DEFINE_UNQUOTED(NIS_PLUGIN_CONFIGURATION_PORT_ATTR,"$port_attr",
		   [Define to the name of the plugin configuration attribute which holds the port which the server should use by default.  If none is specified, the server will attempt to use any available port.])
AC_SUBST(domainattr)
AC_SUBST(mapattr)
AC_SUBST(nisbaseattr)
AC_SUBST(nisfilterattr)
AC_SUBST(niskeyformatattr)
AC_SUBST(nisvalueformatattr)
AC_SUBST(maxvalue_attr)
AC_SUBST(maxdgram_attr)
AC_SUBST(securenet_attr)
AC_SUBST(tcpwrapname)
AC_SUBST(port_attr)
AC_SUBST(schbaseattr)
AC_SUBST(schfilterattr)
AC_SUBST(schentryformatattr)
AC_SUBST(groupattr)
AC_SUBST(containerattr)

AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile src/Makefile doc/nis-plugin.ldif doc/sch-plugin.ldif)