From 3c071a4b6f16740ba59e24798416764f51056369 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 11 Jan 2017 21:32:55 +0100 Subject: [PATCH] Updated dovecot.m4. --- m4/dovecot.m4 | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/m4/dovecot.m4 b/m4/dovecot.m4 index efecf1c3b..471fb27d9 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 22 +# 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,16 +128,44 @@ 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([DOVECOT_INSTALLED], [DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS], [DOVECOT_SQL_LIBS], [DOVECOT_COMPRESS_LIBS]) + 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]) - AX_SUBST_L([LIBDOVECOT_INCLUDE], [LIBDOVECOT_LDA_INCLUDE], [LIBDOVECOT_AUTH_INCLUDE], [LIBDOVECOT_DOVEADM_INCLUDE], [LIBDOVECOT_SERVICE_INCLUDE], [LIBDOVECOT_STORAGE_INCLUDE], [LIBDOVECOT_LOGIN_INCLUDE], [LIBDOVECOT_SQL_INCLUDE], [LIBDOVECOT_IMAP_LOGIN_INCLUDE], [LIBDOVECOT_CONFIG_INCLUDE], [LIBDOVECOT_IMAP_INCLUDE], [LIBDOVECOT_POP3_INCLUDE], [LIBDOVECOT_DSYNC_INCLUDE], [LIBDOVECOT_IMAPC_INCLUDE], [LIBDOVECOT_FTS_INCLUDE], [LIBDOVECOT_NOTIFY_INCLUDE], [LIBDOVECOT_ACL_INCLUDE], [LIBDOVECOT_LIBFTS_INCLUDE]) + AX_SUBST_L([LIBDOVECOT_INCLUDE], [LIBDOVECOT_LDA_INCLUDE], [LIBDOVECOT_AUTH_INCLUDE], [LIBDOVECOT_DOVEADM_INCLUDE], [LIBDOVECOT_SERVICE_INCLUDE], [LIBDOVECOT_STORAGE_INCLUDE], [LIBDOVECOT_LOGIN_INCLUDE], [LIBDOVECOT_SQL_INCLUDE]) + AX_SUBST_L([LIBDOVECOT_IMAP_LOGIN_INCLUDE], [LIBDOVECOT_CONFIG_INCLUDE], [LIBDOVECOT_IMAP_INCLUDE], [LIBDOVECOT_POP3_INCLUDE], [LIBDOVECOT_DSYNC_INCLUDE], [LIBDOVECOT_IMAPC_INCLUDE], [LIBDOVECOT_FTS_INCLUDE]) + AX_SUBST_L([LIBDOVECOT_NOTIFY_INCLUDE], [LIBDOVECOT_PUSH_NOTIFICATION_INCLUDE], [LIBDOVECOT_ACL_INCLUDE], [LIBDOVECOT_LIBFTS_INCLUDE]) AM_CONDITIONAL(DOVECOT_INSTALLED, test "$DOVECOT_INSTALLED" = "yes") DC_PLUGIN_DEPS DC_DOVECOT_TEST_WRAPPER ]) + +AC_DEFUN([DC_CC_WRAPPER],[ + if test "$want_shared_libs" != "yes"; then + # want_shared_libs=no is for internal use. the liblib.la check is for plugins + if test "$want_shared_libs" = "no" || echo "$LIBDOVECOT" | grep "/liblib.la" > /dev/null; then + if test "$with_gnu_ld" = yes; then + # libtool can't handle using whole-archive flags, so we need to do this + # with a CC wrapper.. shouldn't be much of a problem, since most people + # are building with shared libs. + cat > cc-wrapper.sh < /dev/null; then + # the binary uses plugins. make sure we include everything from .a libs + exec $CC -Wl,--whole-archive \$[*] -Wl,--no-whole-archive +else + exec $CC \$[*] +fi +EOF + chmod +x cc-wrapper.sh + CC=`pwd`/cc-wrapper.sh + fi + fi + fi +])