1 dnl Invoke autogen.sh to produce a configure script.
3 AC_INIT(src/sysync/engineinterface.cpp)
4 AC_CONFIG_MACRO_DIR([m4])
5 AM_INIT_AUTOMAKE(syncevolution, 0.8-beta2)
6 AM_CONFIG_HEADER(config.h)
9 dnl check for programs.
15 dnl All of these libraries have to be compiled and installed
16 dnl separately. TODO: build bundled sources?
17 PKG_CHECK_MODULES(PCRE, libpcre)
18 PKG_CHECK_MODULES(SQLITE3, sqlite3)
19 AC_CHECK_HEADER(zlib.h, , [AC_ERROR(zlib.h not found.)])
20 AC_CHECK_HEADER(xmltok/xmlparse.h, have_system_xmltok="yes")
21 AC_CHECK_HEADER(expat.h, have_system_expat="yes")
23 dnl libical might be installed stand-alone (upstream)
24 dnl or bundled with libecal. Upstream is preferred and
25 dnl thus checked first. libical is optional, so don't
26 dnl complain if not found.
27 PKG_CHECK_MODULES(LIBICAL, libical,
28 [AC_DEFINE(HAVE_LIBICAL, 1, "libical available")],
29 [PKG_CHECK_MODULES(LIBECAL, libecal-1.2,
30 [AC_DEFINE(HAVE_LIBICAL, 1, "libical available")
31 AC_DEFINE(HAVE_LIBECAL, 1, "libecal available")],
34 AC_ARG_ENABLE(evolution-compatibility,
35 AS_HELP_STRING([--enable-evolution-compatibility],
36 [build executables which only call Evolution via dlopen/dlsym: this avoids all hard dependencies on EDS shared objects, but might lead to crashes when their ABI changes]),
37 enable_evolution_compatibility="$enableval", enable_evolution_compatibility="no")
38 if test "$enable_evolution_compatibility" == "yes"; then
39 AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
45 AS_HELP_STRING([--with-xmltok=<builtin|system|path>],
46 [Chooses which xmltok/xmlparse gets used.
47 "builtin" = compile code into libsynthesis.
48 "system" = use header files and libxmlparse from standard search paths.
49 "path" = use header files in "path/include" and libxmlparse in "path/lib".
50 Default is system if header files are found, otherwise builtin.]),
51 [ if test "$withval" = "builtin"; then with_xmltok="builtin"
52 elif test "$withval" = "system" || test "$withval" = "yes"; then with_xmltok="system"
53 else with_xmltok="$withval"
58 AS_HELP_STRING([--with-expat=<system|path>],
59 [Choose expat as the XML parser library. Replaces --with-xmltok.
60 "system" = use header files and libexpat from standard search paths.
61 "path" = use header files in "path/include", and libexpat in "path/lib".]),
62 [ if test "$withval" = "system" || test "$withval" = "yes"; then with_expat="system"
63 else with_expath="$withval"
67 if test "$with_xmltok" = "no" && test "$with_expat" = "no"; then
68 if test "$have_system_expat" = "yes"; then
70 XMLPARSE_LIBS="-lexpat"
71 elif test "$have_system_xmltok" = "yes"; then
73 XMLPARSE_LIBS="-lxmlparse"
77 elif test "$with_expat" != "no"; then
78 if test "$with_expat" = "system"; then
79 if test "$have_system_expat" = "yes"; then XMLPARSE_LIBS="-lexpat"
80 else AC_ERROR(expat.h not found.)
83 XMLPARSE_LIBS="-L$with_expat/lib -lexpat"
84 XMLPARSE_CFLAGS="-I$with_expat/include"
88 if test "$with_xmltok" = "system"; then
89 if test "$have_system_xmltok" = "yes"; then XMLPARSE_LIBS="-lxmlparse"
90 else AC_ERROR(xmltok/xmplarse.h not found.)
92 elif test "$with_xmltok" != "builtin"; then
93 XMLPARSE_LIBS="-L$with_xmltok/lib -lxmlparse"
94 XMLPARSE_CFLAGS="-I$with_xmltok/include"
98 if test "$with_expat" = "yes"; then
99 AC_DEFINE(HAVE_EXPAT, 1, [Define to 1 to use expat as XML parser])
100 elif test "$with_xmltok" != "builtin"; then
101 AC_DEFINE(HAVE_SYS_XMLTOK, 1, [Define to 1 use system xmltok as XML parser])
103 AC_DEFINE(HAVE_BUILTIN_XMLTOK, 1, [Define to 1 use builtin xmltok as XML Parser])
106 AC_SUBST(XMLPARSE_LIBS)
107 AC_SUBST(XMLPARSE_CFLAGS)
108 AM_CONDITIONAL([COND_XMLPARSE], [test "$with_xmltok" = "builtin"])
110 AC_CHECK_HEADER(stdint.h)
112 # the autotools SDK always assumes that it is linked against the engine
113 AC_DEFINE(UIAPI_LINKED, 1, [libsynthesis.a linked statically])
114 AC_DEFINE(DBAPI_LINKED, 1, [client engine linked statically])
115 AC_DEFINE(DBAPI_SRV_LINKED, 1, [server engine linked statically])
117 # determines which object files are needed in the SDK:
118 # if linking statically, some object files are shared with
120 AM_CONDITIONAL([COND_STATIC], [test "$enable_shared" = "no"])
122 # Disable unconditionally at the moment. Would add dependency of SDK
124 AC_DEFINE(WITHOUT_SAN_1_1, 1,
125 [support for Server Alerted Notifications according to SyncML 1.1])
127 AC_CONFIG_FILES(Makefile src/Makefile synthesis.pc synthesis-sdk.pc)