Fixed empty moduledir install problem.
authorStephan Bosch <stephan@rename-it.nl>
Sun Feb 13 21:22:37 2011 +0100 (2011-02-13)
changeset 31fc47fc0b0890
parent 30 942eca9e7497
child 32 738b979fce8e
Fixed empty moduledir install problem.
configure.in
m4/dovecot.m4
     1.1 --- a/configure.in	Sun Sep 05 21:41:30 2010 +0200
     1.2 +++ b/configure.in	Sun Feb 13 21:22:37 2011 +0100
     1.3 @@ -20,6 +20,8 @@
     1.4  AC_PROG_LIBTOOL
     1.5  
     1.6  DC_DOVECOT
     1.7 +DC_DOVECOT_MODULEDIR
     1.8 +
     1.9  LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE $LIBDOVECOT_STORAGE_INCLUDE"
    1.10  CFLAGS="$DOVECOT_CFLAGS"
    1.11  LIBS="$DOVECOT_LIBS"
     2.1 --- a/m4/dovecot.m4	Sun Sep 05 21:41:30 2010 +0200
     2.2 +++ b/m4/dovecot.m4	Sun Feb 13 21:22:37 2011 +0100
     2.3 @@ -6,7 +6,16 @@
     2.4  # unlimited permission to copy and/or distribute it, with or without
     2.5  # modifications, as long as this notice is preserved.
     2.6  
     2.7 -# serial 2
     2.8 +# serial 4
     2.9 +
    2.10 +AC_DEFUN([DC_DOVECOT_MODULEDIR],[
    2.11 +	AC_ARG_WITH(moduledir,
    2.12 +	[  --with-moduledir=DIR    Base directory for dynamically loadable modules],
    2.13 +		moduledir="$withval",
    2.14 +		moduledir=$libdir/dovecot
    2.15 +	)
    2.16 +	AC_SUBST(moduledir)
    2.17 +])
    2.18  
    2.19  AC_DEFUN([DC_PLUGIN_DEPS],[
    2.20  	_plugin_deps=yes
    2.21 @@ -37,6 +46,16 @@
    2.22  			]
    2.23  	)
    2.24  
    2.25 +	AC_ARG_WITH(dovecot-install-dirs,
    2.26 +		[AC_HELP_STRING([--with-dovecot-install-dirs],
    2.27 +	    	[Use install directories configured for Dovecot (default)])],
    2.28 +	    if test x$withval = xno; then
    2.29 +    	    use_install_dirs=no
    2.30 +    	else
    2.31 +        	use_install_dirs=yes
    2.32 +	    fi,
    2.33 +    	use_install_dirs=yes)
    2.34 +
    2.35  	AC_MSG_CHECKING([for dovecot-config in "$dovecotdir"])
    2.36  	if test -f "$dovecotdir/dovecot-config"; then
    2.37  		AC_MSG_RESULT([$dovecotdir/dovecot-config])
    2.38 @@ -47,9 +66,24 @@
    2.39  		AC_MSG_ERROR([dovecot-config not found])
    2.40  	fi
    2.41  
    2.42 +	old=`pwd`
    2.43 +	cd $dovecotdir
    2.44 +	abs_dovecotdir=`pwd`
    2.45 +	cd $old
    2.46 +	DISTCHECK_CONFIGURE_FLAGS="--with-dovecot=$abs_dovecotdir --without-dovecot-install-dirs"
    2.47 +
    2.48  	eval `grep -i '^dovecot_[[a-z]]*=' "$dovecotdir"/dovecot-config`
    2.49  	eval `grep '^LIBDOVECOT[[A-Z_]]*=' "$dovecotdir"/dovecot-config`
    2.50 -	AX_SUBST_L([dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
    2.51 +
    2.52 +	if test "$use_install_dirs" = "no"; then
    2.53 +		dovecot_pkgincludedir='$(pkgincludedir)'
    2.54 +		dovecot_pkglibdir='$(pkglibdir)'
    2.55 +		dovecot_pkglibexecdir='$(libexecdir)/dovecot'
    2.56 +		dovecot_docdir='$(docdir)'
    2.57 +		dovecot_moduledir='$(moduledir)'
    2.58 +	fi
    2.59 +
    2.60 +	AX_SUBST_L([DISTCHECK_CONFIGURE_FLAGS], [dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
    2.61  	AX_SUBST_L([DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS])
    2.62  	AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_LDA], [LIBDOVECOT_STORAGE])
    2.63  	AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_LDA_DEPS], [LIBDOVECOT_STORAGE_DEPS])