Support compiling against installed dovecot-config and headers. This way HEAD
authorTimo Sirainen <tss@iki.fi>
Thu Feb 22 23:52:30 2007 +0200 (2007-02-22)
branchHEAD
changeset 16ea5fc9277fbd
parent 15 4b1a6ae4e7fb
child 17 eb09390f96fa
Support compiling against installed dovecot-config and headers. This way
sievec and sieved aren't compiled though because liblib.a doesn't exist.
configure.in
src/Makefile.am
src/libsieve/Makefile.am
     1.1 --- a/configure.in	Fri Feb 16 17:09:45 2007 +0200
     1.2 +++ b/configure.in	Thu Feb 22 23:52:30 2007 +0200
     1.3 @@ -26,13 +26,27 @@
     1.4  if ! test -f "$dovecotdir/dovecot-config"; then
     1.5    echo
     1.6    echo "dovecot-config not found from $dovecotdir, use --with-dovecot=PATH"
     1.7 -  echo "to give path to compiled Dovecot sources."
     1.8 +  echo "to give path to compiled Dovecot sources or to a directory with the"
     1.9 +  echo "installed dovecot-config file."
    1.10    AC_MSG_ERROR([dovecot-config not found])
    1.11  fi
    1.12  
    1.13 +if test -d "$dovecotdir/src"; then
    1.14 +  # compiling against sources
    1.15 +  have_dovecot_libs=yes
    1.16 +else
    1.17 +  # compiling against installed headers
    1.18 +  have_dovecot_libs=no
    1.19 +fi
    1.20 +AM_CONDITIONAL(HAVE_DOVECOT_LIBS, test "$have_dovecot_libs" = "yes")
    1.21 +
    1.22  dnl replace relative ../ paths in the file with full paths
    1.23  eval `cat $dovecotdir/dovecot-config|sed 's,\$(top_builddir)/,$dovecotdir/,g'`
    1.24  
    1.25 +if test $have_dovecot_libs = yes; then
    1.26 +  dovecot_incdir="$dovecotdir"
    1.27 +fi
    1.28 +
    1.29  dnl * Regexp library check, from Cyrus IMAP
    1.30  AC_SEARCH_LIBS(regcomp, rx regex, [
    1.31    CFLAGS="$CFLAGS -DENABLE_REGEX"
    1.32 @@ -42,7 +56,7 @@
    1.33  AC_SUBST(LIBICONV)
    1.34  AC_SUBST(RAND_LIBS)
    1.35  AC_SUBST(MODULE_LIBS)
    1.36 -AC_SUBST(dovecotdir)
    1.37 +AC_SUBST(dovecot_incdir)
    1.38  AC_SUBST(moduledir)
    1.39  
    1.40  AC_CONFIG_FILES([
     2.1 --- a/src/Makefile.am	Fri Feb 16 17:09:45 2007 +0200
     2.2 +++ b/src/Makefile.am	Thu Feb 22 23:52:30 2007 +0200
     2.3 @@ -1,12 +1,12 @@
     2.4  SUBDIRS = libsieve
     2.5  
     2.6  AM_CPPFLAGS = \
     2.7 -	-I$(dovecotdir) \
     2.8 -	-I$(dovecotdir)/src/lib \
     2.9 -	-I$(dovecotdir)/src/lib-dict \
    2.10 -	-I$(dovecotdir)/src/lib-mail \
    2.11 -	-I$(dovecotdir)/src/lib-storage \
    2.12 -	-I$(dovecotdir)/src/deliver
    2.13 +	-I$(dovecot_incdir) \
    2.14 +	-I$(dovecot_incdir)/src/lib \
    2.15 +	-I$(dovecot_incdir)/src/lib-dict \
    2.16 +	-I$(dovecot_incdir)/src/lib-mail \
    2.17 +	-I$(dovecot_incdir)/src/lib-storage \
    2.18 +	-I$(dovecot_incdir)/src/deliver
    2.19  
    2.20  lda_moduledir = $(moduledir)/lda
    2.21  
     3.1 --- a/src/libsieve/Makefile.am	Fri Feb 16 17:09:45 2007 +0200
     3.2 +++ b/src/libsieve/Makefile.am	Thu Feb 22 23:52:30 2007 +0200
     3.3 @@ -1,14 +1,12 @@
     3.4  pkglibexecdir = $(libexecdir)/dovecot
     3.5  
     3.6 -pkglibexec_PROGRAMS = sievec sieved
     3.7 -
     3.8  noinst_LTLIBRARIES = libsieve.la
     3.9  
    3.10  AM_YFLAGS = -d -p $*
    3.11  
    3.12  AM_CPPFLAGS = \
    3.13 -	-I$(dovecotdir) \
    3.14 -	-I$(dovecotdir)/src/lib \
    3.15 +	-I$(dovecot_incdir) \
    3.16 +	-I$(dovecot_incdir)/src/lib \
    3.17  	-I$(top_srcdir)/src
    3.18  
    3.19  addr-lex.c: addr-lex.l
    3.20 @@ -17,23 +15,6 @@
    3.21  sieve-lex.c: sieve-lex.l
    3.22  	$(LEX) -t sieve-lex.l > sieve-lex.c
    3.23  
    3.24 -sievec_SOURCES = \
    3.25 -	sievec.c \
    3.26 -	../map.c \
    3.27 -	../imparse.c
    3.28 -
    3.29 -sieved_SOURCES = \
    3.30 -	sieved.c \
    3.31 -	../map.c
    3.32 -
    3.33 -sievec_LDADD = \
    3.34 -	libsieve.la \
    3.35 -	$(dovecotdir)/src/lib/liblib.a
    3.36 -
    3.37 -sieved_LDADD = \
    3.38 -	libsieve.la \
    3.39 -	$(dovecotdir)/src/lib/liblib.a
    3.40 -
    3.41  libsieve_la_SOURCES = \
    3.42  	addr.y \
    3.43  	sieve.y \
    3.44 @@ -64,10 +45,36 @@
    3.45  	sieve_interface.h \
    3.46  	tree.h
    3.47  
    3.48 +if HAVE_DOVECOT_LIBS
    3.49 +pkglibexec_PROGRAMS = sievec sieved
    3.50 +
    3.51 +sievec_SOURCES = \
    3.52 +	sievec.c \
    3.53 +	../map.c \
    3.54 +	../imparse.c
    3.55 +
    3.56 +sieved_SOURCES = \
    3.57 +	sieved.c \
    3.58 +	../map.c
    3.59 +
    3.60 +sievec_LDADD = \
    3.61 +	libsieve.la \
    3.62 +	$(dovecotdir)/src/lib/liblib.a
    3.63 +
    3.64 +sieved_LDADD = \
    3.65 +	libsieve.la \
    3.66 +	$(dovecotdir)/src/lib/liblib.a
    3.67 +
    3.68 +notbuilt_sources =
    3.69 +else
    3.70 +notbuilt_sources = sievec.c sieved.c
    3.71 +endif
    3.72 +
    3.73  EXTRA_DIST = \
    3.74  	addr-lex.l \
    3.75  	sieve-lex.l \
    3.76  	AUTHORS \
    3.77  	COPYING \
    3.78  	NEWS \
    3.79 -	README
    3.80 +	README \
    3.81 +	$(notbuilt_sources)