1 dnl Invoke autogen.sh to produce a configure script.
3 AC_INIT(src/sysync/engineinterface.cpp)
4 AC_CONFIG_MACRO_DIR([m4])
5 # four digit upstream version, one additional digit for
6 # Linux/SyncEvolution specific extensions:
7 AM_INIT_AUTOMAKE(synthesis, 3.4.0.16.9)
8 AM_CONFIG_HEADER(config.h)
11 dnl check for programs.
17 # --enable-warning=min/max/fatal/none
18 DK_ARG_ENABLE_WARNINGS([SYNTHESIS_WFLAGS],
19 [-Wall -Wno-unknown-pragmas -Wno-unused-but-set-variable],
20 [-Wall -Wno-unknown-pragmas -Wno-unused-but-set-variable],
23 dnl Extract PIC flags from libtool configure for libsynthesissdk.a
24 dnl (makes assumptions about libtool var naming!). Some versions
25 dnl of libtool use PIC mode automatically for static libraries,
26 dnl others don't (?!). See "[os-libsynthesis] libsynthesissdk.a built without -fPIC".
27 PIC_CXXFLAGS="$lt_prog_compiler_pic_CXX"
28 AC_SUBST(PIC_CXXFLAGS)
30 AC_ARG_ENABLE(debug-logs,
31 AS_HELP_STRING([--enable-debug-logs],
32 [For developers: add links to call location to HTML log files. Depends on Doxygen (for HTML version of source) and g++ (for __PRETTY_FUNCTION__).]),
33 enable_debug_logs="$enableval", enable_debug_logs="no")
34 if test "$enable_debug_logs" = "yes"; then
35 AC_DEFINE_UNQUOTED(SYDEBUG_LOCATION, "`pwd`/src/html", [absolute path to Doxygen HTML output])
37 AM_CONDITIONAL([COND_DOXYGEN], [test "$enable_debug_logs" = "yes"])
39 dnl All of these libraries have to be compiled and installed
40 dnl separately. TODO: build bundled sources?
42 dnl WARNING: the initial PKG_CHECK_MODULES() must be executed
43 dnl in all cases (i.e., not depend on an if clause) because
44 dnl it initializes pkg-config checking.
45 PKG_CHECK_MODULES(FOOBAR, foobar, [true], [true])
48 AS_HELP_STRING([--enable-sqlite],
49 [enable the sqlite-based ODBC backend, depends on libsqlite3, enabled by default]),
50 [enable_sqlite=$enableval],
51 [enable_sqlite="yes"])
52 if test "$enable_sqlite" == "yes"; then
53 PKG_CHECK_MODULES(SQLITE3, sqlite3)
58 AC_DEFINE_UNQUOTED(ONOFF_SQLITE_SUPPORT, $HAVE_SQLITE, [controls whether ODBC backend with libsqlite is enabled])
61 AS_HELP_STRING([--enable-regex],
62 [enable regular expression support in scripts, depends on libpcre, enabled by default]),
63 [enable_regex=$enableval],
65 if test "$enable_regex" == "yes"; then
66 PKG_CHECK_MODULES(PCRE, libpcre,
68 [AC_ERROR([libpcre not found, required for --enable-regex])])
73 AC_DEFINE_UNQUOTED(ONOFF_REGEX_SUPPORT, $HAVE_PCRE, "regular expressions in scripts")
75 AC_CHECK_HEADER(zlib.h, , [AC_ERROR(zlib.h not found.)])
76 AC_CHECK_HEADER(xmltok/xmlparse.h, have_system_xmltok="yes")
77 AC_CHECK_HEADER(expat.h, have_system_expat="yes")
79 dnl libical might be installed stand-alone (upstream)
80 dnl or bundled with libecal. Upstream is preferred and
81 dnl thus checked first. libical is optional, so don't
82 dnl complain if not found.
83 AC_ARG_ENABLE(libical,
84 AS_HELP_STRING([--enable-libical],
85 [use libical (if necessary, the one in libecal) to improve time zone support, enabled by default if necessary libs are found]),
86 [enable_libical=$enableval],
87 [enable_libical="yes"])
88 if test "$enable_libical" == "yes"; then
89 PKG_CHECK_MODULES(LIBICAL, libical,
90 [AC_DEFINE(HAVE_LIBICAL, 1, "libical available")],
91 [PKG_CHECK_MODULES(LIBECAL, libecal-1.2,
92 [AC_DEFINE(HAVE_LIBICAL, 1, "libical available")
93 AC_DEFINE(HAVE_LIBECAL, 1, "libecal available")],
97 AC_ARG_ENABLE(evolution-compatibility,
98 AS_HELP_STRING([--enable-evolution-compatibility],
99 [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]),
100 enable_evolution_compatibility="$enableval", enable_evolution_compatibility="no")
101 if test "$enable_evolution_compatibility" == "yes"; then
102 AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
108 AS_HELP_STRING([--with-xmltok=<builtin|system|path>],
109 [Chooses which xmltok/xmlparse gets used.
110 "builtin" = compile code into libsynthesis.
111 "system" = use header files and libxmlparse from standard search paths.
112 "path" = use header files in "path/include" and libxmlparse in "path/lib".
113 Default is system if header files are found, otherwise builtin.]),
114 [ if test "$withval" = "builtin"; then with_xmltok="builtin"
115 elif test "$withval" = "system" || test "$withval" = "yes"; then with_xmltok="system"
116 else with_xmltok="$withval"
118 [ with_xmltok="no" ])
121 AS_HELP_STRING([--with-expat=<system|path>],
122 [Choose expat as the XML parser library. Replaces --with-xmltok.
123 "system" = use header files and libexpat from standard search paths.
124 "path" = use header files in "path/include", and libexpat in "path/lib".]),
125 [ if test "$withval" = "system" || test "$withval" = "yes"; then with_expat="system"
126 else with_expath="$withval"
130 if test "$with_xmltok" = "no" && test "$with_expat" = "no"; then
131 if test "$have_system_expat" = "yes"; then
133 XMLPARSE_LIBS="-lexpat"
134 elif test "$have_system_xmltok" = "yes"; then
136 XMLPARSE_LIBS="-lxmlparse"
138 with_xmltok="builtin"
140 elif test "$with_expat" != "no"; then
141 if test "$with_expat" = "system"; then
142 if test "$have_system_expat" = "yes"; then XMLPARSE_LIBS="-lexpat"
143 else AC_ERROR(expat.h not found.)
146 XMLPARSE_LIBS="-L$with_expat/lib -lexpat"
147 XMLPARSE_CFLAGS="-I$with_expat/include"
151 if test "$with_xmltok" = "system"; then
152 if test "$have_system_xmltok" = "yes"; then XMLPARSE_LIBS="-lxmlparse"
153 else AC_ERROR(xmltok/xmplarse.h not found.)
155 elif test "$with_xmltok" != "builtin"; then
156 XMLPARSE_LIBS="-L$with_xmltok/lib -lxmlparse"
157 XMLPARSE_CFLAGS="-I$with_xmltok/include"
161 if test "$with_expat" = "yes"; then
162 AC_DEFINE(HAVE_EXPAT, 1, [Define to 1 to use expat as XML parser])
163 elif test "$with_xmltok" != "builtin"; then
164 AC_DEFINE(HAVE_SYS_XMLTOK, 1, [Define to 1 use system xmltok as XML parser])
166 AC_DEFINE(HAVE_BUILTIN_XMLTOK, 1, [Define to 1 use builtin xmltok as XML Parser])
169 AC_SUBST(XMLPARSE_LIBS)
170 AC_SUBST(XMLPARSE_CFLAGS)
171 AM_CONDITIONAL([COND_XMLPARSE], [test "$with_xmltok" = "builtin"])
173 AC_CHECK_HEADER(stdint.h)
175 # the autotools SDK always assumes that it is linked against the engine
176 AC_DEFINE(UIAPI_LINKED, 1, [libsynthesis.a linked statically])
177 AC_DEFINE(DBAPI_LINKED, 1, [client engine linked statically])
178 AC_DEFINE(DBAPI_SRV_LINKED, 1, [server engine linked statically])
180 # determines which object files are needed in the SDK:
181 # if linking statically, some object files are shared with
183 AM_CONDITIONAL([COND_STATIC], [test "$enable_shared" = "no"])
185 # Disable unconditionally at the moment. Would add dependency of SDK
187 #AC_DEFINE(WITHOUT_SAN_1_1, 1,
188 # [support for Server Alerted Notifications according to SyncML 1.1])
190 AC_CONFIG_FILES(Makefile src/Makefile synthesis.pc synthesis-sdk.pc)