From 2583936fb703f9d62bfbf073bed7a03fda73283b Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@dovecot.fi>
Date: Wed, 11 Jan 2017 21:01:45 +0100
Subject: [PATCH] Updated dovecot.m4.

---
 m4/dovecot.m4 | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/m4/dovecot.m4 b/m4/dovecot.m4
index 22dea22ec..5fce9c3bb 100644
--- a/m4/dovecot.m4
+++ b/m4/dovecot.m4
@@ -6,7 +6,7 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 24
+# serial 25
 
 AC_DEFUN([DC_DOVECOT_MODULEDIR],[
 	AC_ARG_WITH(moduledir,
@@ -39,6 +39,12 @@ AC_DEFUN([DC_DOVECOT_TEST_WRAPPER],[
 top_srcdir=\$[1]
 shift
 
+if test "\$NOUNDEF" != ""; then
+  noundef="--undef-value-errors=no"
+else
+  noundef=""
+fi
+
 if test "\$NOVALGRIND" != ""; then
   \$[*]
   ret=\$?
@@ -46,9 +52,9 @@ else
   trap "rm -f test.out.\$\$" 0 1 2 3 15
   supp_path="\$top_srcdir/run-test-valgrind.supp"
   if test -r "\$supp_path"; then
-    valgrind -q --trace-children=yes --leak-check=full --suppressions="\$supp_path" --log-file=test.out.\$\$ \$[*]
+    valgrind -q --trace-children=yes --leak-check=full --suppressions="\$supp_path" --log-file=test.out.\$\$ \$noundef \$[*]
   else
-    valgrind -q --trace-children=yes --leak-check=full --log-file=test.out.\$\$ \$[*]
+    valgrind -q --trace-children=yes --leak-check=full --log-file=test.out.\$\$ \$noundef \$[*]
   fi
   ret=\$?
   if test -s test.out.\$\$; then
@@ -122,9 +128,10 @@ AC_DEFUN([DC_DOVECOT],[
 		dovecot_pkglibexecdir='$(libexecdir)/dovecot'
 		dovecot_docdir='$(docdir)'
 		dovecot_moduledir='$(moduledir)'
+		dovecot_statedir='$(statedir)'
 	fi
 
-	AX_SUBST_L([DISTCHECK_CONFIGURE_FLAGS], [dovecotdir], [dovecot_moduledir], [dovecot_installed_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
+	AX_SUBST_L([DISTCHECK_CONFIGURE_FLAGS], [dovecotdir], [dovecot_moduledir], [dovecot_installed_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir], [dovecot_statedir])
 	AX_SUBST_L([DOVECOT_INSTALLED], [DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS], [DOVECOT_SQL_LIBS], [DOVECOT_COMPRESS_LIBS], [DOVECOT_BINARY_CFLAGS], [DOVECOT_BINARY_LDFLAGS])
 	AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_SSL], [LIBDOVECOT_COMPRESS], [LIBDOVECOT_LDA], [LIBDOVECOT_STORAGE], [LIBDOVECOT_DSYNC], [LIBDOVECOT_LIBFTS])
 	AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_SSL_DEPS], [LIBDOVECOT_COMPRESS_DEPS], [LIBDOVECOT_LDA_DEPS], [LIBDOVECOT_STORAGE_DEPS], [LIBDOVECOT_DSYNC_DEPS], [LIBDOVECOT_LIBFTS_DEPS])
@@ -162,3 +169,16 @@ EOF
     fi
   fi
 ])
+
+AC_DEFUN([DC_PANDOC], [
+  AC_ARG_VAR(PANDOC, [Path to pandoc program])
+
+  # Optional tool for making documentation
+  AC_CHECK_PROGS(PANDOC, [pandoc], [true])
+
+  if test "$PANDOC" = "true"; then
+   if test ! -e README; then
+     AC_MSG_ERROR([Cannot produce documentation without pandoc - disable with PANDOC=false ./configure])
+   fi
+  fi
+])
-- 
GitLab