Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120826295
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
110 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/Makefile.am b/Makefile.am
index b692114be..81699ae38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,1647 +1,1650 @@
#
# @configure_input@
#
# Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# 3. The name "Carnegie Mellon University" must not be used to
# endorse or promote products derived from this software without
# prior written permission. For permission or any legal
# details, please contact
# Carnegie Mellon University
# Center for Technology Transfer and Enterprise Creation
# 4615 Forbes Avenue
# Suite 302
# Pittsburgh, PA 15213
# (412) 268-7393, fax: (412) 268-7395
# innovation@andrew.cmu.edu
#
# 4. Redistributions of any form whatsoever must retain the following
# acknowledgment:
# "This product includes software developed by Computing Services
# at Carnegie Mellon University (http://www.cmu.edu/computing/)."
#
# CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
# FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
# AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
# OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
ACLOCAL_AMFLAGS = -I cmulocal
AM_CFLAGS = @PERL_CCCDLFLAGS@ $(COV_CFLAGS)
AM_CPPFLAGS = \
$(COM_ERR_CPPFLAGS) \
-I${top_builddir} \
-I${top_builddir}/lib \
-I${top_srcdir} \
-I${top_srcdir}/lib \
${DEFS} \
${LOCALDEFS} \
$(SASLFLAGS) \
$(SSL_CPPFLAGS)
if HAVE_LDAP
AM_CPPFLAGS += $(LDAP_CPPFLAGS)
endif # HAVE_LDAP
AM_LDFLAGS = $(COV_LDFLAGS)
BUILT_SOURCES = \
xversion.h \
imap/imap_err.c \
lib/imapopts.c
DISTCLEANFILES = \
imap/imap_err.c \
imap/imap_err.h \
imap/mupdate_err.c \
imap/mupdate_err.h \
imap/nntp_err.c \
imap/nntp_err.h \
imap/http_err.c \
imap/http_err.h \
imap/tz_err.c \
imap/tz_err.h \
com_err/et/compile_et \
perl/annotator/Makefile \
perl/annotator/Makefile.PL \
perl/imap/Makefile \
perl/imap/Makefile.PL \
perl/sieve/managesieve/Makefile \
perl/sieve/managesieve/Makefile.PL \
perl/sieve/scripts/installsieve \
perl/sieve/scripts/sieveshell \
sieve/sieve_err.c \
sieve/sieve_err.h
MAINTAINERCLEANFILES = \
doc/murder.png \
doc/netnews.png \
doc/man/cyradm.1.html \
man/imapd.conf.5 \
man/sieveshell.1 \
doc/man/sieveshell.1.html \
imap/lmtpstats.h \
imap/pushstats.h \
lib/chartable.c \
lib/imapopts.h \
sieve/addr.h \
sieve/sieve.h
SUBDIRS = .
DIST_SUBDIRS = .
dist_sysconf_DATA =
lib_LTLIBRARIES = lib/libcyrus_min.la lib/libcyrus.la
EXTRA_PROGRAMS = doc/text/htmlstrip
check_PROGRAMS =
service_PROGRAMS =
user_PROGRAMS =
CLEANFILES =
EXTRA_DIST = \
$(wildcard tools/vzic/*)
if COM_ERR
COMPILE_ET_DEP = com_err/et/compile_et
BUILT_SOURCES += com_err/et/compile_et
lib_LTLIBRARIES += com_err/et/libcyrus_com_err.la
endif # COM_ERR
bin_PROGRAMS = imtest/imtest
if SERVER
BUILT_SOURCES += \
imap/mupdate_err.c \
imap/nntp_err.c \
imap/lmtpstats.c \
imap/pushstats.c \
imap/rfc822_header.c \
imap/rfc822_header.h
lib_LTLIBRARIES += imap/libcyrus_imap.la
service_PROGRAMS += \
imap/imapd \
imap/lmtpd \
imap/pop3d \
imap/smmapd
user_PROGRAMS += \
imap/arbitron \
imap/chk_cyrus \
imap/ctl_conversationsdb \
imap/ctl_cyrusdb \
imap/ctl_deliver \
imap/ctl_mboxlist \
imap/cvt_cyrusdb \
imap/cyr_df \
imap/cyrdump \
imap/cyr_dbtool \
imap/cyr_deny \
imap/cyr_expire \
imap/cyr_info \
imap/cyr_sequence \
imap/cyr_synclog \
imap/cyr_userseen \
imap/deliver \
imap/hammer_cyrusdb \
imap/ipurge \
imap/mbexamine \
imap/mbpath \
imap/mbtool \
imap/quota \
imap/reconstruct \
if HAVE_CLAMAV
user_PROGRAMS += imap/cyr_virusscan
endif # HAVE_CLAMAV
if USE_SQUAT
service_PROGRAMS += imap/squatter
endif
if NNTPD
service_PROGRAMS += imap/nntpd
user_PROGRAMS += imap/fetchnews
endif # NNTPD
service_PROGRAMS += imap/fud
if IDLED
user_PROGRAMS += imap/idled
endif # IDLED
if MURDER
service_PROGRAMS += imap/mupdate
endif # MURDER
if HTTPD
AM_CPPFLAGS += $(HTTP_CPPFLAGS)
AM_LDFLAGS += $(HTTP_LIBS)
BUILT_SOURCES += \
imap/http_err.c \
imap/http_err.h \
imap/tz_err.c \
imap/tz_err.h
service_PROGRAMS += imap/httpd
user_PROGRAMS += \
imap/ctl_zoneinfo \
imap/dav_reconstruct
endif # HTTPD
if REPLICATION
user_PROGRAMS += imap/sync_client imap/sync_reset
service_PROGRAMS += imap/sync_server
endif # REPLICATION
if HAVE_SSL
user_PROGRAMS += imap/tls_prune
endif # HAVE_SSL
user_PROGRAMS += imap/unexpunge master/master
if SIEVE
check_PROGRAMS += notifyd/notifytest
service_PROGRAMS += notifyd/notifyd
endif # SIEVE
else # SERVER
EXTRA_DIST += \
imap/mupdate_err.c \
imap/nntp_err.c \
imap/lmtpstats.c \
imap/pushstats.c \
imap/rfc822_header.c \
imap/rfc822_header.h
if !HTTPD
EXTRA_DIST += \
imap/http_err.c \
imap/http_err.h \
imap/tz_err.c \
imap/tz_err.h
endif # HTTPD
endif # SERVER
if CMULOCAL
dist_sysconf_DATA += depot/rc.local.imap depot/rc.local.ptclient
user_PROGRAMS += netnews/remotepurge
endif # CMULOCAL
if PTCLIENT
user_PROGRAMS += ptclient/ptdump ptclient/ptexpire
service_PROGRAMS += \
ptclient/ptloader
endif # PTCLIENT
if PERL
SUBDIRS += perl/annotator perl/imap
noinst_LTLIBRARIES = perl/libcyrus.la perl/libcyrus_min.la
endif # PERL
if SIEVE
if PERL
SUBDIRS += perl/sieve/managesieve
noinst_LIBRARIES = perl/sieve/lib/libisieve.a
endif # PERL
BUILT_SOURCES += sieve/addr.c sieve/sieve.c sieve/sieve_err.c
lib_LTLIBRARIES += sieve/libcyrus_sieve.la
check_PROGRAMS += sieve/test
user_PROGRAMS += sieve/sievec sieve/sieved
if SERVER
service_PROGRAMS += timsieved/timsieved
endif # SERVER
endif # SIEVE
EXTRA_DIST += \
COPYING \
INSTALL \
README.andrew \
SMakefile \
xversion.h \
com_err/et/et_c.awk \
com_err/et/et_h.awk \
com_err/et/test1.et \
com_err/et/test2.et \
com_err/et/test_et.c \
contrib/drac_auth.patch \
contrib/sieve-spamasssassin \
contrib/fud-client.c \
contrib/deliver-notify-zephyr.patch \
contrib/add-cyrus-user \
contrib/README \
contrib/cyrus-graphtools.1.0 \
contrib/cyrus-graphtools.1.0/cgi-bin/cyrus_master.pl \
contrib/cyrus-graphtools.1.0/cgi-bin/graph_cyrus_db.pl \
contrib/cyrus-graphtools.1.0/cgi-bin/graph_cyrus_db-sum.pl \
contrib/cyrus-graphtools.1.0/html \
contrib/cyrus-graphtools.1.0/html/index.html \
contrib/cyrus-graphtools.1.0/README \
contrib/cyrus-graphtools.1.0/script \
contrib/cyrus-graphtools.1.0/script/cyrus.pl \
contrib/cyrus-graphtools.1.0/script/run \
contrib/cyrus-graphtools.1.0/script/cyrusrc \
contrib/dkim_canon_ischedule.patch \
contrib/notify_unix/notify \
contrib/notify_unix/net-server-prefork-0.01.tgz \
contrib/notify_unix/README \
contrib/notify_unix/sql_notify.pl \
contrib/notify_unix/simple_notify.pl \
contrib/squatrunner.pl \
contrib/mupdate-test.pl \
contrib/squatrunner.txt \
cunit/cacert.pem \
cunit/cert.pem \
cunit/cunit.pl \
cunit/cunit-to-junit.pl \
cunit/key.pem \
cunit/vg.supp \
doc \
imap/dav_util.h \
imap/http_err.et \
imap/imap_err.et \
imap/mupdate_err.et \
imap/nntp_err.et \
imap/rfc822_header.st \
imap/tz_err.et \
lib/charset/aliases.txt \
lib/charset/big5.t \
lib/charset/gb2312.t \
lib/charset/iso-2022-jp.t \
lib/charset/iso-2022-kr.t \
lib/charset/iso-8859-10.t \
lib/charset/iso-8859-11.t \
lib/charset/iso-8859-13.t \
lib/charset/iso-8859-14.t \
lib/charset/iso-8859-15.t \
lib/charset/iso-8859-16.t \
lib/charset/iso-8859-1.t \
lib/charset/iso-8859-2.t \
lib/charset/iso-8859-3.t \
lib/charset/iso-8859-4.t \
lib/charset/iso-8859-5.t \
lib/charset/iso-8859-6.t \
lib/charset/iso-8859-7.t \
lib/charset/iso-8859-8.t \
lib/charset/iso-8859-9.t \
lib/charset/koi8-r.t \
lib/charset/UnicodeData.txt \
lib/charset/unifix.txt \
lib/charset/us-ascii.t \
lib/charset/windows-1250.t \
lib/charset/windows-1251.t \
lib/charset/windows-1252.t \
lib/charset/windows-1255.t \
lib/charset/windows-1256.t \
lib/imapoptions \
lib/test/cyrusdb.c \
lib/test/cyrusdb.INPUT \
lib/test/cyrusdblong.INPUT \
lib/test/cyrusdblong.OUTPUT \
lib/test/cyrusdb.OUTPUT \
lib/test/cyrusdbtxn.INPUT \
lib/test/cyrusdbtxn.OUTPUT \
lib/test/pool.c \
lib/test/rnddb.c \
lib/test/testglob2.c \
master/CYRUS-MASTER.mib \
master/conf/cmu-backend.conf \
master/conf/cmu-frontend.conf \
master/conf/normal.conf \
master/conf/prefork.conf \
master/conf/small.conf \
master/README \
netnews/inn.diffs \
perl/annotator/Daemon.pm \
perl/annotator/Makefile.PL.in \
perl/annotator/MANIFEST \
perl/annotator/Message.pm \
perl/annotator/README \
perl/imap/Changes \
perl/imap/cyradm.sh \
perl/imap/cyrperl.h \
perl/imap/Cyrus/Shell.pm \
perl/imap/examples/auditmbox.pl \
perl/imap/examples/imapcollate.pl \
perl/imap/examples/imapdu.pl \
perl/imap/examples/test-imsp.pl \
perl/imap/IMAP/Admin.pm \
perl/imap/IMAP/IMSP.pm \
perl/imap/IMAP/Shell.pm \
perl/imap/IMAP.pm \
perl/imap/IMAP.xs \
perl/imap/Makefile.PL.in \
perl/imap/MANIFEST \
perl/imap/README \
perl/imap/t/01-imclient.t \
perl/imap/t/02-admin.t \
perl/imap/typemap \
perl/imap/xsutil.c \
perl/sieve/managesieve/Makefile.PL.in \
perl/sieve/managesieve/managesieve.h \
perl/sieve/managesieve/managesieve.pm \
perl/sieve/managesieve/managesieve.xs \
perl/sieve/managesieve/MANIFEST \
perl/sieve/managesieve/typemap \
ptclient/README \
ptclient/test.c \
ptclient/test2.c \
sieve/addr.h \
sieve/sieve.h \
sieve/sieve_err.et \
sieve/tests/testExtension \
sieve/tests/testExtension/uberExtensionTestScript.key \
sieve/tests/testExtension/testm \
sieve/tests/testExtension/testm/uetest-envelope \
sieve/tests/testExtension/testm/uetest-asub \
sieve/tests/testExtension/testm/uetest-areg \
sieve/tests/testExtension/testm/uetest-count \
sieve/tests/testExtension/testm/uetest-value \
sieve/tests/testExtension/testm/uetest-hreg \
sieve/tests/testExtension/serverm \
sieve/tests/testExtension/serverm/uetmail-hreg \
sieve/tests/testExtension/serverm/uetmail-value \
sieve/tests/testExtension/serverm/uetmail-count2 \
sieve/tests/testExtension/serverm/uetmail-envelope \
sieve/tests/testExtension/serverm/uetmail-asub \
sieve/tests/testExtension/serverm/uetmail-value2 \
sieve/tests/testExtension/serverm/uetmail-areg \
sieve/tests/testExtension/serverm/uetmail-count \
sieve/tests/testExtension/uberExtensionTestScript.s \
sieve/tests/README \
sieve/tests/action \
sieve/tests/action/testm \
sieve/tests/action/testm/uatest-keep \
sieve/tests/action/testm/uatest-redirect \
sieve/tests/action/testm/uatest-discard \
sieve/tests/action/testm/uatest-stop2 \
sieve/tests/action/testm/uatest-stop \
sieve/tests/action/serverm \
sieve/tests/action/serverm/uamail-stop2 \
sieve/tests/action/serverm/uamail-redirect \
sieve/tests/action/serverm/uamail-stop \
sieve/tests/action/serverm/uamail-keep \
sieve/tests/action/serverm/uamail-discard \
sieve/tests/action/uberActionScript.key \
sieve/tests/action/uberActionScript.s \
sieve/tests/test \
sieve/tests/test/uberTestScript.key \
sieve/tests/test/testm \
sieve/tests/test/testm/utest-header \
sieve/tests/test/testm/utest-address \
sieve/tests/test/serverm \
sieve/tests/test/serverm/utmail-address \
sieve/tests/test/serverm/utmail-header \
sieve/tests/test/uberTestScript.s \
sieve/tests/actionExtensions \
sieve/tests/actionExtensions/uberExtensionActionScript.s \
sieve/tests/actionExtensions/testm \
sieve/tests/actionExtensions/testm/ueatest-flag4 \
sieve/tests/actionExtensions/testm/ueatest-flag2 \
sieve/tests/actionExtensions/testm/ueatest-fileinto \
sieve/tests/actionExtensions/testm/ueatest-denotify \
sieve/tests/actionExtensions/testm/ueatest-vacation \
sieve/tests/actionExtensions/testm/ueatest-reject \
sieve/tests/actionExtensions/testm/ueatest-mark \
sieve/tests/actionExtensions/testm/ueatest-denotify2 \
sieve/tests/actionExtensions/testm/ueatest-flag5 \
sieve/tests/actionExtensions/testm/ueatest-notify2 \
sieve/tests/actionExtensions/testm/ueatest-notify \
sieve/tests/actionExtensions/testm/ueatest-flag1 \
sieve/tests/actionExtensions/testm/ueatest-flag3 \
sieve/tests/actionExtensions/testm/ueatest-unmark \
sieve/tests/actionExtensions/uberExtensionActionScript.key \
sieve/tests/actionExtensions/serverm \
sieve/tests/actionExtensions/serverm/ueamail-flag4 \
sieve/tests/actionExtensions/serverm/ueamail-denotify \
sieve/tests/actionExtensions/serverm/ueamail-mark \
sieve/tests/actionExtensions/serverm/ueamail-denotify2 \
sieve/tests/actionExtensions/serverm/ueamail-flag2 \
sieve/tests/actionExtensions/serverm/ueamail-unmark \
sieve/tests/actionExtensions/serverm/ueamail-reject \
sieve/tests/actionExtensions/serverm/ueamail-flag3 \
sieve/tests/actionExtensions/serverm/ueamail-fileinto \
sieve/tests/actionExtensions/serverm/ueamail-flag1 \
sieve/tests/actionExtensions/serverm/ueamail-notify \
sieve/tests/actionExtensions/serverm/ueamail-flag5 \
sieve/tests/actionExtensions/serverm/ueamail-notify2 \
sieve/tests/actionExtensions/serverm/ueamail-vacation \
timsieved/TODO
TEXINFO_TEX = com_err/et/texinfo.tex
dist_noinst_SCRIPTS = \
com_err/et/compile_et.sh \
com_err/et/config_script \
imap/lmtpstats.snmp \
imap/pushstats.snmp \
lib/mkchartable.pl \
lib/test/run \
perl/sieve/scripts/installsieve.pl \
perl/sieve/scripts/sieveshell.pl \
tools/arbitronsort.pl \
tools/compile_st.pl \
tools/config2header \
tools/config2man \
tools/convert-sieve.pl \
tools/dohash \
tools/fixsearchpath.pl \
tools/jenkins-build.sh \
tools/masssievec \
tools/migrate-metadata \
tools/mkimap \
tools/mknewsgroups \
tools/mupdate-loadgen.pl \
tools/rehash \
tools/translatesieve \
tools/undohash \
tools/upgradesieve \
snmp/snmpgen
noinst_MAN = \
com_err/et/com_err.3 \
com_err/et/compile_et.1
noinst_TEXINFOS = com_err/et/com_err.texinfo
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcyrus_min.pc libcyrus.pc libcyrus_sieve.pc
com_err_et_libcyrus_com_err_la_SOURCES = \
com_err/et/com_err.c \
com_err/et/com_err.h \
com_err/et/error_message.c \
com_err/et/error_table.h \
com_err/et/et_name.c \
com_err/et/init_et.c \
com_err/et/internal.h \
com_err/et/mit-sipb-copyright.h
com_err_et_libcyrus_com_err_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY)
com_err/et/compile_et: com_err/et/compile_et.sh com_err/et/config_script \
config.h
@${top_srcdir}/com_err/et/config_script ${top_srcdir}/com_err/et/compile_et.sh ${AWK} ${SED} > $@
@chmod 755 $@
# ---- Libraries ----
# BASIC is the libraries that every Cyrus program (except master) will
# need to link with.
#
# Note that several places in the code use -lcrypto, e.g. for SHA1 or
# MD5 algorithms, without needing SSL. Currently we have no way of
# minimally linking such code.
LD_BASIC_ADD = lib/libcyrus.la lib/libcyrus_min.la ${LIBS} $(LIB_RT) \
${LIB_SASL} $(SSL_LIBS)
# UTILITY is the libraries that utility programs which use Cyrus'
# mailbox and message handling code need to link with.
LD_UTILITY_ADD = imap/libcyrus_imap.la $(LD_BASIC_ADD) $(COM_ERR_LIBS)
# SERVER is the libraries that network-facing servers need to link with
#
# Note that the code is horribly intertwingled e.g. in imap/global.c
# so that even utilities which never open a socket need to link against
# the SASL library.
LD_SERVER_ADD = $(LD_UTILITY_ADD) $(LIB_WRAP)
# ----
if CUNIT
CUNIT_PROJECT = cunit/default.cunit
BUILT_SOURCES += cunit/registers.h $(CUNIT_PROJECT)
CLEANFILES += cunit/registers.h $(CUNIT_PROJECT)
check_PROGRAMS += cunit/unit
cunit_FRAMEWORK = \
cunit/unit.c \
cunit/cunit.h \
cunit/syslog.c \
cunit/cunit-syslog.h \
cunit/timeout.c \
cunit/timeout.h
cunit_TESTS = \
cunit/annotate.testc \
cunit/backend.testc \
cunit/binhex.testc \
cunit/bitvector.testc \
cunit/buf.testc \
cunit/byteorder64.testc \
cunit/charset.testc \
cunit/crc32.testc \
cunit/db.testc \
cunit/dlist.testc \
cunit/duplicate.testc \
cunit/getxstring.testc \
cunit/glob.testc \
cunit/guid.testc \
cunit/hash.testc \
cunit/imapurl.testc \
cunit/mboxname.testc \
cunit/md5.testc \
cunit/message.testc \
cunit/msgid.testc \
cunit/parseaddr.testc \
cunit/parse.testc \
cunit/prot.testc \
cunit/ptrarray.testc \
cunit/quota.testc \
cunit/rfc822tok.testc
if SIEVE
cunit_TESTS += cunit/sieve.testc
endif
cunit_TESTS += \
cunit/spool.testc \
cunit/squat.testc \
cunit/strarray.testc \
cunit/strconcat.testc \
cunit/times.testc \
cunit/tok.testc
cunit_unit_SOURCES = $(cunit_FRAMEWORK) $(cunit_TESTS) \
imap/mutex_fake.c imap/spool.c
cunit_unit_LDADD =
if SIEVE
cunit_unit_LDADD += sieve/libcyrus_sieve.la
endif
cunit_unit_LDADD += $(LD_UTILITY_ADD) -lcunit
CUNIT_PL = cunit/cunit.pl --project $(CUNIT_PROJECT)
.testc.o:
$(CUNIT_PL) --generate-wrapper $<
$(COMPILE) -c -o $@ $<-cunit.c
$(RM) $<-cunit.c
$(CUNIT_PROJECT):
$(RM) $@
$(CUNIT_PL) --add-sources $(cunit_TESTS)
cunit/registers.h: $(CUNIT_PROJECT)
$(CUNIT_PL) --generate-register-function $@
# To run under Valgrind, do: make VG=1 check
VALGRIND = valgrind --tool=memcheck --leak-check=full --suppressions=vg.supp
check-local:
@echo "Running unit tests"
@vg= ; \
test -z "$$VG" || vg="$(VALGRIND)" ; \
f="-v" ; \
test "x$$CUFORMAT" = xjunit && f="-x" ; \
cd cunit ; \
$$vg ./unit $$f ; \
retval=$$? ; \
if [ "x$$CUFORMAT" = xjunit ] ; then \
$(RM) -rf reports ; mkdir reports ; ./cunit-to-junit.pl ; \
fi ; \
exit $$retval
endif
doc_text_htmlstrip_SOURCE = doc/text/htmlstrip.c
includedir=@includedir@/cyrus
include_HEADERS = \
lib/acl.h \
lib/arrayu64.h \
lib/assert.h \
lib/auth.h \
lib/auth_pts.h \
lib/bitvector.h \
lib/bsearch.h \
lib/charset.h \
lib/chartable.h \
lib/command.h \
lib/crc32.h \
lib/cyr_lock.h \
lib/cyrusdb.h \
lib/exitcodes.h \
lib/glob.h \
lib/gmtoff.h \
lib/hash.h \
lib/hashu64.h \
lib/imapopts.h \
lib/imapurl.h \
lib/imclient.h \
lib/imparse.h \
lib/iostat.h \
lib/iptostring.h \
lib/libcyr_cfg.h \
lib/lsort.h \
lib/map.h \
lib/mappedfile.h \
lib/me.h \
lib/mkgmtime.h \
lib/mpool.h \
lib/nonblock.h \
lib/parseaddr.h \
lib/retry.h \
lib/rfc822tok.h \
lib/signals.h \
lib/strarray.h \
lib/strhash.h \
lib/stristr.h \
lib/sysexits.h \
lib/times.h \
lib/tok.h \
lib/vparse.h \
lib/wildmat.h \
lib/xmalloc.h
nobase_include_HEADERS = sieve/sieve_interface.h
nobase_nodist_include_HEADERS = sieve/sieve_err.h
noinst_HEADERS = \
lib/byteorder64.h \
lib/gai.h \
lib/libconfig.h \
lib/md5.h \
lib/prot.h \
lib/ptrarray.h \
lib/util.h \
lib/xstrlcat.h \
lib/xstrlcpy.h
imap_arbitron_SOURCES = imap/arbitron.c imap/cli_fatal.c imap/mutex_fake.c
imap_arbitron_LDADD = $(LD_UTILITY_ADD)
imap_chk_cyrus_SOURCES = imap/chk_cyrus.c imap/cli_fatal.c imap/mutex_fake.c
imap_chk_cyrus_LDADD = $(LD_UTILITY_ADD)
imap_ctl_conversationsdb_SOURCES = imap/ctl_conversationsdb.c imap/mutex_fake.c
imap_ctl_conversationsdb_LDADD = $(LD_UTILITY_ADD)
imap_ctl_cyrusdb_SOURCES = imap/cli_fatal.c imap/ctl_cyrusdb.c imap/mutex_fake.c
imap_ctl_cyrusdb_LDADD = $(LD_UTILITY_ADD)
imap_ctl_deliver_SOURCES = imap/cli_fatal.c imap/ctl_deliver.c imap/mutex_fake.c
imap_ctl_deliver_LDADD = $(LD_UTILITY_ADD)
imap_ctl_mboxlist_SOURCES = imap/cli_fatal.c imap/ctl_mboxlist.c imap/mutex_fake.c
imap_ctl_mboxlist_LDADD = $(LD_UTILITY_ADD)
imap_cvt_cyrusdb_SOURCES = imap/cli_fatal.c imap/cvt_cyrusdb.c imap/mutex_fake.c
imap_cvt_cyrusdb_LDADD = $(LD_UTILITY_ADD)
imap_cyrdump_SOURCES = imap/cli_fatal.c imap/cyrdump.c imap/mutex_fake.c
imap_cyrdump_LDADD = $(LD_UTILITY_ADD)
imap_cyr_dbtool_SOURCES = imap/cli_fatal.c imap/cyr_dbtool.c imap/mutex_fake.c
imap_cyr_dbtool_LDADD = $(LD_UTILITY_ADD)
imap_cyr_deny_SOURCES = imap/cli_fatal.c imap/cyr_deny.c imap/mutex_fake.c
imap_cyr_deny_LDADD = $(LD_UTILITY_ADD)
imap_cyr_df_SOURCES = imap/cli_fatal.c imap/cyr_df.c imap/mutex_fake.c
imap_cyr_df_LDADD = $(LD_UTILITY_ADD)
imap_cyr_expire_SOURCES = imap/cli_fatal.c imap/cyr_expire.c imap/mutex_fake.c
imap_cyr_expire_LDADD = $(LD_UTILITY_ADD)
imap_cyr_info_SOURCES = imap/cli_fatal.c imap/cyr_info.c imap/mutex_fake.c master/masterconf.c
imap_cyr_info_LDADD = $(LD_UTILITY_ADD)
imap_cyr_sequence_SOURCES = imap/cli_fatal.c imap/cyr_sequence.c imap/mutex_fake.c
imap_cyr_sequence_LDADD = $(LD_UTILITY_ADD)
imap_cyr_synclog_SOURCES = imap/cli_fatal.c imap/cyr_synclog.c imap/mutex_fake.c
imap_cyr_synclog_LDADD = $(LD_UTILITY_ADD)
imap_cyr_userseen_SOURCES = imap/cli_fatal.c imap/cyr_userseen.c imap/mutex_fake.c
imap_cyr_userseen_LDADD = $(LD_UTILITY_ADD)
if HAVE_CLAMAV
imap_cyr_virusscan_SOURCES = imap/cli_fatal.c imap/cyr_virusscan.c imap/mutex_fake.c
imap_cyr_virusscan_LDADD = $(LD_UTILITY_ADD) -lclamav
else # HAVE_CLAMAV
EXTRA_DIST += \
imap/cyr_virusscan.c
endif # HAVE_CLAMAV
if HTTPD
imap_ctl_zoneinfo_SOURCES = imap/cli_fatal.c imap/ctl_zoneinfo.c imap/mutex_fake.c
imap_ctl_zoneinfo_LDADD = $(LD_UTILITY_ADD)
else # HTTPD
EXTRA_DIST += \
imap/ctl_zoneinfo.c
endif # HTTPD
imap_deliver_SOURCES = \
imap/deliver.c \
imap/lmtpengine.c \
imap/lmtpstats.c \
imap/mutex_fake.c \
imap/proxy.c \
imap/spool.c
imap_deliver_LDADD = $(LD_UTILITY_ADD)
imap_fetchnews_SOURCES = imap/cli_fatal.c imap/fetchnews.c imap/mutex_fake.c
imap_fetchnews_LDADD = $(LD_UTILITY_ADD)
imap_fud_SOURCES = imap/fud.c imap/mutex_fake.c master/service.c
imap_fud_LDADD = $(LD_SERVER_ADD)
imap_hammer_cyrusdb_SOURCES = imap/cli_fatal.c imap/hammer_cyrusdb.c imap/mutex_fake.c
imap_hammer_cyrusdb_LDADD = $(LD_UTILITY_ADD)
imap_idled_SOURCES = imap/idled.c imap/mutex_fake.c
imap_idled_LDADD = $(LD_UTILITY_ADD)
imap_imapd_SOURCES = \
imap/imap_proxy.c \
imap/imap_proxy.h \
imap/imapd.c \
imap/imapd.h \
imap/mutex_fake.c \
imap/pushstats.c \
imap/pushstats.h \
imap/proxy.c \
imap/proxy.h \
master/service.c
if AUTOCREATE
imap_imapd_SOURCES += \
imap/autocreate.h \
imap/autocreate.c
endif
imap_imapd_LDADD =
if SIEVE
imap_imapd_LDADD += sieve/libcyrus_sieve.la
endif
imap_imapd_LDADD += $(LD_SERVER_ADD)
imap_ipurge_SOURCES = imap/cli_fatal.c imap/ipurge.c imap/mutex_fake.c
imap_ipurge_LDADD = $(LD_UTILITY_ADD)
nodist_imap_libcyrus_imap_la_SOURCES = \
imap/imap_err.c \
imap/mupdate_err.c \
imap/mupdate_err.h
dist_imap_libcyrus_imap_la_SOURCES =
imap_libcyrus_imap_la_SOURCES = \
imap/annotate.c \
imap/annotate.h \
imap/append.c \
imap/append.h \
imap/backend.c \
imap/backend.h \
imap/conversations.c \
imap/convert_code.c \
imap/convert_code.h \
imap/dlist.c \
imap/dlist.h \
imap/duplicate.c \
imap/duplicate.h \
imap/global.c \
imap/global.h \
imap/idle.c \
imap/idle.h \
imap/idlemsg.c \
imap/idlemsg.h \
imap/imapparse.c \
imap/index.c \
imap/index.h \
imap/mailbox.c \
imap/mailbox.h \
imap/mbdump.c \
imap/mbdump.h \
imap/mboxkey.c \
imap/mboxkey.h \
imap/mboxlist.c \
imap/mboxlist.h \
imap/mboxevent.c \
imap/mboxevent.h \
imap/mboxname.c \
imap/mboxname.h \
imap/message_guid.c \
imap/message_guid.h \
imap/message.c \
imap/message.h \
imap/mupdate-client.c \
imap/mupdate-client.h \
imap/mutex.h \
imap/notify.c \
imap/notify.h \
imap/partlist.c \
imap/partlist.h \
imap/proc.c \
imap/proc.h \
imap/protocol.h \
imap/quota_db.c \
imap/rfc822_header.c \
imap/rfc822_header.h \
imap/saslclient.c \
imap/saslclient.h \
imap/saslserver.c \
imap/search_engines.c \
imap/search_engines.h \
imap/seen.h \
imap/seen_db.c \
imap/sequence.c \
imap/sequence.h \
imap/setproctitle.c \
imap/statuscache.h \
imap/statuscache_db.c \
imap/sync_log.c \
imap/sync_log.h \
imap/telemetry.c \
imap/telemetry.h \
imap/tls.c \
imap/tls.h \
imap/tls_th-lock.c \
imap/tls_th-lock.h \
imap/user.c \
imap/user.h \
imap/userdeny_db.c \
imap/userdeny.h \
imap/version.c \
imap/version.h
-<<<<<<< HEAD
-=======
if USE_SQUAT
imap_libcyrus_imap_la_SOURCES += \
imap/search_squat.c \
imap/squat.c \
imap/squat.h \
imap/squat_internal.c \
imap/squat_internal.h
endif
->>>>>>> Add --disable-squat to configure
+
+if USE_SPHINX
+imap_libcyrus_imap_la_SOURCES += \
+ imap/search_sphinx.c
+endif
+
imap_libcyrus_imap_la_LIBADD = $(COM_ERR_LIBS) $(LIB_UUID) lib/libcyrus_min.la lib/libcyrus.la
imap_libcyrus_imap_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY)
if JANSSON
imap_libcyrus_imap_la_LIBADD += $(JANSSON_LIBS)
imap_libcyrus_imap_la_CFLAGS += $(JANSSON_CFLAGS)
endif
if HTTPD
imap_libcyrus_imap_la_SOURCES += \
imap/caldav_db.c \
imap/caldav_db.h \
imap/carddav_db.c \
imap/carddav_db.h \
imap/dav_db.c \
imap/dav_db.h \
imap/dav_util.c \
imap/dav_util.h \
imap/http_caldav.c \
imap/http_caldav_sched.h \
imap/http_carddav.c \
imap/http_client.c \
imap/http_client.h \
imap/http_dav.c \
imap/http_dav.h \
imap/http_dblookup.c \
imap/http_ischedule.c \
imap/http_proxy.c \
imap/http_proxy.h \
imap/http_rss.c \
imap/http_timezone.c \
imap/httpd.c \
imap/httpd.h \
imap/jcal.c \
imap/jcal.h \
imap/proxy.c \
imap/proxy.h \
imap/smtpclient.c \
imap/smtpclient.h \
imap/spool.c \
imap/spool.h \
imap/xcal.c \
imap/xcal.h \
imap/zoneinfo_db.c \
imap/zoneinfo_db.h
nodist_imap_libcyrus_imap_la_SOURCES += \
imap/http_err.c \
imap/tz_err.c
endif # HTTPD
imap_lmtpd_SOURCES = \
imap/lmtpd.c \
imap/lmtpd.h \
imap/lmtpengine.c \
imap/lmtpengine.h \
imap/lmtpstats.c \
imap/lmtpstats.h \
imap/mutex_fake.c \
imap/proxy.c \
imap/spool.c \
master/service.c
if AUTOCREATE
imap_lmtpd_SOURCES += \
imap/autocreate.c \
imap/autocreate.h
endif # AUTOCREATE
imap_lmtpd_LDADD =
if SIEVE
imap_lmtpd_SOURCES += imap/lmtp_sieve.c imap/lmtp_sieve.h imap/smtpclient.c
imap_lmtpd_LDADD += sieve/libcyrus_sieve.la
endif # SIEVE
imap_lmtpd_LDADD += $(LD_SERVER_ADD)
imap/lmtpstats.c: imap/lmtpstats.snmp snmp/snmpgen
cd imap && ../${top_srcdir}/snmp/snmpgen ../${top_srcdir}/imap/lmtpstats.snmp
imap/pushstats.c: imap/pushstats.snmp snmp/snmpgen
cd imap && ../${top_srcdir}/snmp/snmpgen ../${top_srcdir}/imap/pushstats.snmp
imap_mbexamine_SOURCES = imap/cli_fatal.c imap/mbexamine.c imap/mutex_fake.c
imap_mbexamine_LDADD = $(LD_UTILITY_ADD)
imap_mbpath_SOURCES = imap/cli_fatal.c imap/mbpath.c imap/mutex_fake.c
imap_mbpath_LDADD = $(LD_UTILITY_ADD)
imap_mbtool_SOURCES = imap/cli_fatal.c imap/mbtool.c imap/mutex_fake.c
imap_mbtool_LDADD = $(LD_UTILITY_ADD)
imap_mupdate_SOURCES = \
imap/mupdate.c \
imap/mupdate.h \
imap/mupdate-slave.c \
imap/mutex_pthread.c \
imap/tls_th-lock.c \
master/service-thread.c
imap_mupdate_LDADD = $(LD_SERVER_ADD) -lpthread
nodist_imap_nntpd_SOURCES = \
imap/nntp_err.c \
imap/nntp_err.h
imap_nntpd_SOURCES = \
imap/mutex_fake.c \
imap/nntpd.c \
imap/proxy.c \
imap/smtpclient.c \
imap/smtpclient.h \
imap/spool.c \
imap/spool.h \
master/service.c
imap_nntpd_LDADD = $(LD_SERVER_ADD)
nodist_imap_httpd_SOURCES = \
imap/http_err.c \
imap/http_err.h \
imap/tz_err.c \
imap/tz_err.h
imap_httpd_SOURCES = \
imap/caldav_db.c \
imap/carddav_db.c \
imap/carddav_db.h \
imap/dav_db.c \
imap/dav_util.c \
imap/http_caldav.c \
imap/http_carddav.c \
imap/http_client.c \
imap/http_dav.c \
imap/http_dblookup.c \
imap/http_ischedule.c \
imap/http_proxy.c \
imap/http_rss.c \
imap/http_timezone.c \
imap/httpd.c \
imap/jcal.c \
imap/mutex_fake.c \
imap/proxy.c \
imap/smtpclient.c \
imap/spool.c \
imap/xcal.c \
imap/zoneinfo_db.c \
master/service.c
imap_httpd_LDADD = $(LD_SERVER_ADD)
imap_pop3d_SOURCES = \
imap/mutex_fake.c \
imap/pop3d.c \
imap/proxy.c \
master/service.c
if AUTOCREATE
imap_pop3d_SOURCES += \
imap/autocreate.c \
imap/autocreate.h
endif # AUTOCREATE
imap_pop3d_LDADD =
if SIEVE
imap_pop3d_LDADD += sieve/libcyrus_sieve.la
endif # SIEVE
imap_pop3d_LDADD += $(LD_SERVER_ADD)
imap_quota_SOURCES = imap/cli_fatal.c imap/mutex_fake.c imap/quota.c imap/quota.h
imap_quota_LDADD = $(LD_UTILITY_ADD)
imap_reconstruct_SOURCES = imap/cli_fatal.c imap/mutex_fake.c imap/reconstruct.c
imap_reconstruct_LDADD = $(LD_UTILITY_ADD)
imap_dav_reconstruct_SOURCES = imap/cli_fatal.c imap/mutex_fake.c imap/dav_reconstruct.c
imap_dav_reconstruct_LDADD = $(LD_UTILITY_ADD)
imap_smmapd_SOURCES = imap/mutex_fake.c imap/proxy.c imap/smmapd.c master/service.c
imap_smmapd_LDADD = $(LD_SERVER_ADD)
imap_squatter_SOURCES = imap/cli_fatal.c imap/mutex_fake.c imap/squatter.c imap/squat_build.c
imap_squatter_LDADD = $(LD_UTILITY_ADD)
imap_sync_client_SOURCES = imap/mutex_fake.c imap/sync_client.c \
imap/sync_support.c imap/sync_support.h
imap_sync_client_LDADD = $(LD_UTILITY_ADD)
imap_sync_reset_SOURCES = imap/mutex_fake.c imap/sync_reset.c imap/sync_support.c
imap_sync_reset_LDADD = $(LD_UTILITY_ADD)
imap_sync_server_SOURCES = imap/mutex_fake.c imap/sync_server.c imap/sync_support.c master/service.c
imap_sync_server_LDADD = $(LD_SERVER_ADD)
imap_tls_prune_SOURCES = imap/cli_fatal.c imap/mutex_fake.c imap/tls_prune.c
imap_tls_prune_LDADD = $(LD_UTILITY_ADD)
imap_unexpunge_SOURCES = imap/cli_fatal.c imap/mutex_fake.c imap/unexpunge.c
imap_unexpunge_LDADD = $(LD_UTILITY_ADD)
imap/imap_err.h imap/imap_err.c: imap/imap_err.et $(COMPILE_ET_DEP)
cd imap && $(COMPILE_ET) ../$(top_srcdir)/imap/imap_err.et
imap/mupdate_err.h imap/mupdate_err.c: imap/mupdate_err.et $(COMPILE_ET_DEP)
cd imap && $(COMPILE_ET) ../$(top_srcdir)/imap/mupdate_err.et
imap/nntp_err.h imap/nntp_err.c: imap/nntp_err.et $(COMPILE_ET_DEP)
cd imap && $(COMPILE_ET) ../$(top_srcdir)/imap/nntp_err.et
imap/http_err.h imap/http_err.c: imap/http_err.et $(COMPILE_ET_DEP)
cd imap && $(COMPILE_ET) ../$(top_srcdir)/imap/http_err.et
imap/tz_err.h imap/tz_err.c: imap/tz_err.et $(COMPILE_ET_DEP)
cd imap && $(COMPILE_ET) ../$(top_srcdir)/imap/tz_err.et
if MAINTAINER_MODE
imap/rfc822_header.c: imap/rfc822_header.st
${top_srcdir}/tools/compile_st.pl -c $< > $@.NEW && mv $@.NEW $@
imap/rfc822_header.h: imap/rfc822_header.st
${top_srcdir}/tools/compile_st.pl -h $< > $@.NEW && mv $@.NEW $@
endif
imtest_imtest_SOURCES = imtest/imtest.c
imtest_imtest_LDADD = $(LD_BASIC_ADD)
imtest_imtest_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY)
nodist_lib_libcyrus_la_SOURCES = lib/chartable.c
lib_libcyrus_la_SOURCES = \
lib/acl.c \
lib/acl_afs.c \
lib/auth.c \
lib/auth_krb.c \
lib/auth_krb5.c \
lib/auth_pts.c \
lib/auth_unix.c \
lib/bitvector.c \
lib/bsearch.c \
lib/byteorder64.c \
lib/charset.c \
lib/command.c \
lib/crc32.c \
lib/cyrusdb.c \
lib/cyrusdb_flat.c \
lib/cyrusdb_quotalegacy.c \
lib/cyrusdb_skiplist.c \
lib/cyrusdb_twoskip.c \
lib/glob.c \
lib/imapurl.c \
lib/imclient.c \
lib/imparse.c \
lib/iostat.c \
lib/iptostring.c \
lib/libcyr_cfg.c \
lib/lsort.c \
lib/mappedfile.c \
lib/mkgmtime.c \
lib/parseaddr.c \
lib/prot.c \
lib/ptrarray.c \
lib/rfc822tok.c \
lib/signals.c \
lib/stristr.c \
lib/times.c \
lib/tok.c \
lib/wildmat.c
if USE_SQL
lib_libcyrus_la_SOURCES += lib/cyrusdb_sql.c
endif
if GMTOFF_TM
lib_libcyrus_la_SOURCES += lib/gmtoff_tm.c
else
lib_libcyrus_la_SOURCES += lib/gmtoff_gmtime.c
endif
if NONBLOCK_FCNTL
lib_libcyrus_la_SOURCES += lib/nonblock_fcntl.c
else
lib_libcyrus_la_SOURCES += lib/nonblock_ioctl.c
endif
lib_libcyrus_la_LIBADD = $(LIB_RT) ${LIB_SASL} $(SSL_LIBS)
lib_libcyrus_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY)
lib_libcyrus_min_la_SOURCES = \
lib/arrayu64.c \
lib/assert.c \
lib/hash.c \
lib/hashu64.c \
lib/imapopts.c \
lib/libconfig.c \
lib/me.c \
lib/mpool.c \
lib/retry.c \
lib/strarray.c \
lib/strhash.c \
lib/util.c \
lib/vparse.c \
lib/xmalloc.c \
lib/xstrlcat.c \
lib/xstrlcpy.c
if IPV6_noGETADDRINFO
lib_libcyrus_min_la_SOURCES += lib/getaddrinfo.c
endif
if IPV6_noGETNAMEINFO
lib_libcyrus_min_la_SOURCES += lib/getnameinfo.c
endif
if LOCK_FCNTL
lib_libcyrus_min_la_SOURCES += lib/lock_fcntl.c
else
lib_libcyrus_min_la_SOURCES += lib/lock_flock.c
endif
if MAP_SHARED
lib_libcyrus_min_la_SOURCES += lib/map_shared.c
else
if MAP_STUPIDSHARED
lib_libcyrus_min_la_SOURCES += lib/map_stupidshared.c
else
lib_libcyrus_min_la_SOURCES += lib/map_nommap.c
endif
endif
lib_libcyrus_min_la_LIBADD = $(LTLIBOBJS)
lib_libcyrus_min_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY)
lib/chartable.c: lib/mkchartable.pl lib/charset/unifix.txt \
$(top_srcdir)/lib/charset/*.t lib/charset/UnicodeData.txt \
lib/charset/aliases.txt
@echo "### Building chartables..."
perl $(top_srcdir)/lib/mkchartable.pl -m $(top_srcdir)/lib/charset/unifix.txt -m $(top_srcdir)/lib/charset/UnicodeData.txt -a $(top_srcdir)/lib/charset/aliases.txt -o $@ $(top_srcdir)/lib/charset/*.t || (rm -f $@ && exit 1)
@echo "### Done building chartables."
lib/imapopts.h: lib/imapopts.c
lib/imapopts.c: lib/imapoptions tools/config2header
$(top_srcdir)/tools/config2header CC="$(CC)" $(top_builddir)/lib/imapopts.c $(top_builddir)/lib/imapopts.h < $(top_srcdir)/lib/imapoptions
#this is from lib/test/Makefile.in, however testglob.c does not exist in
#/lib/test, instead testglob2.c is there.
#lib_test_testglob_LIRBARIES = lib/libcyrus.la lib/libcyrus_min.la -ldb-4.0
@SET_MAKE@
dist_man_MANS = \
man/imtest.1 \
man/installsieve.1 \
man/lmtptest.1 \
man/mupdatetest.1 \
man/nntptest.1 \
man/pop3test.1 \
man/sieveshell.1 \
man/sivtest.1 \
man/smtptest.1 \
man/imclient.3 \
man/cyrus.conf.5 \
man/imapd.conf.5 \
man/krb.equiv.5 \
man/arbitron.8 \
man/chk_cyrus.8 \
man/ctl_cyrusdb.8 \
man/ctl_deliver.8 \
man/ctl_mboxlist.8 \
man/cyr_expire.8 \
man/cvt_cyrusdb.8 \
man/cyr_dbtool.8 \
man/cyr_deny.8 \
man/cyr_df.8 \
man/cyr_info.8 \
man/cyr_synclog.8 \
man/deliver.8 \
man/fud.8 \
man/idled.8 \
man/imapd.8 \
man/ipurge.8 \
man/lmtpd.8 \
man/master.8 \
man/mbexamine.8 \
man/mbpath.8 \
man/notifyd.8 \
man/pop3d.8 \
man/quota.8 \
man/reconstruct.8 \
man/rmnews.8 \
man/smmapd.8 \
<<<<<<< HEAD
man/squatter.8 \
=======
man/syncnews.8 \
>>>>>>> Add --disable-squat to configure
man/sync_client.8 \
man/sync_reset.8 \
man/sync_server.8 \
man/timsieved.8 \
man/tls_prune.8 \
man/unexpunge.8
if USE_SQUAT
dist_man_MANS += \
man/squatter.8
endif
if NNTPD
dist_man_MANS += \
man/fetchnews.8 \
man/nntpd.8
else # NNTPD
EXTRA_DIST += \
man/fetchnews.8 \
man/nntpd.8
endif # NNTPD
if HTTPD
dist_man_MANS += \
man/ctl_zoneinfo.8 \
man/httpd.8
else # HTTPD
EXTRA_DIST += \
man/ctl_zoneinfo.8 \
man/httpd.8
endif # HTTPD
master_master_SOURCES = \
master/cyrusMasterMIB.c \
master/cyrusMasterMIB.h \
master/master.c \
master/master.h \
master/masterconf.c \
master/masterconf.h \
master/service.h
master_master_LDADD = lib/libcyrus_min.la $(LIB_UCDSNMP) $(LIBS) -lm
netnews_remotepurge_SOURCES = \
netnews/macros.h \
netnews/readconfig.c \
netnews/readconfig.h \
netnews/remotepurge.c
netnews_remotepurge_LDADD = $(LD_BASIC_ADD)
notifyd_notifyd_SOURCES = \
imap/mutex_fake.c \
master/service.c \
notifyd/notify_external.c \
notifyd/notify_external.h \
notifyd/notify_log.c \
notifyd/notify_log.h \
notifyd/notify_mailto.c \
notifyd/notify_mailto.h \
notifyd/notify_null.c \
notifyd/notify_null.h \
notifyd/notifyd.c \
notifyd/notifyd.h
if ZEPHYR
notifyd_notifyd_SOURCES += notifyd/notify_zephyr.c notifyd/notify_zephyr.h
endif
notifyd_notifyd_LDADD = $(LD_SERVER_ADD) $(ZEPHYR_LIBS)
notifyd_notifytest_SOURCES = notifyd/notifytest.c imap/mutex_fake.c
notifyd_notifytest_LDADD = $(LD_BASIC_ADD)
perl_libcyrus_la_SOURCES = $(lib_libcyrus_la_SOURCES)
perl_libcyrus_la_LIBADD = $(lib_libcyrus_la_LIBADD)
perl_libcyrus_min_la_SOURCES = $(lib_libcyrus_min_la_SOURCES)
perl_libcyrus_min_la_LIBADD = $(lib_libcyrus_min_la_LIBADD)
perl_sieve_lib_libisieve_a_SOURCES = \
perl/sieve/lib/codes.h \
perl/sieve/lib/isieve.c \
perl/sieve/lib/isieve.h \
perl/sieve/lib/lex.c \
perl/sieve/lib/lex.h \
perl/sieve/lib/request.c \
perl/sieve/lib/request.h
ptclient_ptdump_SOURCES = imap/cli_fatal.c imap/mutex_fake.c ptclient/ptdump.c
ptclient_ptdump_LDADD = $(LD_UTILITY_ADD)
ptclient_ptexpire_SOURCES = imap/cli_fatal.c imap/mutex_fake.c ptclient/ptexpire.c
ptclient_ptexpire_LDADD = $(LD_UTILITY_ADD)
ptclient_ptloader_SOURCES = \
imap/mutex_fake.c \
ptclient/ptloader.c \
ptclient/ptloader.h \
master/service-thread.c
ptclient_ptloader_LDFLAGS =
ptclient_ptloader_LDADD = $(LD_SERVER_ADD)
if HAVE_LDAP
ptclient_ptloader_SOURCES += ptclient/ldap.c
ptclient_ptloader_LDADD += $(LDAP_LIBS)
ptclient_ptloader_LDFLAGS += $(LDAP_LDFLAGS)
endif
if USE_AFSKRB
ptclient_ptloader_SOURCES += ptclient/afskrb.c
ptclient_ptloader_LDADD += $(AFS_LIBS)
ptclient_ptloader_LDFLAGS += $(AFS_LDFLAGS)
endif
nodist_sieve_libcyrus_sieve_la_SOURCES = \
sieve/sieve_err.c \
sieve/sieve_err.h
sieve_libcyrus_sieve_la_SOURCES = \
sieve/bytecode.h \
sieve/addr.y \
sieve/addr-lex.l \
sieve/bc_dump.c \
sieve/bc_emit.c \
sieve/bc_eval.c \
sieve/bc_generate.c \
sieve/comparator.c \
sieve/comparator.h \
sieve/flags.c \
sieve/flags.h \
sieve/interp.c \
sieve/interp.h \
sieve/message.c \
sieve/message.h \
sieve/script.c \
sieve/script.h \
sieve/sieve-lex.l \
sieve/sieve.y \
sieve/tree.c \
sieve/tree.h \
sieve/varlist.c \
sieve/varlist.h
sieve_libcyrus_sieve_la_LIBADD = $(COM_ERR_LIBS) lib/libcyrus_min.la lib/libcyrus.la
sieve_libcyrus_sieve_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY)
LD_SIEVE_ADD = sieve/libcyrus_sieve.la $(LD_BASIC_ADD)
sieve_sievec_LDADD = $(LD_SIEVE_ADD)
sieve_sieved_LDADD = $(LD_SIEVE_ADD)
sieve/sieve_err.h sieve/sieve_err.c: sieve/sieve_err.et $(COMPILE_ET_DEP)
cd sieve && $(COMPILE_ET) ../$(top_srcdir)/sieve/sieve_err.et
sieve_test_SOURCES = sieve/test.c imap/mutex_fake.c
sieve_test_LDADD = sieve/libcyrus_sieve.la $(LD_UTILITY_ADD)
timsieved_timsieved_SOURCES = \
imap/mutex_fake.c \
imap/proxy.c \
master/service.c \
timsieved/actions.c \
timsieved/actions.h \
timsieved/codes.h \
timsieved/lex.c \
timsieved/lex.h \
timsieved/parser.c \
timsieved/parser.h \
timsieved/scripttest.c \
timsieved/scripttest.h \
timsieved/timsieved.c
timsieved_timsieved_LDADD = sieve/libcyrus_sieve.la $(LD_SERVER_ADD)
# TODO: Should not really stay around, but GNU software is hard to
# contribute fixes to. Needed when building with the following:
# CFLAGS="-g -fPIC -W -Wall -Wextra -Werror"
lex-fix: sieve/addr-lex.c sieve/sieve-lex.c
grep -E '^yy_size_t sieveleng;$$' sieve/sieve-lex.c && \
sed -r -i -e 's/int yyl;/yy_size_t yyl;/g' sieve/sieve-lex.c || :
grep -E ' yy_size_t _yybytes_len ' sieve/sieve-lex.c && \
sed -r -i -s 's/\tint i;/\tyy_size_t i;/g' sieve/sieve-lex.c || :
grep -E ' yy_size_t _yybytes_len ' sieve/addr-lex.c && \
sed -r -i -s 's/\tint i;/\tyy_size_t i;/g' sieve/addr-lex.c || :
GIT_VERSION = $(PACKAGE_VERSION)@git_version@
snapshot::
@echo "Creating snapshot $(PACKAGE_NAME)-$(GIT_VERSION)"
@$(MKDIR_P) snapshot
@git archive --format=tar --prefix=$(PACKAGE_NAME)-$(GIT_VERSION)/ HEAD | tar -C snapshot/ -x -f -
@echo "/* $(PACKAGE_NAME) $(GIT_VERSION) */" > snapshot/$(PACKAGE_NAME)-$(GIT_VERSION)/xversion.h
@echo "#define _CYRUS_VERSION \"$(GIT_VERSION)\"" >> snapshot/$(PACKAGE_NAME)-$(GIT_VERSION)/xversion.h
@echo "#define CYRUS_GITVERSION \"`git log --abbrev=8 --pretty=\"format:%h %ci\" -1 | cut -d\" \" -f1,2`\"" >> snapshot/$(PACKAGE_NAME)-$(GIT_VERSION)/xversion.h
@touch snapshot/$(PACKAGE_NAME)-$(GIT_VERSION)/xversion
@echo "creating tarfile"
tar -C snapshot -c -f - $(PACKAGE_NAME)-$(GIT_VERSION) | gzip -9 > $(PACKAGE_NAME)-$(GIT_VERSION).tar.gz
@rm -rf snapshot
man/imapd.conf.5: $(top_srcdir)/tools/config2man $(top_srcdir)/lib/imapoptions
@echo creating man/imapd.conf.5
@$(MKDIR_P) man
$(top_srcdir)/tools/config2man $(top_srcdir)/lib/imapoptions > $@
man/sieveshell.1: $(top_srcdir)/perl/sieve/scripts/sieveshell.pl
@echo creating man/sieveshell.1
@$(MKDIR_P) man
pod2man $(top_srcdir)/perl/sieve/scripts/sieveshell.pl > $@
doc/man/cyradm.1.html: $(top_srcdir)/perl/imap/cyradm.sh
@$(MKDIR_P) doc/man
pod2html $(top_srcdir)/perl/imap/cyradm.sh > $@
rm pod2htm*
doc/man/sieveshell.1.html: $(top_srcdir)/perl/sieve/scripts/sieveshell.pl
@$(MKDIR_P) doc/man
pod2html $(top_srcdir)/perl/sieve/scripts/sieveshell.pl > $@
rm pod2htm*
dist-old:: distgit
@echo "creating configure"
@cd dist/cyrus-imapd-$(PACKAGE_VERSION) ; sh SMakefile
@for d in $(DIST_SUBDIRS); \
do \
(cd dist/cyrus-imapd-$(PACKAGE_VERSION)/$$d; \
if [ -f Makefile.dist ]; then \
echo "### Making" dist "in" `pwd`; \
$(MAKE) $(MFLAGS) YACC='$(YACC)' LEX='$(LEX)' \
COMPILE_ET='$(COMPILE_ET)' -f Makefile.dist dist ; \
fi) || exit 1; \
done
@echo "creating tarfile"
@cd dist ; tar cf - cyrus-imapd-$(PACKAGE_VERSION) | \
gzip -9 > ../cyrus-imapd-$(PACKAGE_VERSION).tar.gz
rm -f distgit
rm -rf dist
distgit:
$(MKDIR_P) dist
@echo "checking out the distribution from tag $(PACKAGE_NAME)-$(PACKAGE_VERSION)"
git archive --format=tar --prefix=$(PACKAGE_NAME)-$(PACKAGE_VERSION)/ $(PACKAGE_NAME)-$(PACKAGE_VERSION) | tar -C dist -x -f -
echo "/* Release $(PACKAGE_NAME)-$(PACKAGE_VERSION) */" > dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/xversion.h
echo "#define _CYRUS_VERSION \"v$(PACKAGE_VERSION)\"" >> dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/xversion.h
echo "#define CYRUS_GITVERSION \"`git log --abbrev=8 --pretty=\"format:%h %ci\" -1 | cut -d\" \" -f1,2`\"" >> dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/xversion.h
touch dist/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/xversion
touch distgit
xversion xversion.h:
@echo "/* Development version */" > xversion.h.tmp
@echo "#define _CYRUS_VERSION \"$(GIT_VERSION)\"" >> xversion.h.tmp
@echo "#define CYRUS_GITVERSION \"`git log --abbrev=8 --pretty=\"format:%h %ci\" -1 | cut -d\" \" -f1,2`\"" >> xversion.h.tmp
@cmp -s xversion.h.tmp xversion.h || mv xversion.h.tmp xversion.h
@rm -f xversion.h.tmp
dist-hook: doc/text/htmlstrip doc/man/cyradm.1.html doc/man/sieveshell.1.html
@$(MKDIR_P) doc/text doc/man
for man in $(top_builddir)/man/*.[1-9] $(top_srcdir)/man/*.[1-9]; \
do \
echo "=== $$man ==="; \
groff -man -Thtml $$man > doc/man/`basename $$man`.html; \
done
rm -f doc/groff-html-*.png
for file in $(top_srcdir)/doc/*.html; \
do \
echo "=== $$file ==="; \
doc/text/htmlstrip $$file > doc/text/`basename $$file .html`; \
done
@rm doc/text/htmlstrip doc/text/htmlstrip.o doc/text/.dirstamp
@echo "== done =="
install-data-hook:
if CMULOCAL
$(INSTALL) -m 644 $(top_srcdir)/depot/depot.conf $(DESTDIR)/
endif
install-exec-hook:
if PERL
for s in installsieve sieveshell; \
do \
$(PERL_PREINSTALL) < perl/sieve/scripts/$$s.pl > perl/sieve/scripts/$$s ;\
$(INSTALL) -m 755 perl/sieve/scripts/$$s $(DESTDIR)$(bindir)/$$s ; \
done
endif
## The @$(MKDIR_P) line is added due to a bug in Automake 1.10 and can be removed if using Automake 1.12.
@$(MKDIR_P) $(DESTDIR)$(userdir)
@$(MKDIR_P) $(DESTDIR)$(servicedir)
if SERVER
cd $(DESTDIR)$(servicedir) && \
$(LN_S) -f pop3d pop3proxyd && \
$(LN_S) -f imapd proxyd && \
$(LN_S) -f lmtpd lmtpproxyd
endif
## The @$(MKDIR_P) line is added due to a bug in Automake 1.10 and can be removed if using Automake 1.12.
@$(MKDIR_P) $(DESTDIR)$(bindir)
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f imtest lmtptest && \
$(LN_S) -f imtest mupdatetest && \
$(LN_S) -f imtest nntptest && \
$(LN_S) -f imtest pop3test && \
$(LN_S) -f imtest sivtest && \
$(LN_S) -f imtest smtptest && \
$(LN_S) -f imtest synctest
SUFFIXES = .fig.png
.fig.png:
fig2dev -L png $< $@
valgrind:
$(MAKE) VG=yes check
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool
diff --git a/configure.ac b/configure.ac
index a98e7db8a..0ad3e44c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,1784 +1,1805 @@
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl
dnl 1. Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl
dnl 2. Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in
dnl the documentation and/or other materials provided with the
dnl distribution.
dnl
dnl 3. The name "Carnegie Mellon University" must not be used to
dnl endorse or promote products derived from this software without
dnl prior written permission. For permission or any legal
dnl details, please contact
dnl Carnegie Mellon University
dnl Center for Technology Transfer and Enterprise Creation
dnl 4615 Forbes Avenue
dnl Suite 302
dnl Pittsburgh, PA 15213
dnl (412) 268-7393, fax: (412) 268-7395
dnl innovation@andrew.cmu.edu
dnl
dnl 4. Redistributions of any form whatsoever must retain the following
dnl acknowledgment:
dnl "This product includes software developed by Computing Services
dnl at Carnegie Mellon University (http://www.cmu.edu/computing/)."
dnl
dnl CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
dnl THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dnl AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
dnl FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
dnl AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
dnl OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl
dnl configure.ac for the Cyrus imapd
dnl
AC_INIT([cyrus-imapd], [3.0], [http://bugzilla.cyrusimap.org],,[http://www.cyrusimap.org])
AC_PREREQ([2.63])
AC_CONFIG_SRCDIR([imap/imapd.c])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([cmulocal])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign dist-bzip2 no-installinfo subdir-objects])
AC_CONFIG_LIBOBJ_DIR([lib])
dnl if the git repository is here we also have git
if test -d ".git/"; then
git_bin=$(which git 2>/dev/null)
if test "x$git_bin" != "x"; then
if test -x "/$(which git 2>/dev/null)"; then
git_branch=$(git branch -l | grep ^* | sed -e 's/* //g')
case "$git_branch" in
cyrus-imapd-*)
git_tag=$(git tag -l | grep -E "$git_branch\." | sort --version-sort | tail -n 1)
git_revs=$(git log $git_tag..HEAD --pretty=oneline 2>/dev/null | wc -l)
if test "x$git_revs" != "x0"; then
git_version=".$git_revs"
fi
;;
master)
git_revs=$(git log 777a1b46..HEAD --pretty=oneline | wc -l)
git_version="-dev$git_revs"
;;
esac
fi
fi
fi
AC_SUBST(git_version)
dnl Useful hook for distributions
AC_ARG_WITH(extraident,
[AS_HELP_STRING([--with-extraident=STRING],[use STRING as extra version information])],
[AC_DEFINE_UNQUOTED(EXTRA_IDENT,"$withval", [Extra version information for imap/version.h])])
AM_MAINTAINER_MODE
AC_ARG_ENABLE(coverage,
[AS_HELP_STRING([--enable-coverage],[enable C test coverage])],
[COV_CFLAGS="--coverage"
COV_LDFLAGS="--coverage"
],[
COV_CFLAGS=
COV_LDFLAGS=
])
AC_SUBST(COV_CFLAGS)
AC_SUBST(COV_LDFLAGS)
AC_ARG_WITH(login,,AC_MSG_ERROR([--with-login is no longer supported.
Configure SASL appropriately instead.]))
dnl We need to derive default values for --with-cyrus-prefix and
dnl --with-service-path based on $prefix, but $prefix may currently
dnl be set to "NONE" for autoconf reasons, so work around that.
if test "x$prefix" = "xNONE"; then
myprefix="$ac_default_prefix"
else
myprefix="$prefix"
fi
AC_ARG_WITH(cyrus-prefix,
[AS_HELP_STRING([--with-cyrus-prefix=DIR], [use DIR as cyrus server install directory [PREFIX/cyrus]])],
cyrus_prefix="$withval",cyrus_prefix="$myprefix/cyrus")
AC_DEFINE_UNQUOTED(CYRUS_PATH,"$cyrus_prefix",[Where will we be installed?])
AC_ARG_WITH(service-path,
[AS_HELP_STRING([--with-service-path=DIR], [use DIR as service install directory [CYRUSPREFIX/bin]])],
servicedir="$withval",servicedir="$cyrus_prefix/bin")
userdir=$servicedir
AC_SUBST(userdir)
AC_SUBST(servicedir)
AC_DEFINE_UNQUOTED(SERVICE_DIR,"$servicedir",[Directory to use for service binaries])
AC_ARG_WITH(cyrus-user,
[AS_HELP_STRING([--with-cyrus-user=USERID], [use USERID cyrus userid])],
cyrus_user="$withval",cyrus_user="cyrus")
AC_SUBST(cyrus_user)
AC_DEFINE_UNQUOTED(CYRUS_USER, "$cyrus_user",[What user will we run as?])
AC_ARG_WITH(cyrus-group,
[AS_HELP_STRING([--with-cyrus-group=GROUPID], [use GROUPID cyrus group])],
cyrus_group="$withval",cyrus_group="mail")
AC_SUBST(cyrus_group)
dnl allow users to override $sysconfdir, but retain old default (/etc)
dnl if not specified
if test $sysconfdir = '${prefix}/etc'; then
sysconfdir="/etc"
fi
AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir",[Config File Location])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_USE_SYSTEM_EXTENSIONS
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_C_INLINE
gl_VISIBILITY
AH_BOTTOM([#if HAVE_VISIBILITY
#define EXPORTED __attribute__((__visibility__("default")))
#define HIDDEN __attribute__((__visibility__("hidden")))
#else
#define EXPORTED
#define HIDDEN
#endif])
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
AC_SUBST([LIBTOOL_DEPS])
dnl Check the size of various types
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(off_t)
dnl Check that `long long int' is available
AC_CHECK_SIZEOF(long long int)
AC_CHECK_SIZEOF(unsigned long long int)
if test "$ac_cv_sizeof_long_long_int" -eq 8 -a \
"$ac_cv_sizeof_unsigned_long_long_int" -eq 8; then
AC_C_BIGENDIAN
else
AC_MSG_ERROR(The Cyrus IMAPD requires support for long long int)
fi
dnl check for -R, etc. switch
CMU_GUESS_RUNPATH_SWITCH
AC_CHECK_HEADERS(unistd.h sys/select.h sys/param.h stdarg.h)
AC_REPLACE_FUNCS(memmove strcasecmp ftruncate strerror posix_fadvise strsep memmem)
AC_CHECK_FUNCS(strlcat strlcpy getgrouplist fmemopen pselect)
AC_HEADER_DIRENT
dnl check whether to use getpassphrase or getpass
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_FUNCS(getpassphrase)
dnl do this before Berkeley DB/IPv6 detection
CMU_SOCKETS
LIBS="$LIBS ${LIB_SOCKET}"
dnl check for IPv6 functions (fall back to sasl's if we don't have them)
cyrus_cv_getaddrinfo=yes
IPv6_CHECK_FUNC(getaddrinfo, [IPv6_CHECK_FUNC(gai_strerror,
AC_DEFINE(HAVE_GETADDRINFO,[],[Do we have a getaddrinfo?]),
cyrus_cv_getaddrinfo=no)], cyrus_cv_getaddrinfo=no)
cyrus_cv_getnameinfo=yes
IPv6_CHECK_FUNC(getnameinfo,
AC_DEFINE(HAVE_GETNAMEINFO,[],[Do we have a getnameinfo?]),
cyrus_cv_getnameinfo=no)
AM_CONDITIONAL([IPV6_noGETADDRINFO], [test $cyrus_cv_getaddrinfo = no])
AM_CONDITIONAL([IPV6_noGETNAMEINFO], [test $cyrus_cv_getnameinfo = no])
IPv6_CHECK_SS_FAMILY()
IPv6_CHECK_SA_LEN()
dnl this is to check for time things
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
AC_CHECK_FUNCS(timegm)
AC_SUBST(CPPFLAGS)
AC_SUBST(LOCALDEFS)
AC_FUNC_VPRINTF
dnl function for doing each of the database backends
dnl parameters: backend name, variable to set, withval
dnl SQL DB Detection
HAVE_SQL=0
dnl MySQL Detection
dnl legacy options --with-mysql-libdir and --with-mysql-incdir
CYRUS_MYSQL_OPTS
if test "$with_mysql_lib" != none ; then
AC_MSG_NOTICE([Legacy option --with-mysql-libdir=DIR detected.]
[You may wish to change to --with-mysql which works now.])
withval="$with_mysql_lib/.."
else
withval="no"
fi
AC_MSG_CHECKING([whether to use MySQL])
AC_ARG_WITH(mysql,
[AS_HELP_STRING([--with-mysql=DIR], [use MySQL (in DIR) [no]])])
with_mysql=$withval
case "$with_mysql" in
no)
# Explicitly disable MySQL
;;
yes)
# Find mysql_config in $PATH
mysql_config=mysql_config
;;
*)
# Find mysql_config in the specified directory
mysql_config="$with_mysql/bin/mysql_config"
if test ! -x "$mysql_config" ; then
AC_MSG_ERROR([The mysql_config program was not found]
[in $with_mysql/bin, disabling MySQL support])
with_mysql="no"
fi
;;
esac
if test "$with_mysql" != "no"; then
MYSQL_LIBADD=`$mysql_config --libs`
MYSQL_INCADD=`$mysql_config --cflags`
HAVE_SQL=1
LIBS="${LIBS} ${MYSQL_LIBADD}"
CPPFLAGS="${MYSQL_INCADD} ${CPPFLAGS}"
AC_DEFINE(HAVE_MYSQL,[],[Build in MySQL support?])
fi
AC_MSG_RESULT($with_mysql)
dnl End MySQL Detection
dnl PgSQL Detection
AC_ARG_WITH(pgsql,
[AS_HELP_STRING([--with-pgsql=DIR], [use PostgreSQL (in DIR) [no]])],
with_pgsql=$withval, with_pgsql="no")
case "$with_pgsql" in
no)
use_pgsql="no"
;;
yes)
use_pgsql="yes"
with_pgsql_lib=none
with_pgsql_inc=none
;;
*)
use_pgsql="yes"
with_pgsql_lib="$with_pgsql/lib"
with_pgsql_inc="$with_pgsql/include"
;;
esac
if test "$use_pgsql" != "no"; then
CYRUS_PGSQL_CHK()
if test "$pgsqllib" = "no"; then
AC_MSG_ERROR([PgSQL was not found. You may need to supply the
--with-pgsql-libdir or --with-pgsql-incdir configure options.])
else
HAVE_SQL=1
fi
if test "$with_pgsql_lib" != "none"; then
CMU_ADD_LIBPATH($with_pgsql_lib)
fi
LIBS="${LIBS} ${PGSQL_LIBADD}"
CPPFLAGS="${PGSQL_INCADD} ${CPPFLAGS}"
AC_DEFINE(HAVE_PGSQL,[],[Build in PgSQL support?])
fi
dnl End PgSQL Detection
dnl SQLite Detection
AC_ARG_WITH(sqlite,
[AS_HELP_STRING([--with-sqlite=DIR], [use SQLite (in DIR) [no]])],
with_sqlite=$withval, with_sqlite=no)
case "$with_sqlite" in
no)
use_sqlite="no"
;;
yes)
use_sqlite="yes"
with_sqlite_lib=none
with_sqlite_inc=none
;;
*)
use_sqlite="yes"
with_sqlite_lib="$with_sqlite/lib"
with_sqlite_inc="$with_sqlite/include"
;;
esac
if test "$use_sqlite" != "no"; then
CYRUS_SQLITE_CHK()
if test "$sqlitelib" = "no"; then
AC_MSG_ERROR([Sqlite was not found. You may need to supply the
--with-sqlite-libdir or --with-sqlite-incdir configure options.])
else
HAVE_SQL=1
fi
if test "$with_sqlite_lib" != "none"; then
CMU_ADD_LIBPATH($with_sqlite_lib)
fi
LIBS="${LIBS} ${SQLITE_LIBADD}"
CPPFLAGS="${SQLITE_INCADD} ${CPPFLAGS}"
AC_DEFINE(HAVE_SQLITE,[],[Build in SQLite support?])
fi
dnl End SQLite Detection
AM_CONDITIONAL([USE_SQL], [test $HAVE_SQL = 1])
dnl End SQL DB Detection
dnl
dnl Search engines - SQUAT
dnl
AC_ARG_ENABLE(squat,
[ --disable-squat disable Squat support])
if test "x$enable_squat" != xno ; then
AC_DEFINE(USE_SQUAT,[],[Build in Squat support?])
fi
AM_CONDITIONAL([USE_SQUAT], [test "${enable_squat}" != "no"])
+dnl
+dnl Search engines - Sphinx
+dnl
+
+AC_ARG_ENABLE(sphinx,
+ [ --enable-sphinx disable Sphinx support],[
+ enable_sphinx=$enableval
+ ],[
+ enable_sphinx=no
+ ])
+if test "x$enable_sphinx" != xno ; then
+ AC_DEFINE(USE_SPHINX,[],[Build in Sphinx support?])
+fi
+AM_CONDITIONAL([USE_SPHINX], [test "${enable_sphinx}" != "no"])
+
+dnl Note that Sphinx' searchd uses the MySQL protocol
+dnl so we need to link with the MySQL client libraries.
+if test "$enable_sphinx" = yes -a "$with_mysql" = no ; then
+ AC_MSG_ERROR([Sphinx requires MySQL but you have not used --with-mysql; disabling Sphinx])
+ enable_sphinx=no
+fi
AC_ARG_ENABLE(sieve,
[AS_HELP_STRING([--disable-sieve], [disable Sieve support])],,[enable_sieve="yes";])
AC_ARG_ENABLE(pcre,
[AS_HELP_STRING([--disable-pcre], [disable PCRE library])])
if test "$enable_sieve" != "no"; then
AC_DEFINE(USE_SIEVE,[],[Build in Sieve support?])
dnl Sieve configure stuff
AC_PROG_YACC
AM_PROG_LEX
if test "$enable_pcre" != "no"; then
AC_CHECK_HEADER(pcreposix.h)
if test "$ac_cv_header_pcreposix_h" = "yes"; then
AC_MSG_CHECKING(for utf8 enabled pcre)
AC_CACHE_VAL(cyrus_cv_pcre_utf8, AC_TRY_CPP([#include <pcreposix.h>
#ifndef REG_UTF8
#include </nonexistent>
#endif],cyrus_cv_pcre_utf8=yes,cyrus_cv_pcre_utf8=no))
AC_MSG_RESULT($cyrus_cv_pcre_utf8)
else
cyrus_cv_pcre_utf8="no"
fi
fi
if test "$cyrus_cv_pcre_utf8" = "yes"; then
LIBS="$LIBS -lpcre -lpcreposix";
AC_DEFINE(ENABLE_REGEX, [], [Do we have a regex library?])
AC_DEFINE(HAVE_PCREPOSIX_H, [], [Do we have usable pcre library?])
else
AC_CHECK_HEADERS(rxposix.h)
if test "$ac_cv_header_rxposix_h" = "yes"; then
LIBS="$LIBS -lrx"
AC_DEFINE(ENABLE_REGEX, [],
[Do we have a regex library?])
else
AC_SEARCH_LIBS(regcomp, regex,
AC_DEFINE(ENABLE_REGEX, [],
[Do we have a regex library?]), [])
fi
fi
fi
AM_CONDITIONAL([SIEVE], [test "${enable_sieve}" != "no"])
dnl for et routines
AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR,[],[Do we have strerror()?]),
AC_DEFINE(NEED_SYS_ERRLIST,[],[Do we have a sys_errlist?]))
dnl for master fd limits
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_FUNCS(setrlimit)
AC_CHECK_FUNCS(getrlimit)
dnl for detaching terminal
AC_CHECK_FUNCS(daemon setsid)
dnl for turning off sockets
AC_CHECK_FUNCS(shutdown)
AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_DEFINE(HAVE_SOCKLEN_T,[],[Do we have a socklen_t?]))
AC_EGREP_HEADER(sockaddr_storage, sys/socket.h,
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE,[],[Do we have a sockaddr_storage?]))
AC_EGREP_HEADER(rlim_t, sys/resource.h, AC_DEFINE(HAVE_RLIM_T,[],[Do we have an rlim_t?]))
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,[Do we already have setproctitle?])
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))
AM_CONDITIONAL([NONBLOCK_FCNTL], [test "$cyrus_cv_sys_nonblock" = "fcntl"])
AC_MSG_RESULT($cyrus_cv_sys_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))
AM_CONDITIONAL([GMTOFF_TM], [test "$cyrus_cv_struct_sys_gmtoff" = "tm"])
AC_MSG_RESULT($cyrus_cv_struct_sys_gmtoff)
AC_MSG_CHECKING(for shared mmap)
AC_CACHE_VAL(cyrus_cv_func_mmap_shared,AC_TRY_RUN([
#include <fcntl.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
int main() {
char *base;
int mmapflags = MAP_SHARED;
int fd = open("conftestmmap", O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd == -1) return 1;
if (write(fd, "test", 4) != 4) return 1;
fsync(fd);
#ifdef MAP_FILE
mmapflags |= MAP_FILE;
#endif
#ifdef MAP_VARIABLE
mmapflags |= MAP_VARIABLE;
#endif
base = mmap((caddr_t)0, 100, PROT_READ, mmapflags, fd, 0L);
if (base == (caddr_t)-1) return 1;
if (memcmp(base, "test", 4) != 0) return 1;
if (write(fd, "test", 4) != 4) return 1;
fsync(fd);
if (memcmp(base+4, "test", 4) != 0) return 1;
return 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
found_map="shared"
else
AC_MSG_CHECKING(for stupid shared mmap)
AC_CACHE_VAL(cyrus_cv_func_mmap_stupidshared,AC_TRY_RUN([
#include <fcntl.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
int main() {
char *base;
int fd = open("conftestmmap", O_RDWR|O_CREAT|O_TRUNC, 0666);
int mmapflags = MAP_SHARED;
if (fd == -1) return 1;
if (write(fd, "test", 4) != 4) return 1;
fsync(fd);
#ifdef MAP_FILE
mmapflags |= MAP_FILE;
#endif
#ifdef MAP_VARIABLE
mmapflags |= MAP_VARIABLE;
#endif
base = mmap((caddr_t)0, 4, PROT_READ, mmapflags, fd, 0L);
if (base == (caddr_t)-1) return 1;
if (memcmp(base, "test", 4) != 0) return 1;
lseek(fd, 0L, 0);
if (write(fd, "xyzz", 4) != 4) return 1;
fsync(fd);
if (memcmp(base, "xyzz", 4) != 0) return 1;
return 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
found_map="stupidshared"
else
AC_MSG_WARN([*** This system does not have a working mmap()])
AC_MSG_WARN(*** Expect a considerable performance penalty)
found_map=nommap
fi
fi
AC_ARG_WITH(mmap,
[AS_HELP_STRING([--with-mmap=TYPE], [force shared/stupidshared/nommap - JUST FOR TESTING])],
WITH_MAP="$withval",WITH_MAP="$found_map")
AM_CONDITIONAL([MAP_SHARED], [test "$WITH_MAP" = "shared"])
AM_CONDITIONAL([MAP_STUPIDSHARED], [test "$WITH_MAP" = "stupidshared"])
AC_ARG_WITH(lock,
[AS_HELP_STRING([--with-lock=METHOD], [force use of METHOD for locking (flock or fcntl)])],
WITH_LOCK="$withval", [
AC_CHECK_FUNC(fcntl,WITH_LOCK="fcntl",[
AC_CHECK_FUNC(flock,WITH_LOCK="flock",[
AC_MSG_ERROR(unable to detect locking method)
])
])
])
AM_CONDITIONAL([LOCK_FCNTL], [test $WITH_LOCK = "fcntl"])
dnl check for fdatasync (used by cyrusdb_skiplist)
LIB_RT=""
AC_CHECK_FUNC(fdatasync, AC_DEFINE(HAVE_FDATASYNC,[],[Do we have fdatasync()?]), [
AC_CHECK_LIB(rt, fdatasync, [
LIB_RT="-lrt"
AC_DEFINE(HAVE_FDATASYNC,[],[Do we have fdatasync()?])
])
])
dnl check for libuuid (used when generating mailbox uniqueids)
LIB_UUID=
AC_CHECK_LIB(uuid, uuid_generate,[
LIB_UUID="-luuid"
AC_DEFINE(HAVE_LIBUUID,[],[Do we have the uuid library])
])
dnl for AFS.
cant_find_sigvec=no
AC_CACHE_VAL(cyrus_cv_sigveclib,[
dnl bsd classic flavor
AC_CHECK_FUNC(sigvec, [
cyrus_cv_sigveclib=""
], [
dnl hp flavor
AC_CHECK_LIB(BSD, sigvec, cyrus_cv_sigveclib="-lBSD", [
dnl not hp flavor
SAVE_LDFLAGS="$LDFLAGS"
dnl solaris flavor
LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS"
AC_CHECK_LIB(ucb, sigvec, [
dnl more solaris flavor
cyrus_cv_sigveclib="-lc -L/usr/ucblib -R/usr/ucblib -lucb"],
[ cant_find_sigvec=yes ])
LDFLAGS="$SAVE_LDFLAGS"])
])
])
AC_SUBST(cyrus_cv_sigveclib)
# ok, we still look for this stuff because of checking groups, but
# all authentication goes through SASL
AC_ARG_ENABLE([afs],
[AS_HELP_STRING([--enable-afs], [Enable AFS with ptloader])])
AC_ARG_WITH(afs-libdir,
[AS_HELP_STRING([--with-afs-libdir=DIR], [use AFS libraries from DIR [/usr/lib]])],
afs_libdir="${withval}", afs_libdir="/usr/lib")
AC_ARG_WITH(afs-incdir,
[AS_HELP_STRING([--with-afs-incdir=DIR], [use AFS headers from DIR [/usr/include]])],
afs_incdir="${withval}", afs_incdir="/usr/include")
AC_ARG_WITH(ldap,
[AS_HELP_STRING([--with-ldap=DIR], [use LDAP (in DIR) (experimental) [/usr/local]])],
with_ldap="${withval}", with_ldap="no")
dnl select mode of afspts
AC_ARG_ENABLE(krb5afspts,
[AS_HELP_STRING([--enable-krb5afspts], [compile afskrb PTS module with krb5 support])])
if test "x$enable_afs" = "xyes"; then
# krb5afspts is only valid if AFS is enabled, so check inside here.
AS_IF([test "x$enable_krb5afspts" = "xyes"], [SASL_SET_GSSAPI_LIBS
AC_DEFINE(AFSPTS_USE_KRB5,[],[Should the AFS PTS plugin use krb5?])
])
CFLAGS="${CFLAGS} -I${with_afs_incdir}"
AFS_LIBS="${with_afs_libdir}/afs/libkauth.a ${with_afs_libdir}/afs/libprot.a ${with_afs_libdir}/afs/libauth.a ${with_afs_libdir}/afs/libsys.a ${with_afs_libdir}/librxkad.a ${with_afs_libdir}/librx.a ${with_afs_libdir}/afs/libsys.a ${with_afs_libdir}/libubik.a ${with_afs_libdir}/afs/liblwp.a ${with_afs_libdir}/afs/util.a ${with_afs_libdir}/afs/libafscom_err.a -lresolv"
if test -f ${with_afs_libdir}/afs/libaudit.a; then
AFS_LIBS="$AFS_LIBS ${with_afs_libdir}/afs/libaudit.a"
fi
if test -f /usr/ucblib/libucb.a; then
CMU_ADD_LIBPATH_TO(/usr/ucblib, AFS_LDFLAGS)
AFS_LIBS="$AFS_LIBS -lc -lucb"
fi
if test -f ${with_afs_libdir}/afs/libdes.a; then
AFS_LIBS="$AFS_LIBS ${with_afs_libdir}/afs/libdes.a"
else
AFS_LIBS="$AFS_LIBS -ldes"
fi
AC_CACHE_VAL(cyrus_cv_afs_sigvec,[
SAVE_LIBS="$LIBS"
LIBS="${with_afs_libdir}/liblwp.a"
AC_MSG_CHECKING(if AFS libraries need sigvec)
dnl Does AFS need sigvec? We have to link against lwp and see
dnl if IOMGR_Initialize wants it
AC_TRY_LINK([IOMGR_Initialize();],
[IOMGR_Initialize()],
[
dnl it linked; don't need it
AC_MSG_RESULT(no)
cyrus_cv_afs_sigvec="no"
], [
dnl didn't link; pick up sigvec
AC_MSG_RESULT(yes)
cyrus_cv_afs_sigvec="yes"
])
])
if test "$cyrus_cv_afs_sigvec" = yes; then
if test "$cant_find_sigvec" = yes; then
AC_MSG_WARN([Can not find a sigvec for AFS libraries which seem to need one.])
else
AFS_LIBS="${AFS_LIBS} $cyrus_cv_sigveclib"
AC_DEFINE(HAVE_AFSKRB,[],[Should we build afskrb pts module?])
fi
else
AFS_LIBS="${AFS_LIBS}"
AC_DEFINE(HAVE_AFSKRB,[],[Should we build afskrb pts module?])
fi
LIBS="$SAVE_LIBS"
AC_SUBST(AFS_LDFLAGS)
AC_SUBST(AFS_LIBS)
fi
AM_CONDITIONAL([USE_AFSKRB], [grep HAVE_AFSKRB confdefs.h >/dev/null])
have_ldap=no
LDAP_CPPFLAGS=
LDAP_LDFLAGS=
LDAP_LIBS=
case "x$with_ldap" in
xno)
# default args or --without-ldap
# do not try to enable
;;
xyes)
# --with-ldap
# try to enable, search in default system directories
ldap_cppflags=
ldap_ldflags=
;;
*)
# --with-ldap=DIR
# try to enable, search in given install directory
if test "x$with_ldap" != "x" -a -d "$with_ldap"; then
ldap_cppflags="-I${with_ldap}/include"
ldap_ldflags="-L${with_ldap}/lib"
with_ldap=yes
else
AC_WARN([Disabling LDAP - no include files found])
with_ldap=no
fi
esac
if test $with_ldap = yes; then
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $ldap_cppflags"
LDFLAGS="$LDFLAGS $ldap_ldflags"
AC_CHECK_LIB(ldap, ldap_initialize, [
AC_DEFINE(HAVE_LDAP,[],[Should we build the LDAP pts module?])
LDAP_CPPFLAGS="$ldap_cppflags"
LDAP_LDFLAGS="$ldap_ldflags"
LDAP_LIBS="-lldap -llber"
have_ldap=yes
],,-llber)
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
fi
AC_SUBST(LDAP_CPPFLAGS)
AC_SUBST(LDAP_LDFLAGS)
AC_SUBST(LDAP_LIBS)
AM_CONDITIONAL([HAVE_LDAP], [test "$have_ldap" = "yes"])
AM_CONDITIONAL([PTCLIENT], [test "x$enable_afs" = "xyes" -o "$have_ldap" = "yes"])
AC_ARG_WITH(
clamav,
[ --with-clamav=DIR use ClamAV from PATH (yes)],
with_clamav=$withval,
with_clamav=yes
)
if test "$with_clamav" != no; then
if test -d $with_clamav; then
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
save_LIBS="$LIBS"
CPPFLAGS="${CPPFLAGS} -I${with_clamav}/include"
LDFLAGS="$LDFLAGS -L${with_clamav}/$CMU_LIB_SUBDIR"
AC_CHECK_LIB(
wrap,
request_init,
[AC_CHECK_HEADER(clamav.h,, with_clamav=no)],
with_clamav=no
)
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
fi
fi
AC_MSG_CHECKING(ClamAV support)
AC_MSG_RESULT($with_clamav)
LIB_CLAMAV=""
if test "$with_clamav" != "no"; then
AC_DEFINE(HAVE_CLAMAV,[],[Do we have ClamAV?])
if test -d "$with_clamav"; then
CPPFLAGS="${CPPFLAGS} -I${with_clamav}/include"
LIB_CLAMAV="-L${with_clamav}/$CMU_LIB_SUBDIR -lclamav"
else
LIB_CLAMAV="-lclamav"
fi
fi
AC_SUBST(LIB_CLAMAV)
AM_CONDITIONAL([HAVE_CLAMAV], [test "$have_clamav" = "yes"])
AC_ARG_ENABLE(server,
[AS_HELP_STRING([--disable-server], [disable compiling servers])])
AM_CONDITIONAL([SERVER], [test "$enable_server" != "no"])
# We always output a server makefile (just because we can)
dnl this is the new simple check for kerberos; since the person had to
dnl compile SASL, we might as well use the same checks.
AC_ARG_WITH(krb,
[AS_HELP_STRING([--with-krb=DIR], [use Kerberos from DIR])],
with_krb="$withval", with_krb="no")
AC_ARG_WITH(krbimpl,
[AS_HELP_STRING([--with-krbimpl=kth|mit], [assume Kerberos 4 from KTH or MIT])],
with_krbimpl="$withval", with_krbimpl="kth")
AC_ARG_ENABLE(statickrb,
[AS_HELP_STRING([--enable-statickrb], [link Kerberos statically])],
with_statickrb="yes", with_statickrb="no")
dnl In order to compile kerberos4, we need libkrb and libdes.
dnl we might need -lresolv for kerberos
AC_CHECK_LIB(resolv,res_search)
if test "$with_statickrb" = "yes" -a ! -d "$with_krb"; then
AC_MSG_ERROR([--enable-statickrb specified but --with-krb did not specify a valid directory])
fi
if test "$with_krb" != "no"; then
dnl Do we need DES for kerberos?
AC_ARG_WITH(krbdes,
[AS_HELP_STRING([--with-krbdes], [use Kerberos DES implementation [yes]])],
with_krbdes="$withval", with_krbdes="yes")
if test "$with_krbdes" = "yes"; then
AC_CHECK_LIB(des,des_ecb_encrypt,
if test "$with_statickrb" = "yes"; then
KRB_LIBS="$with_krb/lib/libdes.a"
else
KRB_LIBS="-ldes"
fi,
AC_MSG_ERROR([The Kerberos DES library is required for Kerberos support. You might want --with-auth=unix.]))
fi
fi
dnl if we were ambitious, we'd look more aggressively for the
dnl krb4 install
if test -d ${with_krb}; then
AC_CACHE_CHECK(for Kerberos includes, cyrus_cv_krbinclude, [
for krbhloc in include/kerberosIV include
do
if test -f ${with_krb}/${krbhloc}/krb.h ; then
cyrus_cv_krbinclude=${with_krb}/${krbhloc}
break
fi
done
])
if test -n "${cyrus_cv_krbinclude}"; then
CPPFLAGS="$CPPFLAGS -I${cyrus_cv_krbinclude}"
fi
CMU_ADD_LIBPATH(${with_krb}/lib)
fi
if test "$with_krbimpl" != "kth"; then
KRBLIB="krb4"
else
KRBLIB="krb"
fi
if test "$with_des" != no; then
AC_CHECK_HEADER(krb.h,
AC_CHECK_LIB(${KRBLIB}, krb_mk_priv,
if test "$with_statickrb" = "yes"; then
KRB_LIBS="$KRB_LIBS $with_krb/lib/lib${KRBLIB}.a"
else
KRB_LIBS="$KRB_LIBS -l${KRBLIB}"
fi,
AC_WARN(No Kerberos V4 found); krb4=no,
$KRB_LIBS),
krb4=no)
else
AC_WARN(No DES library found for Kerberos V4 support)
krb4=no
fi
if test "${krb4}" != no; then
AC_DEFINE(HAVE_KRB,[],[Support for Kerberos?])
fi
LIBS="$KRB_LIBS $LIBS"
SASL_SET_GSSAPI_LIBS
dnl
dnl Test for OpenSSL
dnl
AC_ARG_WITH(openssl,
[AS_HELP_STRING([--with-openssl=DIR], [use OpenSSL from DIR])],
with_ssl="${withval}")
SSL_CPPFLAGS=
SSL_LIBS=
case "x$with_ssl" in
xno)
# --without-openssl
# do not try to enable
;;
x|xyes)
# default args or --with-openssl
# try to enable, search in default system directories
#
ssl_cppflags=
ssl_ldflags=
;;
*)
# --with-openssl=DIR
# try to enable, search in given install directory
if test -d "$with_ssl"; then
ssl_cppflags="-I${with_ssl}/include"
ssl_ldflags=
CMU_ADD_LIBPATH_TO(${with_ssl}/lib, ssl_ldflags)
with_ssl=yes
else
AC_WARN([Disabling OpenSSL - no include files found])
with_ssl=no
fi
esac
if test "$with_ssl" != "no"; then
save_CPPFLAGS="$CPPFLAGS"
save_LDFLAGS="$LDFLAGS"
CPPFLAGS="$CPPFLAGS $ssl_cppflags"
LDFLAGS="$LDFLAGS $ssl_ldflags"
AC_CHECK_HEADER(openssl/evp.h, [
with_ssl=yes
],[
with_ssl=no
])
dnl if openssl has been compiled with the rsaref2 libraries,
dnl we need to include the rsaref libraries in the crypto check
ssl_libs=
AC_CHECK_LIB(rsaref, RSAPublicEncrypt,[
ssl_libs="-lRSAglue -lrsaref"
],[
# whatever, we do not care
:
])
AC_CHECK_LIB(crypto, BIO_accept,[
ssl_libs="-lcrypto $ssl_libs"
],[
with_ssl=no
], $ssl_libs)
AC_CHECK_LIB(ssl, SSL_CTX_new, [
ssl_libs="-lssl $ssl_libs"
],[
with_ssl=no
], $ssl_libs)
if test "$with_ssl" = "no"; then
AC_WARN([Disabling SSL - no library files found])
fi
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
fi
AC_MSG_CHECKING(for ssl)
AC_MSG_RESULT($with_ssl)
if test "$with_ssl" != "no"; then
SSL_CPPFLAGS="$ssl_cppflags"
SSL_LIBS="$ssl_ldflags $ssl_libs"
AC_DEFINE(HAVE_SSL,[],[Build with SSL support?])
if test "${krb4}" != no; then
AC_DEFINE(OPENSSL_ENABLE_OLD_DES_SUPPORT,[],[Configure OpenSSL to provide legacy des apis])
AC_DEFINE(OPENSSL_DES_LIBDES_COMPATIBILITY,[],[Configure OpenSSL to provide krb4-compatible legacy des apis])
fi
fi
AM_CONDITIONAL([HAVE_SSL], [test "$with_ssl" != "no"])
AC_SUBST(SSL_CPPFLAGS)
AC_SUBST(SSL_LIBS)
dnl
dnl Allow for setting EGD socket file on systems without /dev/*random.
dnl
AC_ARG_WITH(egd-socket,
[AC_HELP_STRING([--with-egd-socket=FILE], [Entropy Gathering Daemon socket pathname for systems without /dev/urandom])],
[ EGD_SOCKET="$withval" ]
)
if test -n "$EGD_SOCKET" ; then
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET", [Alternative to /dev/urandom?])
fi
dnl
dnl Test for zlib
dnl
AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib=DIR],[use zlib from DIR])],
with_zlib=$withval, with_zlib="yes")
save_CPPFLAGS=$CPPFLAGS
save_LDFLAGS=$LDFLAGS
if test -d $with_zlib; then
CPPFLAGS="${CPPFLAGS} -I${with_lib}/include"
CMU_ADD_LIBPATH(${with_zlib}/$CMU_LIB_SUBDIR)
fi
ZLIB=""
case "$with_zlib" in
no)
with_zlib="no";;
*)
AC_CHECK_HEADER(zlib.h, [
AC_CHECK_LIB(z, deflate,
LIBS="${LIBS} -lz"; with_zlib="yes",
with_zlib="no",)],
with_zlib=no)
;;
esac
if test "$with_zlib" != "no"; then
AC_DEFINE(HAVE_ZLIB,[],[Do we have zlib?])
ZLIB="-lz"
else
CPPFLAGS=$save_CPPFLAGS
LDFLAGS=$save_LDFLAGS
fi
AC_MSG_CHECKING(for zlib)
AC_MSG_RESULT($with_zlib)
AC_SUBST(ZLIB)
dnl
dnl Test for Zephyr
dnl
AC_ARG_WITH(zephyr,
[AS_HELP_STRING([--with-zephyr=DIR], [enable Zephyr notification (installed on DIR)])],
with_zephyr="${withval}")
if test -z "$with_zephyr"; then
if test -f /usr/local/lib/libzephyr.a; then
with_zephyr="/usr/local"
elif test -f /usr/lib/libzephyr.a; then
with_zephyr="/usr"
fi
fi
ZEPHYR_LIBS=""
case "$with_zephyr" in
no) true;;
""|yes) AC_CHECK_LIB(zephyr,ZInitialize,ZEPHYR_LIBS="-lzephyr",
with_zephyr="no",);;
*) ZEPHYR_LIBS="-lzephyr";;
esac
AC_SUBST(ZEPHYR_LIBS)
if test "$with_zephyr" != "no"; then
AC_DEFINE(HAVE_ZEPHYR,[],[Build with Zephyr support?])
fi
AM_CONDITIONAL([ZEPHYR], [test "$with_zephyr" != "no"])
dnl
dnl Test for libcap (POSIX.1e - security API) on Linux systems
dnl
AC_ARG_WITH([libcap],
AS_HELP_STRING([--with-libcap], [Enable libcap system capabilities handling (Linux systems only)]),
with_libcap="${withval}")
have_libcap=no
case $host_os in
linux*)
if test "x$with_libcap" = "xyes"; then
AC_CHECK_LIB([cap], [cap_get_proc], have_libcap=yes, have_libcap=no)
AC_CHECK_HEADERS([sys/capability.h sys/prctl.h], , have_libcap=no)
if test "$have_libcap" = "yes"; then
AC_DEFINE(HAVE_LIBCAP, [], [Do we have libcap system capabilities handling (Linux systems only)?])
LIBS="$LIBS -lcap"
fi
fi
;;
*)
;;
esac
AC_MSG_CHECKING(for libcap)
AC_MSG_RESULT($have_libcap)
dnl
dnl Test for mailbox event notification
dnl enable requires the installation of jansson library
dnl
AC_ARG_ENABLE(event-notification,
[AS_HELP_STRING([--disable-event-notification], [disable compiling of mailbox event notification (that needs jansson library)])],,
[enable_event_notification="yes";])
if test "$enable_event_notification" != "no"; then
PKG_CHECK_MODULES([JANSSON], [jansson >= 2.0],
[check_jansson=true]
dnl call AC_SUBST macro to support pkg-config version older that 0.24 without any bad consequence for recent version
[AC_SUBST([JANSSON_LIBS])]
[AC_SUBST([JANSSON_CFLAGS])]
[AC_DEFINE(ENABLE_MBOXEVENT,[],[Build with support of mailbox event notification])],
[check_jansson=false]
[AC_MSG_WARN([jansson 2.0 or later was not found, but is required to enable mailbox event notification])]
enable_event_notification="no")
fi
AM_CONDITIONAL(JANSSON, test x$check_jansson = xtrue)
dnl
dnl Set pidfile location
dnl
AC_ARG_WITH(pidfile,
[AS_HELP_STRING([--with-pidfile=DIR], [pidfile in DIR [/var/run/cyrus-master.pid]])],
[MASTERPIDFILE="$withval"],
[MASTERPIDFILE="/var/run/cyrus-master.pid"])
MASTERPIDFILE="\"$MASTERPIDFILE\""
AC_DEFINE_UNQUOTED(MASTER_PIDFILE, $MASTERPIDFILE,[Name of the pidfile for master])
dnl
dnl see if we're compiling with autocreate support
dnl
AC_ARG_ENABLE(autocreate,
[AS_HELP_STRING([--enable-autocreate], [enable autocreate support])],,[enable_autocreate="no";])
AM_CONDITIONAL([AUTOCREATE], [test "$enable_autocreate" != "no"])
dnl
dnl see if we're compiling with IMAP idled support
dnl
AC_ARG_ENABLE(idled,
[AS_HELP_STRING([--enable-idled], [enable IMAP idled support])],,[enable_idled="no";])
AM_CONDITIONAL([IDLED], [test "$enable_idled" != "no"])
dnl
dnl see if we're compiling with NNTP support
dnl
AC_ARG_ENABLE(nntp,
[AS_HELP_STRING([--enable-nntp], [enable NNTP support])],,[enable_nntp="no";])
AM_CONDITIONAL([NNTPD], [test "$enable_nntp" != "no"])
dnl
dnl see if we're compiling the Murder support programs
dnl
AC_ARG_ENABLE(murder,
[AS_HELP_STRING([--enable-murder], [enable IMAP Murder support])],, [enable_murder="no";])
AM_CONDITIONAL([MURDER], [test "$enable_murder" != "no"])
if test "$enable_murder" != no; then
# for master/slave auto-selection
AC_CHECK_HEADERS(sys/sockio.h)
fi
dnl
dnl see if we're compiling with HTTP support
dnl
ENABLE_HTTP=no
AC_ARG_ENABLE(http,
[AS_HELP_STRING([--enable-http], [enable HTTP support])],, [enable_http="no";])
AM_CONDITIONAL([HTTPD], [test "$enable_http" != "no"])
HTTP_CPPFLAGS=
HTTP_LIBS=
if test "$enable_http" != no; then
dnl
dnl make sure all the modules we need are present
dnl
ENABLE_RSS=yes
ENABLE_DAV=yes
PKG_CHECK_MODULES([XML2], [libxml-2.0],,AC_MSG_ERROR([Need libxml-2.0 for http]))
PKG_CHECK_MODULES([ICAL], [libical],,AC_MSG_ERROR([Need libical for http]))
PKG_CHECK_MODULES([SQLITE3], [sqlite3],,AC_MSG_ERROR([Need sqlite3 for http]))
PKG_CHECK_MODULES([JSON], [jansson],,AC_MSG_ERROR([Need jansson for http]))
HTTP_LIBS="${XML2_LIBS} ${ICAL_LIBS} ${SQLITE3_LIBS} ${JSON_LIBS}"
HTTP_CPPFLAGS="${JSON_CFLAGS} ${SQLITE3_CFLAGS} ${ICAL_CFLAGS} ${XML2_CFLAGS}"
AC_DEFINE(HAVE_XML2,[],[Build in libxml support?])
AC_DEFINE(HAVE_ICAL,[],[Build in ical support?])
AC_DEFINE(HAVE_SQLITE3,[],[Build in SQLite support?])
AC_DEFINE(WITH_DAV,[],[Build DAV support into httpd?])
AC_DEFINE(WITH_JSON,[],[Build jCal/jCard/TZdist support into httpd?])
AC_CHECK_LIB(ical, icaltimezone_set_builtin_tzdata,
AC_DEFINE(HAVE_TZ_BY_REF,[],
[Build TZ by ref support into httpd?]))
AC_EGREP_HEADER(ICAL_TZUNTIL_PROPERTY, ical.h,
AC_DEFINE(HAVE_TZDIST_PROPS,[],
[Do we have built-in support for TZdist props?]))
CYRUS_OPENDKIM_CHK()
if test "$opendkimlib" = "yes"; then
AC_SUBST(DKIM_CFLAGS)
AC_SUBST(DKIM_LIBS)
AC_DEFINE(WITH_DKIM,[],[Build DKIM support into iSchedule?])
fi
AC_EGREP_HEADER(ICAL_SCHEDULESTATUS_PARAMETER, ical.h,
AC_DEFINE(HAVE_SCHEDULING_PARAMS,[],
[Do we have built-in support for scheduling params?]))
AC_EGREP_HEADER(ICAL_VAVAILABILITY_COMPONENT, ical.h,
AC_DEFINE(HAVE_VAVAILABILITY,[],
[Build VAVAILABILITY support into httpd?]))
AC_EGREP_HEADER(ICAL_VPOLL_COMPONENT, ical.h,
AC_DEFINE(HAVE_VPOLL,[],
[Build VPOLL support into httpd?]))
ENABLE_RSCALE=yes
PKG_CHECK_MODULES([ICU], [icu-i18n],, ENABLE_RSCALE=no)
if test "$ENABLE_RSCALE" != no; then
AC_SUBST(ICU_CFLAGS)
AC_SUBST(ICU_LIBS)
AC_CHECK_LIB(ical, icalrecur_rscale_token_handling_is_supported,
AC_DEFINE(HAVE_RSCALE,[], [Build RSCALE support into httpd?]))
fi
fi
AC_SUBST(HTTP_CPPFLAGS)
AC_SUBST(HTTP_LIBS)
dnl
dnl see if we're compiling replication support programs
dnl
AC_ARG_ENABLE(replication,
[AS_HELP_STRING([--enable-replication], [enable replication support (experimental)])],,[enable_replication="no";])
AM_CONDITIONAL([REPLICATION], [test "$enable_replication" != no])
dnl
dnl Try and find a system version of com_err.
dnl If we see something that looks a little wacky, ignore it (there are many
dnl deficient installs of com_err, unfortunately, which leave out compile_et)
dnl There is also a broken re-implementation of compile_et, apparently derived
dnl from the Kerberos project, being shipped in /usr/bin on MacOS X, see Bug #3711.
dnl
AC_ARG_WITH(com_err,
[AS_HELP_STRING([--with-com_err=DIR], [use com_err from path -- includes in DIR/include, libs in DIR/lib, and compile_et in DIR/bin])])
if test -z "$with_com_err"; then
# no value supplied
AC_CHECK_LIB(com_err, com_err, [
# com_err is already in library path
# guess we're okay
# can use system com_err
with_com_err=""
AC_CHECK_HEADER(et/com_err.h,
[AC_DEFINE(HAVE_ET_COM_ERR_H,[],[We need et/com_err.h])],
[AC_CHECK_HEADER(com_err.h,[],[AC_MSG_ERROR([cannot locate com_err.h])])])
AC_PATH_PROG(COMPILE_ET, compile_et, [no compile et])
], [
if test -f /usr/local/include/com_err.h -o -f /usr/local/include/et/com_err.h; then
with_com_err="/usr/local"
AC_PATH_PROG(COMPILE_ET, /usr/local/bin/compile_et, [no compile et])
elif test -f /usr/include/com_err.h -o -f /usr/include/et/com_err.h; then
with_com_err="/usr"
AC_PATH_PROG(COMPILE_ET, /usr/bin/compile_et, [no compile et])
else
# use ours
with_com_err=yes
fi
])
if test "${with_com_err}" = "no"; then
AC_MSG_WARN([com_err is required; included version will be used.])
with_com_err="yes"
fi
if test "${COMPILE_ET}" = "no compile et" -o "${COMPILE_ET}" = ""; then
AC_MSG_WARN([Parts of com_err distribuion were found, but not compile_et.])
AC_MSG_WARN([Will build com_err from included sources.])
with_com_err="yes" # build it ourselves
fi
fi
dnl Set up $COMPILE_ET first, we need to test it
case "$with_com_err" in
# built-in et
yes) # use the com_err we're gonna build
COMPILE_ET="\${abs_top_builddir}/com_err/et/compile_et"
;;
"") # no problem, we already have it in the paths
# we do nothing to pick it up
;;
*) # use whatever they told us, or whatever we found
COMPILE_ET="${with_com_err}/bin/compile_et"
;;
esac
if test "$with_com_err" != yes ; then
dnl Test that the specified compile_et produces correct output
dnl See bug #3711 for why this is necessary
TEST1=".cyrus-configure-test-$$"
/bin/rm -f $TEST1.et $TEST1.h $TEST1.c
echo "error_table imap" >> $TEST1.et
echo "ec IMAP_TESTING," >> $TEST1.et
echo " \"Testing\"" >> $TEST1.et
echo "end" >> $TEST1.et
"${COMPILE_ET}" $TEST1.et > /dev/null
compile_et_ok=no
if test -f $TEST1.h ; then
if test `awk '/IMAP_TESTING/{print $3}' $TEST1.h 2>/dev/null` = "(-1904809472L)" ; then
compile_et_ok=yes
fi
dnl Broken compile_et produces (2390157824L)
fi
/bin/rm -f $TEST1.et $TEST1.h $TEST1.c
if test "$compile_et_ok" = no ; then
# revert to the built-in compile_et
AC_MSG_WARN([It seems $COMPILE_ET is buggy, building our own])
with_com_err=yes
COMPILE_ET="\${abs_top_builddir}/com_err/et/compile_et"
fi
fi
case "$with_com_err" in
# built-in et
yes) # use the com_err we're gonna build
COM_ERR_LIBS="com_err/et/libcyrus_com_err.la"
COM_ERR_CPPFLAGS="-I\${top_srcdir}/com_err/et"
;;
"") # no problem, we already have it in the paths
# we do nothing to pick it up
COM_ERR_LIBS="-lcom_err" # hope it's not shared
# we already set COMPILE_ET, or we didn't get here
COM_ERR_CPPFLAGS=""
;;
*) # use whatever they told us, or whatever we found
COM_ERR_LIBS="${with_com_err}/lib/libcom_err.a"
COM_ERR_CPPFLAGS="-I${with_com_err}/include"
# Ever get the feeling people hide this stuff on purpose?
if test -d "${with_com_err}/include/et" ; then
COM_ERR_CPPFLAGS="-I${with_com_err}/include/et"
fi
esac
AM_CONDITIONAL([COM_ERR], [test "$with_com_err" = "yes"])
if test "$with_com_err" = "yes"; then
PKG_CONFIG_COM_ERR_LIB="-lcyrus_com_err"
fi
AC_SUBST(PKG_CONFIG_COM_ERR_LIB)
AC_SUBST(COMPILE_ET)
AC_SUBST(COM_ERR_LIBS)
AC_SUBST(COM_ERR_CPPFLAGS)
if test "$USE_MAINTAINER_MODE" = "yes" ; then
AC_CHECK_PROG(GPERF,gperf,yes,no)
if test "$GPERF" != "yes"; then
AC_MSG_ERROR([gperf is not installed on this system, but is required for maintainer mode build rules])
fi
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))
AC_MSG_RESULT($cyrus_cv_lib_syslog)
AC_MSG_CHECKING(which syslog facility to use)
SYSLOG_FACILITY=LOG_LOCAL6
AC_ARG_WITH(syslogfacility,
[AS_HELP_STRING([--with-syslogfacility=FACILITY], [set the syslog facility to use (default LOCAL6)])],
[ if test "$withval" != "yes" -a "$withval" != "no" ; then
SYSLOG_FACILITY=LOG_$withval
fi; ])
AC_DEFINE_UNQUOTED(SYSLOG_FACILITY, $SYSLOG_FACILITY, [Syslog facility to use.])
AC_MSG_RESULT($SYSLOG_FACILITY)
dnl Have to check getdtabalesize after adding ossup, as some ossups define it
AC_REPLACE_FUNCS(getdtablesize)
AC_ARG_ENABLE(cmulocal,
[AS_HELP_STRING([--enable-cmulocal], [enable CMU-specific local support])])
AM_CONDITIONAL([CMULOCAL], [test "$enable_cmulocal" = "yes"])
AC_MSG_CHECKING(to use old sieve service name)
AC_ARG_ENABLE(oldsievename,
[AS_HELP_STRING([--enable-oldsievename], [enable the use of 'imap' as the sieve service name])],
if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(OLD_SIEVE_SERVICE_NAME,[],[Use "imap" as sieve service name?])
else
AC_MSG_RESULT(no)
fi,
AC_MSG_RESULT(no))
AC_ARG_ENABLE(netscapehack,
[AS_HELP_STRING([--enable-netscapehack], [enable Netscape hack for the menu option in Communicator to Administrate Mail])],
if test "$enableval" = yes; then
AC_DEFINE(ENABLE_X_NETSCAPE_HACK,[],[Enable Netscape Menu Option Hack?])
fi)
CMU_SASL2_REQUIRE_VER(2,1,7)
CMU_SASL2_CHECKAPOP_REQUIRED
AC_ARG_WITH(perl,
[AS_HELP_STRING([--with-perl=PERL], [use PERL for perl])],
with_perl="$withval", with_perl="perl")
if test "${with_perl}" = yes; then
with_perl="perl"
fi
if test "${with_perl}" != no; then
if test ${using_static_sasl} = "staticonly"; then
AC_MSG_WARN([Cannot compile perl utilities using static libsasl])
with_perl="no"
else
AC_CHECK_PROGS(PERL, ${with_perl} perl, with_perl=notfound)
fi
fi
AM_CONDITIONAL([PERL], [test "$with_perl" != "no" -a "$with_perl" != "notfound"])
srctoolsdir=`cd ${srcdir};pwd`/tools
if test "$with_perl" = "notfound"; then
AC_MSG_WARN(Perl not found: Administrative tools will not be available)
elif test "${with_perl}" != "no"; then
dnl compile perl stuff and perl/cyradm
PERL="${with_perl}"
dnl add perl cccdlflags when building libraries -- this ensures that the
dnl libraries will be compiled as PIC if perl requires PIC objects
dnl -- this is needed on NetBSD and Linux, but seems to cause problems on atleast Solaris --
case "${target_os}" in
linux*|netbsd*|freebsd*|dragonfly*)
AC_MSG_CHECKING(for perl cccdlflags needed on "${target_os}")
eval `${PERL} -V:cccdlflags`
PERL_CCCDLFLAGS="$cccdlflags"
AC_SUBST(PERL_CCCDLFLAGS)
AC_MSG_RESULT($PERL_CCCDLFLAGS)
;;
*)
AC_MSG_WARN(skipping check for perl cccdlflags on "${target_os}")
esac
PERL_PREINSTALL="${PERL} ${srctoolsdir}/fixsearchpath.pl ${cyrus_prefix} ${bindir}"
AC_SUBST(PERL_PREINSTALL)
fi
CMU_LIBWRAP
CMU_UCDSNMP
# Figure out what directories we're linking against.
# Lots of fun for the whole family.
# This probably chokes on anything with spaces in it.
# All we want is the list of -L directories, and -L may or may not be
# followed by a space.
isdir=no
libpath=""
#echo "debug ldflags: << ${ldflags} >>"
#echo "debug default_ldflags: << ${default_ldflags} >>"
for flag in ${ldflags} ${default_ldflags}; do
case $flag in
-L)
# it's a split -L option, we'll mark the next option as a dir.
isdir=yes
;;
-L*)
# attached -L option: split off the directory
larg=`echo $flag | sed -e 's:-L\(..*\):\1:'`
libpath="${libpath} ${larg}"
;;
*)
if test $isdir = yes ; then
libpath="${libpath} ${flag}"
isdir=no
fi
esac
done
AC_SUBST(LIB_SASL)
AC_SUBST(LIB_RT)
AC_SUBST(LIB_UUID)
AC_SUBST(PERL)
dnl
dnl Enable/disable unit tests. These are disabled by default, as
dnl they require an additional library (the CUnit library).
dnl
AC_ARG_ENABLE(unit-tests,
[AS_HELP_STRING([--enable-unit-tests], [enable CUnit-based unit regression tests])])
dnl Unit tests need the CUnit library, so check if we
dnl have both the header and the library.
if test "$enable_unit_tests" = "yes" ; then
AC_CHECK_LIB(cunit,CU_initialize_registry,found_lib=yes,found_lib=no)
AC_CHECK_HEADER([CUnit/CUnit.h],found_hdr=yes,found_hdr=no)
if test "$found_lib$found_hdr" != "yesyes" ; then
AC_MSG_NOTICE([Disabling unit tests because the required CUnit library is not installed])
enable_unit_tests=no
fi
AC_CHECK_HEADER([CUnit/Basic.h],
AC_CHECK_TYPE([CU_SetUpFunc],AC_DEFINE(HAVE_CU_SETUPFUNC,[],[Do we have CU_SetUpFunc?]),,
[#include <CUnit/Basic.h>])
,)
fi
if test "$enable_unit_tests" = "yes" ; then
dnl Valgrind is an amazingly useful tool for running tests. It doesn't
dnl need the program under test to be modified in any way, but it we can
dnl optionally use some magic in it's header file to compensate for some
dnl of the shortcomings of a C development environment by giving error
dnl messages with backtraces. This is so enormously useful for the unit
dnl tests that want to enable it if possible, but we can struggle on
dnl without it. Besides, on many platforms the header file is in a
dnl different package to the main valgrind binary, and so might not be
dnl installed.
AC_CHECK_HEADERS([valgrind/valgrind.h])
USE_MAINTAINER_MODE=yes
fi
AM_CONDITIONAL([CUNIT], [test "$enable_unit_tests" = "yes"])
AH_TOP([
/*
* Copyright (c) 1994-2012 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any legal
* details, please contact
* Carnegie Mellon University
* Center for Technology Transfer and Enterprise Creation
* 4615 Forbes Avenue
* Suite 302
* Pittsburgh, PA 15213
* (412) 268-7393, fax: (412) 268-7395
* innovation@andrew.cmu.edu
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (http://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _CYRUS_IMAPD_CONFIG_H_
#define _CYRUS_IMAPD_CONFIG_H_
])
AH_BOTTOM([
/* time.h */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
/* com_err.h, as needed */
#ifndef IN_COM_ERR
#ifdef HAVE_ET_COM_ERR_H
#include <et/com_err.h>
#else
#include <com_err.h>
#endif /* HAVE_ET_COM_ERR_H */
#endif /* IN_COM_ERR */
/* This allows us to work even when we don't have an fdatasync */
#ifndef HAVE_FDATASYNC
#define fdatasync(fd) fsync(fd)
#endif
/* A similar setup for not having O_DSYNC */
#include <fcntl.h>
#ifndef O_DSYNC
# ifdef O_SYNC
# define O_DSYNC O_SYNC /* POSIX */
# else
# define O_DSYNC O_FSYNC /* BSD */
# endif
#endif
#ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
#endif
#ifndef HAVE_RLIM_T
typedef int rlim_t;
#endif
/* some potentially memory saving tradeoffs,
preconfigured in memory-saving mode */
/* save the cmdlines for the ID command */
#undef ID_SAVE_CMDLINE
/* IPv6 things */
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
#define _SS_MAXSIZE 128 /* Implementation specific max size */
#define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
struct sockaddr_storage {
struct sockaddr ss_sa;
char __ss_pad2[_SS_PADSIZE];
};
# define ss_family ss_sa.sa_family
# define HAVE_SS_FAMILY
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
#ifndef AF_INET6
/* Define it to something that should never appear */
#define AF_INET6 AF_MAX
#endif
#if !defined(HAVE_GETADDRINFO) || !defined(HAVE_GETNAMEINFO)
#include "gai.h"
#endif
/* End IPv6 things */
#ifdef OLD_SIEVE_SERVICE_NAME
#define SIEVE_SERVICE_NAME "imap"
#else
#define SIEVE_SERVICE_NAME "sieve"
#endif
/* filenames */
#define FNAME_DBDIR "/db"
#define FNAME_USERDIR "/user/"
#define FNAME_DOMAINDIR "/domain/"
#define FNAME_LOGDIR "/log/"
#define FNAME_PTSDB "/ptclient/ptscache.db"
#define CONFIG_FILENAME (SYSCONFDIR "/imapd.conf")
#define DEFAULT_MASTER_CONFIG_FILENAME (SYSCONFDIR "/cyrus.conf")
#ifndef HAVE_SHUTDOWN
#define shutdown(fd, mode) 0
#endif
/* *printf() macros */
#if (SIZEOF_SIZE_T == SIZEOF_INT)
#define SIZE_T_FMT "%u"
#elif (SIZEOF_SIZE_T == SIZEOF_LONG)
#define SIZE_T_FMT "%lu"
#elif (SIZEOF_SIZE_T == SIZEOF_LONG_LONG_INT)
#define SIZE_T_FMT "%llu"
#else
#error dont know what to use for SIZE_T_FMT
#endif
#if (SIZEOF_OFF_T == SIZEOF_LONG)
#define OFF_T_FMT "%ld"
#define strtoofft(nptr, endptr, base) strtol(nptr, endptr, base)
#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG_INT)
#define OFF_T_FMT "%lld"
#define strtoofft(nptr, endptr, base) strtoll(nptr, endptr, base)
#else
#error dont know what to use for OFF_T_FMT
#endif
#ifndef HAVE_POSIX_FADVISE
#define POSIX_FADV_WILLNEED 0
extern int posix_fadvise(int fd, off_t offset, off_t len, int advice);
#endif
#ifndef HAVE_STRSEP
extern char *strsep(char **, const char *);
#endif
#ifndef HAVE_MEMMEM
extern void *memmem(const void *, size_t, const void *, size_t);
#endif
/* compile time options; think carefully before modifying */
enum {
/* should we send an UNAVAILABLE message to master when
* a service is exiting (master is already going to be
* informed of the exit by the SIGCHLD signal anyway) ? */
MESSAGE_MASTER_ON_EXIT = 0,
/* should a hierarchical rename stop on error? */
RENAME_STOP_ON_ERROR = 1,
/* should we call fsync() to maybe help with softupdates? (it should) */
APPEND_ULTRA_PARANOID = 1,
/* should we log extra information at the DEBUG level for DB stuff?
* 0 -> nothing; 1 -> some; higher -> even more */
CONFIG_DB_VERBOSE = 1,
/* log timing information to LOG_DEBUG */
CONFIG_TIMING_VERBOSE = 0,
/* should we be pedantic about namespace or sleezy? */
SLEEZY_NAMESPACE = 1,
/* should we do a fast TLS session shutdown? */
TLS_FAST_SHUTDOWN = 1,
/* should we have long LMTP error messages? */
LMTP_LONG_ERROR_MSGS = 1
};
#endif /* _CYRUS_IMAPD_CONFIG_H_ */
])
dnl make sure that Makefile is the last thing output
AC_CONFIG_FILES([
libcyrus_min.pc
libcyrus.pc
libcyrus_sieve.pc
Makefile
])
if test "$with_perl" != "no" -a "$with_perl" != "notfound" ; then
CMU_PERL_MAKEMAKER(perl/annotator)
CMU_PERL_MAKEMAKER(perl/imap)
CMU_PERL_MAKEMAKER(perl/sieve/managesieve)
fi
AC_OUTPUT
echo "
Cyrus Imapd configured components
event notification: $enable_event_notification
gssapi: $gssapi
autocreate: $enable_autocreate
idled: $enable_idled
http: $enable_http
kerberos V4: $krb4
murder: $enable_murder
nntpd: $enable_nntp
replication: $enable_replication
sieve: $enable_sieve
External dependencies:
ldap: $have_ldap
openssl: $with_ssl
pcre: $cyrus_cv_pcre_utf8
Database support:
mysql: $with_mysql
postgresql: $use_pgsql
sqlite: $use_sqlite
"
diff --git a/imap/search_engines.c b/imap/search_engines.c
index 868cf2121..43bfd5931 100644
--- a/imap/search_engines.c
+++ b/imap/search_engines.c
@@ -1,110 +1,116 @@
/* search_engines.c -- Prefiltering routines for SEARCH
*
* Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any legal
* details, please contact
* Carnegie Mellon University
* Center for Technology Transfer and Enterprise Creation
* 4615 Forbes Avenue
* Suite 302
* Pittsburgh, PA 15213
* (412) 268-7393, fax: (412) 268-7395
* innovation@andrew.cmu.edu
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (http://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <config.h>
#include <sys/types.h>
#include <stdlib.h>
#include <syslog.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "index.h"
#include "global.h"
#include "search_engines.h"
#ifdef USE_SQUAT
extern const struct search_engine squat_search_engine;
#endif
+#ifdef USE_SPHINX
+extern const struct search_engine sphinx_search_engine;
+#endif
static int default_search(unsigned* msg_list, struct index_state *state,
const struct searchargs *searchargs
__attribute__((unused)) )
{
unsigned i;
/* Just put in all possible messages. This falls back to Cyrus' default
* search. */
for (i = 0; i < state->exists; i++) {
msg_list[i] = i + 1;
}
return state->exists;
}
static const struct search_engine default_search_engine = {
"default",
0,
default_search
};
static const struct search_engine *search_engines[] = {
+#ifdef USE_SPHINX
+ &sphinx_search_engine,
+#endif
#ifdef USE_SQUAT
&squat_search_engine,
#endif
&default_search_engine,
NULL
};
HIDDEN int search_prefilter_messages(unsigned *msgno_list,
struct index_state *state,
const struct searchargs *searchargs)
{
const struct search_engine **se;
int count;
for (se = search_engines ; *se ; se++) {
count = (*se)->search(msgno_list, state, searchargs);
if (count >= 0) {
syslog(LOG_DEBUG, "%s returned %d messages", (*se)->name, count);
return count;
} else {
/* otherwise, we failed for some reason, so do the default */
syslog(LOG_DEBUG, "%s failed", (*se)->name);
}
}
/* NOTREACHED */
return -1;
}
diff --git a/imap/search_sphinx.c b/imap/search_sphinx.c
new file mode 100644
index 000000000..4a3e13864
--- /dev/null
+++ b/imap/search_sphinx.c
@@ -0,0 +1,212 @@
+/* search_sphinx.c -- glue code for searching with Sphinx
+ *
+ * Copyright (c) 1994-2012 Carnegie Mellon University. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The name "Carnegie Mellon University" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For permission or any legal
+ * details, please contact
+ * Carnegie Mellon University
+ * Center for Technology Transfer and Enterprise Creation
+ * 4615 Forbes Avenue
+ * Suite 302
+ * Pittsburgh, PA 15213
+ * (412) 268-7393, fax: (412) 268-7395
+ * innovation@andrew.cmu.edu
+ *
+ * 4. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by Computing Services
+ * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
+ *
+ * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "index.h"
+#include "imap_err.h"
+#include "global.h"
+#include "xmalloc.h"
+#include "xstrlcpy.h"
+#include "xstrlcat.h"
+#include "bitvector.h"
+#include "search_engines.h"
+
+#include <mysql/mysql.h>
+
+#define SEARCHD_SOCKET_PATH "/var/tmp/cass/casscmd/sphinx/searchd.sock"
+static int connected = 0;
+static MYSQL conn;
+
+static int parse_cyrusid(const char *cyrusid,
+ const char **mboxnamep,
+ unsigned int *uidvalidityp,
+ unsigned int *uidp)
+{
+ // user.cassandane.1320711192.196715
+ static struct buf buf = BUF_INITIALIZER;
+ char *p;
+
+ buf_reset(&buf);
+ buf_appendcstr(&buf, cyrusid);
+
+ p = strrchr(buf_cstring(&buf), '.');
+ if (!p)
+ return 0;
+ *p++ = '\0';
+ *uidp = strtoul(p, NULL, 10);
+
+ p = strrchr(buf.s, '.');
+ if (!p)
+ return 0;
+ *p++ = '\0';
+ *uidvalidityp = strtoul(p, NULL, 10);
+
+ *mboxnamep = buf.s;
+
+ return 1;
+}
+
+static void escape(struct buf *to, const struct buf *from)
+{
+ buf_ensure(to, 2*from->len+1);
+ to->len = mysql_real_escape_string(&conn, to->s, from->s, from->len);
+ to->flags |= BUF_CSTRING;
+}
+
+static void add_match(struct buf *query, int *np,
+ const struct strlist *strs, const char *field)
+{
+ static struct buf f = BUF_INITIALIZER;
+ static struct buf e1 = BUF_INITIALIZER;
+ static struct buf e2 = BUF_INITIALIZER;
+
+ for ( ; strs ; strs = strs->next) {
+ buf_init_ro_cstr(&f, strs->s);
+ escape(&e1, &f);
+ escape(&e2, &e1);
+
+ if (*np)
+ buf_appendcstr(query, " ");
+ buf_printf(query, "@%s: %s", field, e2.s);
+ (*np)++;
+ }
+}
+
+static int search_sphinx(unsigned* msg_list, struct index_state *state,
+ const struct searchargs *args)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ struct buf query = BUF_INITIALIZER;
+ int n = 0;
+ int r = 0;
+
+ if (!connected) {
+ MYSQL *c;
+
+ mysql_init(&conn);
+ c = mysql_real_connect(&conn,
+ /*host*/NULL,
+ /*user*/"", /*password*/"",
+ /*database*/NULL,
+ /*port*/0, SEARCHD_SOCKET_PATH,
+ /*client_flag*/0);
+ if (!c) {
+ syslog(LOG_ERR, "IOERROR: failed to connect to Sphinx on %s: %s",
+ SEARCHD_SOCKET_PATH, mysql_error(&conn));
+ return IMAP_IOERROR;
+ }
+ connected = 1;
+ }
+
+ buf_appendcstr(&query, "SELECT cyrusid FROM rt WHERE MATCH('");
+ add_match(&query, &n, args->to, "header_to");
+ add_match(&query, &n, args->from, "header_from");
+ add_match(&query, &n, args->cc, "header_cc");
+ add_match(&query, &n, args->subject, "header_subject");
+ add_match(&query, &n, args->header_name, "header_to");
+ add_match(&query, &n, args->body, "body");
+ buf_appendcstr(&query, "')");
+ // get sphinx to sort by most recent date first
+ buf_appendcstr(&query, " ORDER BY header_date DESC");
+ // TODO: Sphinx has an implicit default limit of 20 results
+ // we need to defeat that with a LIMIT clause here
+
+ if (!n) {
+ /* None of the fields which are indexed were in the search, so
+ * give up and let the next search engine try. */
+ r = IMAP_NOTFOUND;
+ goto out;
+ }
+
+ r = mysql_real_query(&conn, query.s, query.len);
+ if (r) {
+ syslog(LOG_ERR, "IOERROR: Sphinx query %s failed: %s",
+ query.s, mysql_error(&conn));
+ r = IMAP_IOERROR;
+ goto out;
+ }
+
+ n = 0;
+ res = mysql_use_result(&conn);
+ while ((row = mysql_fetch_row(res))) {
+ const char *mboxname;
+ unsigned int uidvalidity;
+ unsigned int uid;
+ if (!parse_cyrusid(row[0], &mboxname, &uidvalidity, &uid))
+ // TODO: whine
+ continue;
+ if (strcmp(mboxname, state->mailbox->name))
+ continue;
+ if (uidvalidity != state->mailbox->i.uidvalidity)
+ continue;
+ msg_list[n++] = uid;
+ }
+ mysql_free_result(res);
+ r = n;
+
+
+ /* TODO: currently we neither track nor care about unindexed
+ * messages, that should be handled by a layer above here. */
+
+out:
+ buf_free(&query);
+ return r;
+}
+
+const struct search_engine sphinx_search_engine = {
+ "Sphinx",
+ 0,
+ search_sphinx
+};
+
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Apr 24, 10:53 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18895497
Default Alt Text
(110 KB)
Attached To
Mode
R111 cyrus-imapd
Attached
Detach File
Event Timeline