Imported Upstream version 0.9~0.9.1beta2
[platform/upstream/syncevolution.git] / configure-post.in
1 dnl -*- mode: Autoconf; -*-
2 dnl Invoke autogen.sh to produce a configure script.
3 dnl configure-pre.in and src/backends/*/configure-sub.in and configure-post.in come before this part
4
5 AC_SUBST(BACKEND_CPPFLAGS)
6
7 enable_any="no"
8 backend_is_enabled () {
9     eval echo \${enable_${1}}
10 }
11 for backend in $BACKENDS; do
12     if test `backend_is_enabled $backend` == "yes"; then
13        enable_any="yes"
14        SYNCEVOLUTION_MODULES="$SYNCEVOLUTION_MODULES src/backends/sync${backend}.la"
15     fi
16 done
17
18 if test "$enable_any" = "no"; then
19         AC_MSG_ERROR([no backend enabled - refusing to continue: $anymissing])
20 fi
21
22 dnl check for glib - calling g_type_init() is expected on Maemo
23 PKG_CHECK_MODULES(GLIB, "glib-2.0", GLIBFOUND=yes, GLIBFOUND=no)
24 # This check here is broken on Ubuntu 8.04: it calls glib-config,
25 # which isn't found, but the error is not detected by configure.
26 #if test "x${GLIBFOUND}" = "xno"; then
27 #       PKG_CHECK_MODULES(GLIB, "glib", GLIBFOUND=yes, GLIBFOUND=no)
28 #fi
29 AC_SUBST(GLIB_CFLAGS)
30 AC_SUBST(GLIB_LIBS)
31
32 dnl check for programs.
33 AC_PROG_CXX
34 AC_PROG_LIBTOOL
35 AC_PROG_MAKE_SET
36
37 dnl glib initialization is done only if requested by some configure-sub.in,
38 dnl for not needed otherwise even if found
39 if test "$need_glib" != "yes"; then
40         GLIB_CFLAGS=
41         GLIB_LIBS=
42 else
43         if  test "x${GLIBFOUND}" = "xyes"; then
44             AC_DEFINE(HAVE_GLIB, 1, [glib found])
45         fi
46         BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS"
47 fi
48
49 dnl figure out whether we link all code statically or as modules
50 AM_CONDITIONAL([ENABLE_MODULES], [test "$enable_shared" == "yes"])
51 if test "$enable_shared" == "yes"; then
52         AC_DEFINE(ENABLE_MODULES, 1, [enable dynamically opening sync source backends])
53 fi
54 AC_SUBST(SYNCEVOLUTION_LDADD)
55
56 dnl CXXFLAGS gets applied to SyncEvolution and the client library.
57 dnl For e.g. "-Wall -Werror" this might not be such a good idea;
58 dnl SYNCEVOLUTION_CXXFLAGS can be used instead. It applies only
59 dnl to the sources in the SyncEvolution repository.
60 AC_SUBST(SYNCEVOLUTION_CXXFLAGS)
61
62 dnl a quick-and-dirty way to detect compilation for the iPhone
63 if test "$host" == "arm-apple-darwin"; then
64    AC_DEFINE(IPHONE, 1, [compiling for iPhone])
65    DEVICE_TYPE=iPhone
66 fi
67
68 dnl --enable-evolution-compatibility
69 if test "$enable_evolution_compatibility" == "yes"; then
70    AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
71 fi
72 AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" == "yes"])
73
74 dnl --enable-developer-mode
75 if test "$enable_developer_mode" == "yes"; then
76 backendsearchdir="`pwd`/src/backends/"
77 else
78 backendsearchdir='$(libdir)'/syncevolution/backends/
79 fi
80
81 backenddir='$(libdir)'/syncevolution/backends/
82 AC_SUBST(backenddir)
83 AC_SUBST(backendsearchdir)
84
85 dnl This string is sent as part of the SyncML DevInf (device
86 dnl information) structure to the server. All SyncEvolution platforms
87 dnl use "SyncEvolution" as HTTP user agent and "Mod" (model), so the
88 dnl device type is the only way how different kinds of clients can be
89 dnl distinguished.
90 AC_DEFINE_UNQUOTED(DEVICE_TYPE, "$DEVICE_TYPE", "SyncML DevInf DevType")
91
92 AC_CHECK_HEADERS(stdarg.h valgrind/valgrind.h execinfo.h)
93
94 AC_DEFINE(SYNTHESIS, 1, "using Synthesis engine")
95
96 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)
97 AC_OUTPUT
98
99 echo
100 echo CONFIGURATION SUMMARY
101 for backend in $BACKENDS; do
102     eval echo $backend: \${enable_${backend}}
103 done
104 echo "DBus service: $enable_dbus_service"
105 echo "UI (DBus client): $enable_gui"
106 echo