openldap/configure.in

381 lines
11 KiB
Plaintext

dnl Copyright 1998 The OpenLDAP Foundation. All Rights Reserved.
dnl
dnl Redistribution and use in source and binary forms are permitted only
dnl as authorized by the OpenLDAP Public License. A copy of this
dnl license is available at http://www.OpenLDAP.org/license.html or
dnl in file LICENSE in the top-level directory of the distribution.
dnl ----
dnl Configure.in for OpenLDAP
dnl
AC_INIT(include/ldap.h)
dnl
dnl
AC_PREREQ(2.10)dnl Required Autoconf version
dnl Do not use AutoConf 2.12; it produces a configuration script
dnl that causes an "internal 2K buffer" error on HPUX when run
dnl with /bin/sh. Autoconf 2.10 seems to be okay.
AC_CONFIG_AUX_DIR(build)
AC_CONFIG_HEADER(include/portable.h)dnl
dnl
dnl Start Args
AC_MSG_CHECKING(arguments)
AC_PREFIX_DEFAULT(/usr/local)
dnl General "enable" options
CF_ARG_OPTION(debug,[ --enable-debug enable debugging (yes)],[
LDAP_DEBUG=no],[LDAP_DEBUG=yes],yes)dnl
CF_ARG_OPTION(libui,[ --enable-libui enable library user interface (yes)],[
LDAP_LIBUI=no],[LDAP_LIBUI=yes],yes)dnl
CF_ARG_OPTION(cache,[ --enable-cache enable caching (yes)],[
LDAP_CACHE=no],[LDAP_CACHE=yes],yes)dnl
CF_ARG_OPTION(referrals,[ --enable-referrals enable referrals (yes)],[
LDAP_REFERRALS=no],[LDAP_REFERRALS=yes],yes)dnl
CF_ARG_OPTION(cldap,[ --enable-clapd enable connectionless ldap (no)],[
LDAP_CLDAP=yes],[LDAP_CLDAP=no],no)dnl
dnl General "with" options
AC_ARG_WITH(kerberos,[ --with-kerberos use Kerberos (no)],[
opt_kerberos=yes],[opt_kerberos=no])
AC_ARG_WITH(kerberos-afs,[ --with-kerberos-afs use AFS Kerberos (no)],[
opt_kerberos_afs=yes],[opt_kerberos_afs=no])
AC_ARG_WITH(threads,[ --with-threads use threads (yes)],[
opt_threads=yes],[opt_threads=no])
dnl Server options
dnl LDAPD OPTIONS
CF_ARG_OPTION(ldapd,[ --enable-ldapd enable building ldapd (no)],[
BUILD_LDAPD=yes],[BUILD_LDAPD=no],no)dnl
dnl SLAPD OPTIONS
CF_ARG_OPTION(slapd,[ --enable-slapd enable building slapd (yes)],[
BUILD_SLAPD=no],[BUILD_SLAPD=yes],yes)dnl
CF_ARG_OPTION(aclgroup,[ --enable-aclgroup enable ACL group support (yes)],[
SLAPD_ACLGROUP=no],[SLAPD_ALCGROUP=yes],yes)dnl
CF_ARG_OPTION(crypt,[ --enable-crypt enable crypt(3) passwords (yes)],[
SLAPD_CRYPT=no],[SLAPD_CRYPT=yes],yes)dnl
CF_ARG_OPTION(md5,[ --enable-md5 enable MD5 passwords (yes)],[
SLAPD_MD5=no],[SLAPD_MD5=yes],yes)dnl
CF_ARG_OPTION(sha1,[ --enable-sha1 enable SHA1 passwords (yes)],[
SLAPD_SHA1=no],[SLAPD_SHA1=yes],yes)dnl
CF_ARG_OPTION(wrappers,[ --enable-wrappers enable tcp wrapper support (no)],[
SLAPD_TCP_WRAPPERS=yes],[LDAP_TCP_WRAPPERS=no],no)dnl
CF_ARG_OPTION(phonetic,[ --enable-phonetic enable phonetic/soundex (no)],[
SLAPD_PHONETIC=yes],[SLAPD_PHONETIC=no],no)dnl
CF_ARG_OPTION(rlookups,[ --enable-rlookups enable reverse lookups (yes)],[
SLAPD_RLOOKUP=no],[SLAPD_RLOOKUP=yes],yes)dnl
dnl SLAPD Backend options
CF_ARG_OPTION(ldbm,[ --enable-ldbm enable ldbm backend (yes)],[
SLAPD_LDBM=no],[SLAPD_LDBM=yes],yes)dnl
CF_ARG_OPTION(passwd,[ --enable-passwd enable passwd backend (yes)],[
SLAPD_PASSWD=no],[SLAPD_PASSWD=yes],yes)dnl
CF_ARG_OPTION(shell,[ --enable-shell enable shell backend (yes)],[
SLAPD_SHELL=no],[SLAPD_SHELL=yes],yes)dnl
AC_ARG_WITH(ndbm,[ --with-ndbm use NDB for LDBM backend (any)],[
opt_ndbm=yes],[opt_ndbm=no])
AC_ARG_WITH(gdbm,[ --with-gdbm use GDBM for LDBM backend (any)],[
opt_gdbm=yes],[opt_gdbm=no])
AC_ARG_WITH(dbhash,[ --with-dbhash use Berkeley DB Hash for LDBM backend (any)],[
opt_dbhash=yes],[opt_dbhash=no])
AC_ARG_WITH(dbbtree,[ --with-dbbtree use Berkeley DB Btrees for LDBM backend (any)],[
opt_dbbtree=yes],[opt_dbbtree=no])
AC_ARG_WITH(db2,[ --with-db2 use Berkeley DB2 API (any)],[
opt_db2=yes],[opt_db2=no])
dnl SLURPD OPTIONS
CF_ARG_OPTION(slurpd,[ --enable-slurpd enable building slurpd (yes)],[
BUILD_SLURPD=no],[BUILD_SLURPD=yes],yes)dnl
AC_MSG_RESULT(done)
AC_MSG_CHECKING(LDBM preferences)
ldbm_prefer=any
if test "$opt_ndbm" = yes ; then
ldbm_prefer=ndbm
fi
if test "$opt_gdbm" = yes ; then
ldbm_prefer=gdbm
fi
if test "$opt_dbhash" = yes ; then
ldbm_prefer=dbhash
fi
if test "$opt_dbbtree" = yes ; then
ldbm_prefer=dbbtree
fi
AC_MSG_RESULT($ldbm_prefer)
if test "$BUILD_SLAPD" != "yes" ; then
BUILD_SLURPD="no"
SLAPD_LDBM="no"
SLAPD_PASSWD="no"
SLAPD_SHELL="no"
ldbm_prefer="none"
fi
dnl general LDAP arguments
LDAP_DEFS=
LDAP_LIBS=
if test "$LDAP_DEBUG" = "yes" ; then
LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
fi
if test "$LDAP_REFERRALS" = "yes" ; then
AC_DEFINE(LDAP_REFERRALS,1)
LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
fi
if test "$LDAP_CACHE" = "no" ; then
AC_DEFINE(LDAP_NOCACHE,1)
LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
fi
if test "$LDAP_CLDAP" = "yes" ; then
AC_DEFINE(LDAP_CONNECTIONLESS,1)
LDAP_DEFS="$LDAP_DEFS -DCLDAP"
fi
LTHREAD_LIBS=
if test "$opt_thread" = "no" ; then
LTHREAD_DEFS="-DNO_THREADS"
BUILD_SLURPD=no
else
LTHREAD_DEFS="-DNO_THREADS"
fi
dnl ldapd arguments
LDAPD_DEFS=
LDAPD_LIBS=
dnl slapd arguments
SLAPD_DEFS=
if test "$SLAPD_PHONETIC" = "yes" ; then
AC_DEFINE(SLAPD_PHONETIC,1)
SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
fi
if test "$SLAPD_LDBM" = "yes" ; then
dnl AC_DEFINE(SLAPD_LDBM,1)
SLAPD_DEFS="$SLAPD_DEFS -DLDAP_LDBM"
fi
if test "$SLAPD_PASSWD" = "yes" ; then
dnl AC_DEFINE(SLAPD_PASSWD,1)
SLAPD_DEFS="$SLAPD_DEFS -DLDAP_PASSWD"
fi
if test "$SLAPD_SHELL" = "yes" ; then
dnl AC_DEFINE(SLAPD_SHELL,1)
SLAPD_DEFS="$SLAPD_DEFS -DLDAP_SHELL"
fi
dnl slurpd arguments
SLURPD_DEFS=
dnl End Args
dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail,
$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc)
AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi,
$PATH:/usr/ucb)
AC_PATH_PROG(FINGER, finger, /usr/ucb/finger,
$PATH:/usr/ucb)
ldbm_use="none"
LDBM_LIB=""
LDBM_DEFS=""
if test "$SLAPD_LDBM" = "yes" ; then
if test $ldbm_prefer = any -o $ldbm_prefer = dbbtree \
-o $ldbm_prefer = dbhash ; then
AC_CHECK_FUNC(dbopen,[
ldbm_use=$ldbm_prefer
ldbm_prefer=found],[
AC_CHECK_LIB(db,dbopen,[
ldbm_use=$ldbm_prefer
ldbm_prefer=found
LDBM_LIB="-ldb"
])
])
if test $ldbm_prefer = found ; then
if test $ldbm_use = dbhash ; then
dnl AC_DEFINE(LDBM_USE_DBHASH,1)
LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_DBHASH"
else
dnl AC_DEFINE(LDBM_USE_DBBTREE,1)
LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_DBBTREE"
fi
fi
fi
if test $ldbm_prefer = any -o $ldbm_prefer = gdbm ; then
AC_CHECK_LIB(gdbm, gdbm_open,[
ldbm_use=$ldbm_prefer
ldbm_prefer=found
LDBM_LIB="-lgdbm"
dnl AC_DEFINE(LDBM_USE_GDBM,1)
LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_GDBM"
])
fi
if test $ldbm_prefer = any -o $ldbm_prefer = ndbm ; then
AC_CHECK_LIB(dbm,dbm_open,[
ldbm_use=ndbm
ldbm_prefer=found
LDBM_LIB="-ldbm"
dnl AC_DEFINE(LDBM_USE_NDBM,1)
LDBM_DEFS="$LDAP_DEFS -DLDBM_USE_NDBM"
])
fi
if test $ldbm_prefer != found ; then
AC_MSG_ERROR(could not find suitable db for $ldbm_prefer backend)
fi
if test $ldbm_use = ndbm ; then
AC_MSG_WARN(LDBM using NDBM, functionality will be limited)
fi
fi
# ud needs termcap (should insert check here)
LIBTERMCAP="-ltermcap"
AC_SUBST(LIBTERMCAP)
# FreeBSD (and others) have crypt(3) in -lcrypt
LIBCRYPT=
AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT), [
AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"
AC_DEFINE(HAVE_CRYPT)])
])
AC_SUBST(LIBCRYPT)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS( \
stddef.h \
fcntl.h \
limits.h \
malloc.h \
sgtty.h \
sys/file.h \
sys/ioctl.h \
sys/time.h \
syslog.h \
termio.h \
unistd.h \
)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM
dnl AC_C_BIGENDIAN
AC_C_CONST
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_FUNC_WAIT3
AC_CHECK_FUNCS( \
gethostname \
gettimeofday \
mktime \
select \
socket \
strdup \
strerror \
strstr \
strrchr \
strtod \
strtol \
strtoul \
memcpy \
)
AC_REPLACE_FUNCS(strdup)
# Check Configuration
CF_SYS_ERRLIST
AC_SUBST(BUILD_LDAPD)
AC_SUBST(BUILD_SLAPD)
AC_SUBST(SLAPD_LDBM)
AC_SUBST(SLAPD_PASSWD)
AC_SUBST(SLAPD_SHELL)
AC_SUBST(BUILD_SLURPD)
AC_SUBST(LDAP_DEFS)
AC_SUBST(LDAP_LIBS)
AC_SUBST(LDAPD_DEFS)
AC_SUBST(LDAPD_LIBS)
AC_SUBST(SLAPD_DEFS)
AC_SUBST(SLAPD_LIBS)
AC_SUBST(SLURPD_DEFS)
AC_SUBST(SLURPD_LIBS)
AC_SUBST(LDBM_DEFS)
AC_SUBST(LDBM_LIBS)
AC_SUBST(LTHREAD_DEFS)
AC_SUBST(LTHREAD_LIBS)
dnl AC_OUTPUT( \
dnl contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
dnl contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
dnl contrib/whois++/Makefile:build/top.mk:contrib/whois++/Makefile.in:build/rules.mk \
dnl [date > stamp-h])
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 \
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/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
clients/ud/Makefile:build/top.mk:clients/ud/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 \
libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \
libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \
libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \
libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \
libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \
libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \
servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.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 \
,[date > stamp-h])