diff --git a/configure.in b/configure.in index 81eeb53071a9c4d80b07a5088f6b1658f6ff4958..04f99c3e90b7b94388cca882aff41eb9fabc97e1 100644 --- a/configure.in +++ b/configure.in @@ -26,6 +26,7 @@ AC_PROG_LIBTOOL # DC_DOVECOT +DC_DOVECOT_MODULEDIR LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE $LIBDOVECOT_STORAGE_INCLUDE" CFLAGS="$DOVECOT_CFLAGS" LIBS="$DOVECOT_LIBS" diff --git a/m4/dovecot.m4 b/m4/dovecot.m4 index 147859b3e3e24851097b4f637dd96af170fec9e8..02e6e015352b661232fa8fd366491b046aacc90d 100644 --- a/m4/dovecot.m4 +++ b/m4/dovecot.m4 @@ -6,7 +6,16 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 2 +# serial 4 + +AC_DEFUN([DC_DOVECOT_MODULEDIR],[ + AC_ARG_WITH(moduledir, + [ --with-moduledir=DIR Base directory for dynamically loadable modules], + moduledir="$withval", + moduledir=$libdir/dovecot + ) + AC_SUBST(moduledir) +]) AC_DEFUN([DC_PLUGIN_DEPS],[ _plugin_deps=yes @@ -37,6 +46,16 @@ AC_DEFUN([DC_DOVECOT],[ ] ) + AC_ARG_WITH(dovecot-install-dirs, + [AC_HELP_STRING([--with-dovecot-install-dirs], + [Use install directories configured for Dovecot (default)])], + if test x$withval = xno; then + use_install_dirs=no + else + use_install_dirs=yes + fi, + use_install_dirs=yes) + AC_MSG_CHECKING([for dovecot-config in "$dovecotdir"]) if test -f "$dovecotdir/dovecot-config"; then AC_MSG_RESULT([$dovecotdir/dovecot-config]) @@ -47,9 +66,24 @@ AC_DEFUN([DC_DOVECOT],[ AC_MSG_ERROR([dovecot-config not found]) fi + old=`pwd` + cd $dovecotdir + abs_dovecotdir=`pwd` + cd $old + DISTCHECK_CONFIGURE_FLAGS="--with-dovecot=$abs_dovecotdir --without-dovecot-install-dirs" + eval `grep -i '^dovecot_[[a-z]]*=' "$dovecotdir"/dovecot-config` eval `grep '^LIBDOVECOT[[A-Z_]]*=' "$dovecotdir"/dovecot-config` - AX_SUBST_L([dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir]) + + if test "$use_install_dirs" = "no"; then + dovecot_pkgincludedir='$(pkgincludedir)' + dovecot_pkglibdir='$(pkglibdir)' + dovecot_pkglibexecdir='$(libexecdir)/dovecot' + dovecot_docdir='$(docdir)' + dovecot_moduledir='$(moduledir)' + fi + + AX_SUBST_L([DISTCHECK_CONFIGURE_FLAGS], [dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir]) AX_SUBST_L([DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS]) AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_LDA], [LIBDOVECOT_STORAGE]) AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_LDA_DEPS], [LIBDOVECOT_STORAGE_DEPS])