Skip to content
Snippets Groups Projects
Commit 35729065 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Started using dovecot.m4 for linking against Dovecot (patch by Timo Sirainen).

parent 2559a3c0
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,11 @@ dovecot-config.in ...@@ -33,6 +33,11 @@ dovecot-config.in
ChangeLog ChangeLog
Makefile Makefile
Makefile.in Makefile.in
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
*~ *~
*.o *.o
......
SUBDIRS = src doc SUBDIRS = src doc
ACLOCAL_AMFLAGS = -I m4 --install
EXTRA_DIST = \ EXTRA_DIST = \
tests \ tests \
examples \ examples \
......
AC_INIT([Pigeonhole], [0.2.UNSTABLE], [dovecot@dovecot.org], [dovecot-2.0-pigeonhole]) AC_INIT([Pigeonhole], [0.2.UNSTABLE], [dovecot@dovecot.org], [dovecot-2.0-pigeonhole])
AC_CONFIG_SRCDIR([src]) AC_CONFIG_SRCDIR([src])
AC_CONFIG_MACRO_DIR([m4])
# Autoheader is not needed and does more harm than good for this package. However, it is # Autoheader is not needed and does more harm than good for this package. However, it is
# tightly integrated in autoconf/automake and therefore it is difficult not to use it. As # tightly integrated in autoconf/automake and therefore it is difficult not to use it. As
...@@ -20,10 +21,9 @@ AC_PROG_CC ...@@ -20,10 +21,9 @@ AC_PROG_CC
AC_PROG_CPP AC_PROG_CPP
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_ARG_WITH(dovecot, DC_DOVECOT
[AC_HELP_STRING([--with-dovecot=DIR], [Dovecot base directory [../dovecot]])], LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE $LIBDOVECOT_STORAGE_INCLUDE"
dovecotdir="$withval" AC_SUBST(LIBDOVECOT_INCLUDE)
)
# Extensions under development # Extensions under development
# #
...@@ -78,39 +78,6 @@ AC_ARG_WITH(managesieve, ...@@ -78,39 +78,6 @@ AC_ARG_WITH(managesieve,
want_managesieve=yes) want_managesieve=yes)
AM_CONDITIONAL(BUILD_MANAGESIEVE, test "$want_managesieve" = "yes") AM_CONDITIONAL(BUILD_MANAGESIEVE, test "$want_managesieve" = "yes")
if test "$dovecotdir" = ""; then
test "x$prefix" = xNONE && prefix=$ac_default_prefix
dovecotdir=$prefix/lib/dovecot
fi
if ! test -f "$dovecotdir/dovecot-config"; then
echo
echo "dovecot-config not found from $dovecotdir, use --with-dovecot=PATH"
echo "to give path to compiled Dovecot sources or to a directory with the"
echo "installed dovecot-config file."
AC_MSG_ERROR([dovecot-config not found])
fi
eval `cat $dovecotdir/dovecot-config`
AC_SUBST(dovecot_moduledir)
AC_SUBST(dovecot_pkgincludedir)
AC_SUBST(dovecot_pkglibexecdir)
AC_SUBST(dovecot_pkglibdir)
AC_SUBST(dovecot_docdir)
AC_SUBST(LIBDOVECOT)
AC_SUBST(LIBDOVECOT_STORAGE)
AC_SUBST(LIBDOVECOT_LOGIN)
AC_SUBST(LIBDOVECOT_DEPS)
AC_SUBST(LIBDOVECOT_STORAGE_DEPS)
AC_SUBST(LIBDOVECOT_LOGIN_DEPS)
LIBDOVECOT_INCLUDE="$LIBDOVECOT_INCLUDE $LIBDOVECOT_STORAGE_INCLUDE"
AC_SUBST(LIBDOVECOT_INCLUDE)
AC_SUBST(LIBDOVECOT_LDA_INCLUDE)
AC_SUBST(LIBDOVECOT_SERVICE_INCLUDE)
AC_SUBST(LIBDOVECOT_LOGIN_INCLUDE)
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
doc/Makefile doc/Makefile
......
# 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 1
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_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
eval `grep \
-e ^dovecot_[[a-z]]*= \
-e ^DOVECOT_[[A-Z_]]*= \
-e ^LIBDOVECOT[[A-Z_]]*= \
"$dovecotdir"/dovecot-config`
AX_SUBST_L([dovecot_moduledir], [dovecot_pkgincludedir], [dovecot_pkglibexecdir], [dovecot_pkglibdir], [dovecot_docdir])
AX_SUBST_L([DOVECOT_CFLAGS], [DOVECOT_LIBS], [DOVECOT_SSL_LIBS])
AX_SUBST_L([LIBDOVECOT], [LIBDOVECOT_LOGIN], [LIBDOVECOT_SQL], [LIBDOVECOT_STORAGE])
AX_SUBST_L([LIBDOVECOT_DEPS], [LIBDOVECOT_LOGIN_DEPS], [LIBDOVECOT_SQL_DEPS], [LIBDOVECOT_STORAGE_DEPS])
AX_SUBST_L([LIBDOVECOT_INCLUDE], [LIBDOVECOT_LDA_INCLUDE], [LIBDOVECOT_SERVICE_INCLUDE], [LIBDOVECOT_STORAGE_INCLUDE], [LIBDOVECOT_LOGIN_INCLUDE])
DC_PLUGIN_DEPS
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.