Skip to content

Commit

Permalink
Updated dovecot.m4.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch committed Jan 11, 2017
1 parent d796ac2 commit 3c071a4
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions m4/dovecot.m4
Expand Up @@ -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,
Expand Down Expand Up @@ -39,16 +39,22 @@ 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=\$?
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
Expand Down Expand Up @@ -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 <<EOF
#!/bin/sh
if echo "\$[*]" | grep -- -ldl > /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
])

0 comments on commit 3c071a4

Please sign in to comment.