1 dnl -*- mode: Autoconf; -*-
2 dnl Invoke autogen.sh to produce a configure script.
4 AC_CHECK_PROGS([QMAKE], [qmake qmake-qt4])
6 # Check for Akonadi. There is no .pc file for it,
7 # so fall back to normal header file and library checking.
8 # kdepimlibs5-dev >= 4.3 provides the necessary files.
10 if ! test "$KDEPIM_CFLAGS"; then
11 KDEPIM_CFLAGS="-I`kde4-config --path include` -I`kde4-config --path include`/KDE"
12 if test "$QMAKE"; then
13 KDEPIM_CFLAGS="$KDEPIM_CFLAGS -I`$QMAKE -query QT_INSTALL_HEADERS`"
16 if ! test "$KDEPIM_LIBS"; then
17 KDEPIM_LIBS="-L`kde4-config --install lib` -lakonadi-kde `pkg-config --libs QtDBus` -lQtCore -lkdeui -lkdecore"
20 old_CPPFLAGS="$CPPFLAGS"
21 CPPFLAGS="$CPPFLAGS $KDEPIM_CFLAGS"
22 AC_CHECK_HEADERS(Akonadi/Collection, [], [AKONADIFOUND=no])
23 CPPFLAGS="$old_CPPFLAGS"
26 # In contrast to the Evolution backend, the Akonadi backend is
27 # currently considered optional. "configure" will enable it only
28 # if explicitly enabled (was turned on automatically previously,
29 # for example on Ubuntu Hardy, and didn't compile).
30 SE_ARG_ENABLE_BACKEND(akonadi, akonadi,
31 [AS_HELP_STRING([--disable-akonadi],
32 [disable access to Akonadi (default is to use it if akonadi.pc is found)])],
33 [enable_akonadi="$enableval"
34 test $AKONADIFOUND = "yes" || test $enable_akonadi = "no" || AC_MSG_ERROR([akonadi.pc not found. Install it to compile with the Akonadi backend enabled.])],
38 if test "$enable_akonadi" = "yes"; then
39 # conditional compilation in preprocessor
40 AC_DEFINE(ENABLE_AKONADI, 1, [Akonadi available])
42 # avoid unneeded dependencies on Akonadi
47 AC_SUBST(KDEPIM_CFLAGS)
49 # conditional compilation in make
50 AM_CONDITIONAL([ENABLE_AKONADI], [test "$enable_akonadi" = "yes"])
52 # let others include Akonadi backend's header file
53 # (not strictly necessary, could be avoided by not
54 # including Akonadi header files in public header file
56 BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $KDEPIM_CFLAGS"