forked from oposs/dovecot-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dovecot.m4
95 lines (83 loc) · 3.28 KB
/
dovecot.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# dovecot.m4 - Check presence of dovecot -*-Autoconf-*-
#
# Copyright (C) 2010 Dennis Schridde
#
# This file is free software; the authors give
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 11
AC_DEFUN([DC_DOVECOT_MODULEDIR],[
AC_ARG_WITH(moduledir,
[ --with-moduledir=DIR Base directory for dynamically loadable modules],
moduledir="$withval",
moduledir=$libdir/dovecot
)
AC_SUBST(moduledir)
])
AC_DEFUN([DC_PLUGIN_DEPS],[
_plugin_deps=yes
AC_MSG_CHECKING([whether OS supports plugin dependencies])
case "$host_os" in
darwin*)
# OSX loads the plugins twice, which breaks stuff
_plugin_deps=no
;;
esac
AC_MSG_RESULT([$_plugin_deps])
AM_CONDITIONAL([DOVECOT_PLUGIN_DEPS], [test "x$_plugin_deps" = "xyes"])
unset _plugin_deps
])
# Substitute every var in the given comma seperated list
AC_DEFUN([AX_SUBST_L],[
m4_foreach([__var__], [$@], [AC_SUBST(__var__)])
])
AC_DEFUN([DC_DOVECOT],[
AC_ARG_WITH(dovecot,
[ --with-dovecot=DIR Dovecot base directory],
[ dovecotdir="$withval" ], [
dc_prefix=$prefix
test "x$dc_prefix" = xNONE && dc_prefix=$ac_default_prefix
dovecotdir="$dc_prefix/lib/dovecot"
]
)
AC_ARG_WITH(dovecot-install-dirs,
[AC_HELP_STRING([--with-dovecot-install-dirs],
[Use install directories configured for Dovecot (default)])],
if test x$withval = xno; then
use_install_dirs=no
else
use_install_dirs=yes
fi,
use_install_dirs=yes)
AC_MSG_CHECKING([for dovecot-config in "$dovecotdir"])
if test -f "$dovecotdir/dovecot-config"; then
AC_MSG_RESULT([$dovecotdir/dovecot-config])
else
AC_MSG_RESULT([not found])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Use --with-dovecot=DIR to provide the path to the dovecot-config file.])
AC_MSG_ERROR([dovecot-config not found])
fi
old=`pwd`
cd $dovecotdir
abs_dovecotdir=`pwd`
cd $old
DISTCHECK_CONFIGURE_FLAGS="--with-dovecot=$abs_dovecotdir --without-dovecot-install-dirs"
eval `grep -i '^dovecot_[[a-z_]]*=' "$dovecotdir"/dovecot-config`
eval `grep '^LIBDOVECOT[[A-Z_]]*=' "$dovecotdir"/dovecot-config`
if test "$use_install_dirs" = "no"; then
# the main purpose of these is to fix make distcheck for plugins
# other than that, they don't really make much sense
dovecot_pkgincludedir='$(pkgincludedir)'
dovecot_pkglibdir='$(pkglibdir)'
dovecot_pkglibexecdir='$(libexecdir)/dovecot'
dovecot_docdir='$(docdir)'
dovecot_moduledir='$(moduledir)'
fi
AX_SUBST_L([DISTCHECK_CONFIGURE_FLAGS], [dovecotdir], [dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
AX_SUBST_L([DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS], [DOVECOT_SQL_LIBS], [DOVECOT_COMPRESS_LIBS])
AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_SSL], [LIBDOVECOT_COMPRESS], [LIBDOVECOT_LDA], [LIBDOVECOT_STORAGE])
AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_SSL_DEPS], [LIBDOVECOT_COMPRESS_DEPS], [LIBDOVECOT_LDA_DEPS], [LIBDOVECOT_STORAGE_DEPS])
AX_SUBST_L([LIBDOVECOT_INCLUDE], [LIBDOVECOT_LDA_INCLUDE], [LIBDOVECOT_DOVEADM_INCLUDE], [LIBDOVECOT_SERVICE_INCLUDE], [LIBDOVECOT_STORAGE_INCLUDE], [LIBDOVECOT_LOGIN_INCLUDE], [LIBDOVECOT_CONFIG_INCLUDE], [LIBDOVECOT_IMAP_INCLUDE])
DC_PLUGIN_DEPS
])