Page MenuHomePhorge

configure.in
No OneTemporary

Authored By
Unknown
Size
14 KB
Referenced Files
None
Subscribers
None

configure.in

dnl Process this file with autoconf to produce a configure script.
AC_INIT(imap/imapd.c)
AC_CHECK_PROG(HAVE_MAKEDEPEND,makedepend,yes)
if test "$HAVE_MAKEDEPEND" != "yes"; then
AC_MSG_ERROR(Makedepend is not installed on this system. First compile and install the version in the makedepend subdirectory.)
fi
AC_ARG_WITH(cyrus-prefix,[ --with-cyrus-prefix=DIR use DIR as cyrus install directory],
cyrus_prefix="$withval",cyrus_prefix="/usr/cyrus")
AC_SUBST(cyrus_prefix)
AC_ARG_WITH(cyrus-user,[ --with-cyrus-user=USERID use USERID cyrus userid],
cyrus_user="$withval",cyrus_user="cyrus")
AC_SUBST(cyrus_user)
AC_ARG_WITH(cyrus-group,[ --with-cyrus-group=GROUPID use GROUPID cyrus group],
cyrus_group="$withval",cyrus_group="mail")
AC_SUBST(cyrus_group)
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_AIX
AC_ISC_POSIX
AC_PROG_AWK
AC_C_CONST
AC_SYS_LONG_FILE_NAMES
if test $ac_cv_sys_long_file_names = no; then
AC_MSG_ERROR(The Cyrus IMAPD requires support for long file names)
fi
AC_CHECK_HEADERS(unistd.h)
AC_REPLACE_FUNCS(memmove strcasecmp ftruncate strerror)
AC_HEADER_DIRENT
AC_SUBST(CPPFLAGS)
AC_SUBST(PRE_SUBDIRS)
AC_SUBST(EXTRA_SUBDIRS)
AC_SUBST(DEPLIBS)
AC_FUNC_VPRINTF
dnl for et routines
AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR),AC_DEFINE(NEED_SYS_ERRLIST))
dnl Bunch of setproctitle stuff
spt_type=""
AC_CHECK_FUNC(setproctitle,spt_type=SPT_BUILTIN)
if test "$spt_type" = ""; then
dnl BSD/OS and FreeBSD put it in -lutil
AC_CHECK_LIB(util,setproctitle,spt_type=SPT_BUILTIN
LIBS="${LIBS} -lutil")
fi
if test "$spt_type" = ""; then
AC_CHECK_HEADER(sys/pstat.h,spt_type=SPT_PSTAT)
fi
if test "$spt_type" = ""; then
AC_CHECK_HEADER(sys/sysnews.h,spt_type=SPT_SYSMIPS)
fi
if test "$spt_type" = ""; then
AC_MSG_CHECKING(for PS_STRINGS)
AC_CACHE_VAL(cyrus_cv_sys_psstrings, AC_TRY_CPP([
#include <machine/vmparam.h>
#include <sys/exec.h>
#ifndef PS_STRINGS
#include </nonexistent>
#endif],cyrus_cv_sys_psstrings=yes,cyrus_cv_sys_psstrings=no))
if test $cyrus_cv_sys_psstrings = yes; then
spt_type=SPT_PSSTRINGS
fi
AC_MSG_RESULT($cyrus_cv_sys_psstrings)
fi
if test "$spt_type" = ""; then
AC_MSG_CHECKING(for SCO)
AC_CACHE_VAL(cyrus_cv_sys_sco, AC_TRY_CPP([
#ifndef _SCO_unix_
#include </nonexistent>
#endif],cyrus_cv_sys_sco=yes,cyrus_cv_sys_sco=no))
if test $cyrus_cv_sys_sco = yes; then
spt_type=SPT_SCO
fi
AC_MSG_RESULT($cyrus_cv_sys_sco)
fi
if test "$spt_type" = ""; then
AC_MSG_CHECKING(for setproctitle usability)
AC_CACHE_VAL(cyrus_cv_sys_setproctitle, AC_TRY_CPP([
#if defined(DGUX) || defined(_SEQUENT_) || defined(apollo)
#include </nonexistent>
#endif],cyrus_cv_sys_setproctitle=yes,cyrus_cv_sys_setproctitle=no))
if test $cyrus_cv_sys_setproctitle = no; then
spt_type=SPT_NONE
fi
AC_MSG_RESULT($cyrus_cv_sys_setproctitle)
fi
if test "$spt_type" != ""; then
AC_DEFINE_UNQUOTED(SPT_TYPE,$spt_type)
fi
AC_MSG_CHECKING(nonblocking method)
AC_CACHE_VAL(cyrus_cv_sys_nonblock,AC_TRY_LINK([#include <sys/types.h>
#include <sys/file.h>
#include <fcntl.h>
#ifndef FNDELAY
#define FNDELAY O_NDELAY
#endif],[fcntl(0, F_GETFL, 0)&FNDELAY],
cyrus_cv_sys_nonblock=fcntl,cyrus_cv_sys_nonblock=ioctl))
WITH_NONBLOCK=$cyrus_cv_sys_nonblock
AC_SUBST(WITH_NONBLOCK)
AC_MSG_RESULT($WITH_NONBLOCK)
AC_MSG_CHECKING(timezone GMT offset method)
AC_CACHE_VAL(cyrus_cv_struct_sys_gmtoff,AC_TRY_COMPILE([
#include <time.h>],[struct tm tm;
tm.tm_gmtoff = 0;
],cyrus_cv_struct_sys_gmtoff=tm,cyrus_cv_struct_sys_gmtoff=gmtime))
WITH_GMTOFF=$cyrus_cv_struct_sys_gmtoff
AC_SUBST(WITH_GMTOFF)
AC_MSG_RESULT($WITH_GMTOFF)
AC_MSG_CHECKING(for shared mmap)
AC_CACHE_VAL(cyrus_cv_func_mmap_shared,AC_TRY_RUN([
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
main() {
char *base;
int fd = open("conftestmmap", O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd == -1) exit(1);
if (write(fd, "test", 4) != 4) exit(1);
fsync(fd);
base = mmap((caddr_t)0, 100, PROT_READ, MAP_SHARED
#ifdef MAP_FILE
| MAP_FILE
#endif
#ifdef MAP_VARIABLE
| MAP_VARIABLE
#endif
, fd, 0L);
if (base == (caddr_t)-1) exit(1);
if (strncmp(base, "test", 4) != 0) exit(1);
if (write(fd, "test", 4) != 4) exit(1);
fsync(fd);
if (strncmp(base+4, "test", 4) != 0) exit(1);
exit(0);}
],cyrus_cv_func_mmap_shared=yes,cyrus_cv_func_mmap_shared=no,
cyrus_cv_func_mmap_shared=no))
AC_MSG_RESULT($cyrus_cv_func_mmap_shared)
if test $cyrus_cv_func_mmap_shared = yes; then
WITH_MAP="shared"
else
AC_MSG_CHECKING(for stupid shared mmap)
AC_CACHE_VAL(cyrus_cv_func_mmap_stupidshared,AC_TRY_RUN([
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
main() {
char *base;
int fd = open("conftestmmap", O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd == -1) exit(1);
if (write(fd, "test", 4) != 4) exit(1);
fsync(fd);
base = mmap((caddr_t)0, 4, PROT_READ, MAP_SHARED
#ifdef MAP_FILE
| MAP_FILE
#endif
#ifdef MAP_VARIABLE
| MAP_VARIABLE
#endif
, fd, 0L);
if (base == (caddr_t)-1) exit(1);
if (strncmp(base, "test", 4) != 0) exit(1);
lseek(fd, 0L, 0);
if (write(fd, "xyzz", 4) != 4) exit(1);
fsync(fd);
if (strncmp(base, "xyzz", 4) != 0) exit(1);
exit(0);}
],cyrus_cv_func_mmap_stupidshared=yes,cyrus_cv_func_mmap_stupidshared=no,
cyrus_cv_func_mmap_stupidshared=no))
AC_MSG_RESULT($cyrus_cv_func_mmap_stupidshared)
if test $cyrus_cv_func_mmap_stupidshared = yes; then
WITH_MAP="stupidshared"
else
AC_MSG_CHECKING(for non-shared mmap)
AC_CACHE_VAL(cyrus_cv_func_mmap_private,AC_TRY_RUN([
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
main() {int fd = open("conftestmmap", O_RDWR|O_CREAT, 0666);
if (fd == -1) exit(1);
if (write(fd, "test", 4) != 4) exit(1);
if (mmap((caddr_t)0, 4, PROT_READ, MAP_PRIVATE
#ifdef MAP_FILE
| MAP_FILE
#endif
#ifdef MAP_VARIABLE
| MAP_VARIABLE
#endif
, fd, 0L) == (caddr_t)-1)
exit(1);exit(0);}
],cyrus_cv_func_mmap_private=yes,cyrus_cv_func_mmap_private=no,
cyrus_cv_func_mmap_private=no))
AC_MSG_RESULT($cyrus_cv_func_mmap_private)
if test $cyrus_cv_func_mmap_private = yes; then
AC_MSG_WARN(*** mmap() does not adequately support shared memory)
AC_MSG_WARN(*** Expect a performance penalty)
WITH_MAP=private
else
AC_MSG_WARN(*** This system does not have a working mmap())
AC_MSG_WARN(*** Expect a considerable performance penalty)
WITH_MAP=nommap
fi
fi
fi
AC_SUBST(WITH_MAP)
AC_ARG_WITH(lock,[ --with-lock=METHOD force use of METHOD for locking
METHOD is flock or fcntl],WITH_LOCK="$withval",
AC_CHECK_FUNC(flock,WITH_LOCK="flock",WITH_LOCK="fcntl"))
AC_SUBST(WITH_LOCK)
AC_ARG_WITH(afs,[ --with-afs=PATH use AFS libraries from PATH],
[with_afs="${withval}"
CFLAGS="${CFLAGS} -I${withval}/include"],with_afs="/usr/local")
AC_MSG_CHECKING(for Kerberos)
AC_CACHE_VAL(cyrus_cv_lib_kerberos, if test -f /etc/krb.conf; then
cyrus_cv_lib_kerberos=yes
else
cyrus_cv_lib_kerberos=no
fi)
AC_MSG_RESULT($cyrus_cv_lib_kerberos)
AC_ARG_WITH(login,[ --with-login=METHOD use login module METHOD
METHOD is unix, unix_shadow, or krb],
WITH_LOGIN="$withval",
if test $cyrus_cv_lib_kerberos = yes; then
echo using Kerberos authentication
WITH_LOGIN=krb
elif test -f /etc/shadow -o -f /etc/spwd.db; then
echo using unix pwcheck daemon authentication. See pwcheck/README
WITH_LOGIN=unix_pwcheck
else
echo using unix /etc/passwd authentication
WITH_LOGIN=unix
fi)
AC_SUBST(WITH_LOGIN)
case "$WITH_LOGIN" in
unix|unix_*) AC_CHECK_LIB(crypt, crypt);;
esac
case "$WITH_LOGIN" in
*_pwcheck) EXTRA_SUBDIRS="${EXTRA_SUBDIRS} pwcheck"
EXTRA_OUTPUT="${EXTRA_OUTPUT} pwcheck/Makefile"
AC_ARG_WITH(pwcheck,
[ --with-pwcheck=METHOD use pwcheck module METHOD
METHOD is getspnam or getpwnam],
WITH_PWCHECK="$withval",
AC_CHECK_FUNC(getspnam,WITH_PWCHECK="getspnam",
WITH_PWCHECK="getpwnam"))
AC_SUBST(WITH_PWCHECK)
;;
esac
AC_ARG_WITH(auth,[ --with-auth=METHOD use authorization module METHOD
METHOD is unix or krb],[WITH_AUTH="$withval"
with_login_base=`echo ${WITH_LOGIN}|sed 's/_.*//'`
case "$withval" in
${with_login_base}) true;;
${with_login_base}_*) true;;
*) AC_MSG_ERROR(Authorization module incompatibile with login module);;
esac],
if test -f ${srcdir}/lib/auth_${WITH_LOGIN}.c; then
WITH_AUTH="$WITH_LOGIN"
else
WITH_AUTH=`echo $WITH_LOGIN | sed 's/_.*$//'`
fi)
AC_SUBST(WITH_AUTH)
if test "$WITH_AUTH" = krb_pts; then
EXTRA_SUBDIRS="${EXTRA_SUBDIRS} ptclient"
EXTRA_OUTPUT="${EXTRA_OUTPUT} ptclient/Makefile"
AC_DEFINE_UNQUOTED(CYRUS_PATH,"$cyrus_prefix")
AFSLIBS="${with_afs}/lib/afs/libkauth.a ${with_afs}/lib/afs/libprot.a ${with_afs}/lib/afs/libauth.a ${with_afs}/lib/afs/libsys.a ${with_afs}/lib/librxkad.a ${with_afs}/lib/librx.a ${with_afs}/lib/libubik.a ${with_afs}/lib/liblwp.a ${with_afs}/lib/afs/util.a"
if test -f ${with_afs}/lib/afs/libaudit.a; then
AFSLIBS="$AFSLIBS ${with_afs}/lib/afs/libaudit.a"
fi
if test -f /usr/ucblib/libucb.a; then
AFSLIBS="$AFSLIBS -R/usr/ucblib -L/usr/ucblib -lucb"
fi
AC_SUBST(AFSLIBS)
fi
TCL_SUBDIRS="cyradm"
AC_ARG_ENABLE(cyradm,
[ --disable-cyradm disable compling cyradm],
if test "$enableval" = no; then
TCL_SUBDIRS=""
fi)
if test -n "$TCL_SUBDIRS"; then
EXTRA_OUTPUT="${EXTRA_OUTPUT} cyradm/Makefile"
fi
AC_SUBST(TCL_SUBDIRS)
dnl
dnl XXX MUST CHECK FOR TCL BEFORE KERBEROS V4 XXX
dnl This is because some genius at MIT named one of the Kerberos v4
dnl library functions log(). This of course conflicts with the
dnl logarithm function in the standard math library, used by Tcl.
dnl
dnl Checking for Tcl first puts -lm before -lkrb on the library list.
dnl
AC_ARG_WITH(tcl,[ --with-tcl=PATH use Tcl from PATH],
with_tcl="${withval}")
if test -z "$with_tcl"; then
if test -f /usr/local/lib/libtcl.a; then
with_tcl="/usr/local"
fi
fi
case "$with_tcl" in
no) if test "$TCL_SUBDIRS" != ""; then
AC_MSG_ERROR(Could not find Tcl libraries. You must either install Tcl or configure with --disable-cyradm)
fi;;
""|yes) AC_CHECK_LIB(tcl,Tcl_Init,LIBS="${LIBS} -ltcl -lm",
[if test "$TCL_SUBDIRS" != ""; then
AC_MSG_ERROR(Could not find Tcl libraries. You must either install Tcl or configure with --disable-cyradm)
fi],-lm) ;;
*) CPPFLAGS="${CPPFLAGS} -I${with_tcl}/include"
LIBS="${LIBS} ${with_tcl}/lib/libtcl.a -lm" ;;
esac
dnl
dnl Test for Zephyr
dnl
AC_ARG_WITH(zephyr,[ --with-zephyr=PATH use Zephyr from PATH],
with_zephyr="${withval}")
if test -z "$with_zephyr"; then
if test -f /usr/local/lib/libzephyr.a; then
with_zephyr="/usr/local"
fi
fi
case "$with_zephyr" in
no) true;;
""|yes) AC_CHECK_LIB(zephyr,ZInitialize,LIBS="${LIBS} -lzephyr",
with_zephyr="no",);;
*) CPPFLAGS="${CPPFLAGS} -I${with_zephyr}/include"
LIBS="${LIBS} ${with_zephyr}/lib/libzephyr.a";;
esac
AC_ARG_WITH(notify,[ --with-notify=METHOD use mail notification METHOD
METHOD is zephyr or no],WITH_NOTIFY="${withval}",
if test "$with_zephyr" = "no"; then
WITH_NOTIFY=no
else
WITH_NOTIFY=zephyr
fi)
AC_SUBST(WITH_NOTIFY)
if test "$with_zephyr" = "no"; then
if test "$WITH_NOTIFY" = "zephyr"; then
AC_MSG_ERROR(Unable to find Zephyr libraries)
fi
fi
dnl
dnl Test for Kerberos
dnl
AC_ARG_WITH(krb,[ --with-krb=PATH use Kerberos from PATH],
with_krb="${withval}")
if test -z "$with_krb"; then
if test -f /usr/local/lib/libkrb.a -a -f /usr/local/lib/libdes.a; then
with_krb="/usr/local"
fi
fi
case "$with_krb" in
no) true;;
""|yes) AC_CHECK_LIB(krb,des_ecb_encrypt,
[LIBS="${LIBS} -lkrb -ldes"
if test -d /usr/include/kerberosIV; then
CFLAGS="${CFLAGS} -I/usr/include/kerberosIV"
fi],
with_krb="no",-ldes);;
*) if test -f ${with_krb}/lib/libdes.a; then
CPPFLAGS="${CPPFLAGS} -I${with_krb}/include"
LIBS="${LIBS} ${with_krb}/lib/libkrb.a ${with_krb}/lib/libdes.a"
else
AC_MSG_ERROR(The Kerberos DES library is required for Kerberos support)
fi;;
esac
if test "$with_krb" = "no"; then
if test "$WITH_LOGIN" = "krb"; then
AC_MSG_ERROR(Unable to find Kerberos/DES libraries)
fi
else
AC_DEFINE(HAVE_ACTE_KRB)
LIBOBJS="${LIBOBJS} acte_krb.o";
fi
dnl
dnl Look for inn
dnl
AC_ARG_WITH(inn,[ --with-inn=PATH use INN from PATH],
INNSHELLVARS="$withval/innshellvars",[
echo checking for inn
if test -f /usr/local/news/innshellvars; then
INNSHELLVARS=/usr/local/news/innshellvars
elif test -f /usr/lib/news/innshellvars; then
INNSHELLVARS=/usr/lib/news/innshellvars
elif test -f /usr/news/innshellvars; then
INNSHELLVARS=/usr/news/innshellvars
else
echo "did not find inn, don't worry"
INNSHELLVARS=/did/not/find/innshellvars
fi])
AC_SUBST(INNSHELLVARS)
AC_ARG_ENABLE(privacy,
[ --disable-privacy disable network privacy support],
if test "$enableval" = no; then
AC_DEFINE(NOPRIVACY)
fi)
AC_MSG_CHECKING(for modern syslog)
AC_CACHE_VAL(cyrus_cv_lib_syslog, AC_TRY_CPP([#include <syslog.h>
#ifndef LOG_LOCAL6
#include </nonexistent>
#endif],cyrus_cv_lib_syslog=yes,cyrus_cv_lib_syslog=no))
if test $cyrus_cv_lib_syslog = no; then
PRE_SUBDIRS="${PRE_SUBDIRS} syslog"
EXTRA_OUTPUT="${EXTRA_OUTPUT} syslog/Makefile"
DEPLIBS="${DEPLIBS} ../syslog/libsyslog.a"
CPPFLAGS="$CPPFLAGS -I\$(srcdir)/../syslog"
fi
AC_MSG_RESULT($cyrus_cv_lib_syslog)
AC_ARG_ENABLE(amssync,
[ --enable-amssync enable AMS bboard sync support],
if test "$enableval" = yes; then
EXTRA_SUBDIRS="${EXTRA_SUBDIRS} amssync"
EXTRA_OUTPUT="${EXTRA_OUTPUT} amssync/Makefile"
AC_CHECK_LIB(ossup, strchr, LIBS="${LIBS} -lossup")
fi)
dnl Have to check getdtabalesize after adding ossup, as some ossup's define it
AC_REPLACE_FUNCS(getdtablesize)
AC_ARG_ENABLE(cmulocal,
[ --enable-cmulocal enable CMU-specific local support],
if test "$enableval" = yes; then
EXTRA_SUBDIRS="${EXTRA_SUBDIRS} cmulocal"
EXTRA_OUTPUT="${EXTRA_OUTPUT} cmulocal/Makefile"
fi)
AC_ARG_ENABLE(experiment,
[ --enable-experiment enable experimental code (gurus only)],
if test "$enableval" = yes; then
AC_DEFINE(ENABLE_EXPERIMENT)
fi)
dnl
dnl Random other libraries
dnl
AC_CHECK_LIB(ndbm, dbm_open)
AC_CHECK_LIB(dbm, dbm_open)
AC_CHECK_LIB(db, dbopen)
AC_CHECK_LIB(dld, shl_load, LIBS="${LIBS} -ldld")dnl HPUX needs this for Tcl
AC_CHECK_LIB(dl, dlopen, LIBS="${LIBS} -ldl")dnl Solaris needs this for Tcl
AC_CHECK_LIB(socket, accept, LIBS="${LIBS} -lsocket -lnsl",,-lnsl)
AC_CHECK_LIB(iberty, index, LIBS="${LIBS} -liberty")
AC_OUTPUT(Makefile man/Makefile et/Makefile lib/Makefile imap/Makefile imap/feedcyrus imtest/Makefile $EXTRA_OUTPUT)

File Metadata

Mime Type
text/x-c
Expires
Sat, Apr 4, 1:48 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18822018
Default Alt Text
configure.in (14 KB)

Event Timeline