diff --git a/m4/dovecot.m4 b/m4/dovecot.m4 index a115bed0d9..9b03ecda16 100644 --- a/m4/dovecot.m4 +++ b/m4/dovecot.m4 @@ -368,9 +368,20 @@ AC_DEFUN([DC_DOVECOT],[ cd $old DISTCHECK_CONFIGURE_FLAGS="--with-dovecot=$abs_dovecotdir --without-dovecot-install-dirs" + dnl Make sure dovecot-config doesn't accidentically override flags + ORIG_CFLAGS="$CFLAGS" + ORIG_LDFLAGS="$LDFLAGS" + ORIG_BINARY_CFLAGS="$BINARY_CFLAGS" + ORIG_BINARY_LDFLAGS="$BINARY_LDFLAGS" + eval `grep -i '^dovecot_[[a-z_]]*=' "$dovecotdir"/dovecot-config` eval `grep '^LIBDOVECOT[[A-Z0-9_]]*=' "$dovecotdir"/dovecot-config` + CFLAGS="$ORIG_CFLAGS" + LDFLAGS="$ORIG_LDFLAGS" + BINARY_CFLAGS="$ORIG_BINARY_CFLAGS" + BINARY_LDFLAGS="$ORIG_BINARY_LDFLAGS" + dovecot_installed_moduledir="$dovecot_moduledir" AS_IF([test "$use_install_dirs" = "no"], [