]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dovecot.m4: Preserve original CFLAGS/LDFLAGS
authorAki Tuomi <aki.tuomi@dovecot.fi>
Sat, 24 Nov 2018 18:35:53 +0000 (20:35 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 6 Feb 2019 08:09:09 +0000 (10:09 +0200)
Correct flags are detected during configure, so avoid
overwriting them here by accident.

m4/dovecot.m4

index a70d6532bc17774c876a2fc080e8fbb452e747ce..aa43e2ccd25e7ef20106ed745c35e9eb57825959 100644 (file)
@@ -356,9 +356,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"], [