annotate dovecot.m4 @ 10755:912c132337ed HEAD

dovecot.m4: Default dovecotdir to $prefix/lib/dovecot/
author Timo Sirainen <tss@iki.fi>
date Thu, 18 Feb 2010 09:48:56 +0200
parents 80a11f8650a4
children ae23a1a94376
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10753
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 # dovecot.m4 - Check presence of dovecot -*-Autoconf-*-
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3 # Copyright (C) 2010 Dennis Schridde
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 # This file is free software; the authors give
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 # unlimited permission to copy and/or distribute it, with or without
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 # modifications, as long as this notice is preserved.
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 AC_DEFUN([DC_PLUGIN_DEPS],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 _plugin_deps=yes
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 AC_MSG_CHECKING([whether OS supports plugin dependencies])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 AS_CASE([$host_os],
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 [darwin*],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14 # OSX loads the plugins twice, which breaks stuff
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 _plugin_deps=no
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 ]
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 )
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 AC_MSG_RESULT([$_plugin_deps])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 AM_CONDITIONAL([DOVECOT_PLUGIN_DEPS], [test "x$_plugin_deps" = "xyes"])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 AS_UNSET([_plugin_deps])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 # Substitute every var in the given comma seperated list
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24 AC_DEFUN([AX_SUBST_L],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 m4_foreach([__var__], [$@], [AC_SUBST(__var__)])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
27
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28 AC_DEFUN([DC_DOVECOT],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29 AC_ARG_WITH(dovecot,
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30 AS_HELP_STRING([--with-dovecot=DIR],[Dovecot base directory [LIBDIR/dovecot]]),
10755
912c132337ed dovecot.m4: Default dovecotdir to $prefix/lib/dovecot/
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
31 [ dovecotdir="$withval" ], [
912c132337ed dovecot.m4: Default dovecotdir to $prefix/lib/dovecot/
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
32 dc_prefix=$prefix
912c132337ed dovecot.m4: Default dovecotdir to $prefix/lib/dovecot/
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
33 test "x$dc_prefix" = xNONE && dc_prefix=$ac_default_prefix
912c132337ed dovecot.m4: Default dovecotdir to $prefix/lib/dovecot/
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
34 dovecotdir="$dc_prefix/lib/dovecot"
912c132337ed dovecot.m4: Default dovecotdir to $prefix/lib/dovecot/
Timo Sirainen <tss@iki.fi>
parents: 10753
diff changeset
35 ]
10753
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
36 )
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38 AC_MSG_CHECKING([for dovecot-config in "$dovecotdir"])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
39 AS_IF([test -f "$dovecotdir/dovecot-config"],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
40 AC_MSG_RESULT([$dovecotdir/dovecot-config])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
41 ],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
42 AC_MSG_RESULT([not found])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
43 AC_MSG_NOTICE([])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
44 AC_MSG_NOTICE([Use --with-dovecot=DIR to provide the path to the dovecot-config file.])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
45 AC_MSG_ERROR([dovecot-config not found])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
46 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
47
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
48 eval `grep \
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
49 -e ^dovecot_[[a-z]]*= \
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
50 -e ^LIBDOVECOT[[A-Z_]]*= \
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
51 "$dovecotdir"/dovecot-config`
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
52 AX_SUBST_L([dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
53 AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_STORAGE])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
54 AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_STORAGE_DEPS])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
55 AX_SUBST_L([LIBDOVECOT_INCLUDE], [LIBDOVECOT_LDA_INCLUDE], [LIBDOVECOT_SERVICE_INCLUDE], [LIBDOVECOT_STORAGE_INCLUDE], [LIBDOVECOT_LOGIN_INCLUDE])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
56
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
57 _cppflags=$CPPFLAGS
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
58 CPPFLAGS=$LIBDOVECOT_INCLUDE
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
59 AC_MSG_CHECKING([dovecot version])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
60 AC_RUN_IFELSE([
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
61 AC_LANG_PROGRAM([[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
62 /* needed for dovecot to include its own config.h ... */
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
63 #define HAVE_CONFIG_H
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
64 #include "lib.h"
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
65 #include <stdlib.h>
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
66 #include <stdio.h>
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
67 ]],[[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
68 printf("%s\n", DOVECOT_VERSION);
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
69 ]])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
70 ],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
71 DOVECOT_VERSION=`./conftest$EXEEXT`
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
72 ],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
73 AC_MSG_FAILURE([unable to determine dovecot version])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
74 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
75 AC_SUBST([DOVECOT_VERSION])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
76 CPPFLAGS=$_cppflags
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
77 AS_UNSET([_cppflags])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
78
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
79 m4_foreach_w([__flag__],[$1],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80 # Inside m4_foreach __flag__ is a variable!
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
81 # This expands *entirely* for every flag in the argument list!
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
82 AS_CASE([__flag__],
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
83 [
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
84 # assume an unknown flag is a version number
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
85 AC_MSG_CHECKING([whether dovecot is newer than __flag__])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
86 AS_VERSION_COMPARE([$DOVECOT_VERSION],[__flag__],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
87 AC_MSG_RESULT([no])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
88 AC_MSG_ERROR([at least dovecot-flag is required, your version seems older])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
89 ],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
90 AC_MSG_RESULT([yes])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
91 ],[
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
92 AC_MSG_RESULT([yes])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
93 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
94 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
95 ])
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
96
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
97 DC_PLUGIN_DEPS
80a11f8650a4 Added dovecot.m4 file that external plugins can use.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
98 ])