summaryrefslogtreecommitdiff
path: root/configure-post.in
blob: ab3bb5d4e18ea952fe300329498620ad617d8234 (plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
dnl -*- mode: Autoconf; -*-
dnl Invoke autogen.sh to produce a configure script.
dnl configure-pre.in and src/backends/*/configure-sub.in and configure-post.in come before this part

AC_SUBST(BACKEND_CPPFLAGS)

enable_any="no"
backend_is_enabled () {
    eval echo \${enable_${1}}
}
for backend in $BACKENDS; do
    if test `backend_is_enabled $backend` == "yes"; then
       enable_any="yes"
       SYNCEVOLUTION_MODULES="$SYNCEVOLUTION_MODULES src/backends/sync${backend}.la"
    fi
done

if test "$enable_any" = "no"; then
        AC_MSG_ERROR([no backend enabled - refusing to continue: $anymissing])
fi

dnl check for programs.
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET

dnl glib initialization is done only if requested by some configure-sub.in,
dnl for not needed otherwise even if found
if test "$need_glib" = "yes"; then
        # HAVE_GLIB (aka GLIBFOUND) are a catch-all for these
        # three GNOME libs. Assume we have all three unless one of
        # the checks fails.
        GLIBFOUND=yes

        dnl check for glib - calling g_type_init() is expected on Maemo
        PKG_CHECK_MODULES(GLIB, "glib-2.0", , GLIBFOUND=no)
        # This check here is broken on Ubuntu 8.04: it calls glib-config,
        # which isn't found, but the error is not detected by configure.
        #if test "x${GLIBFOUND}" = "xno"; then
        #	PKG_CHECK_MODULES(GLIB, "glib", GLIBFOUND=yes, GLIBFOUND=no)
        #fi

        PKG_CHECK_MODULES(GTHREAD, "gthread-2.0", , GLIBFOUND=no)
        PKG_CHECK_MODULES(GOBJECT, "gobject-2.0", , GLIBFOUND=no)

        if  test "x${GLIBFOUND}" = "xyes"; then
            AC_DEFINE(HAVE_GLIB, 1, [glib found])
        else
            AC_ERROR([not all GNOME libraries found])
        fi
        BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS"
fi

dnl figure out whether we link all code statically or as modules
AM_CONDITIONAL([ENABLE_MODULES], [test "$enable_shared" == "yes"])
if test "$enable_shared" == "yes"; then
        AC_DEFINE(ENABLE_MODULES, 1, [enable dynamically opening sync source backends])
fi
AC_SUBST(SYNCEVOLUTION_LDADD)

dnl CXXFLAGS gets applied to SyncEvolution and the client library.
dnl For e.g. "-Wall -Werror" this might not be such a good idea;
dnl SYNCEVOLUTION_CXXFLAGS can be used instead. It applies only
dnl to the sources in the SyncEvolution repository.
AC_SUBST(SYNCEVOLUTION_CXXFLAGS)

dnl a quick-and-dirty way to detect compilation for the iPhone
if test "$host" == "arm-apple-darwin"; then
   AC_DEFINE(IPHONE, 1, [compiling for iPhone])
   DEVICE_TYPE=iPhone
fi

dnl --enable-evolution-compatibility
if test "$enable_evolution_compatibility" == "yes"; then
   AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
fi
AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" == "yes"])

dnl --enable-developer-mode
if test "$enable_developer_mode" == "yes"; then
backendsearchdir="`pwd`/src/backends/"
else
backendsearchdir='$(libdir)'/syncevolution/backends/
fi

backenddir='$(libdir)'/syncevolution/backends
AC_SUBST(backenddir)
AC_SUBST(backendsearchdir)

dnl This string is sent as part of the SyncML DevInf (device
dnl information) structure to the server. All SyncEvolution platforms
dnl use "SyncEvolution" as HTTP user agent and "Mod" (model), so the
dnl device type is the only way how different kinds of clients can be
dnl distinguished.
AC_DEFINE_UNQUOTED(DEVICE_TYPE, "$DEVICE_TYPE", "SyncML DevInf DevType")

AC_CHECK_HEADERS(stdarg.h valgrind/valgrind.h execinfo.h)

AC_DEFINE(SYNTHESIS, 1, "using Synthesis engine")

# fallback for lack of --with-docdir support in older automake
if test ! "$docdir"; then
   docdir = ${datadir}/doc/syncevolution
   AC_SUBST(docdir)
fi

AC_CONFIG_FILES(Makefile src/dbus/interfaces/Makefile src/dbus/Makefile src/Makefile src/syncevo/Makefile src/syncevo/syncevolution.pc src/gtk-ui/Makefile po/Makefile.in test/Makefile src/dbus/syncevo-dbus.pc)
AC_OUTPUT

echo
echo CONFIGURATION SUMMARY
for backend in $BACKENDS; do
    eval echo $backend: \${enable_${backend}}
done
echo "DBus service: $enable_dbus_service"
echo "UI (DBus client): $enable_gui"
echo