2008-07-30 19:30:10 +02:00
|
|
|
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
|
2009-12-09 16:08:26 +01:00
|
|
|
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)
|
|
|
|
|
2008-07-30 19:30:10 +02:00
|
|
|
if test "x${GLIBFOUND}" = "xyes"; then
|
|
|
|
AC_DEFINE(HAVE_GLIB, 1, [glib found])
|
2009-12-09 16:08:26 +01:00
|
|
|
else
|
|
|
|
AC_ERROR([not all GNOME libraries found])
|
2008-07-30 19:30:10 +02:00
|
|
|
fi
|
2009-12-09 16:08:26 +01:00
|
|
|
BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS"
|
2008-07-30 19:30:10 +02:00
|
|
|
fi
|
|
|
|
|
2010-02-08 19:42:25 +01:00
|
|
|
# determine from where we can get a SHA-256 implementation
|
|
|
|
have_sha="no"
|
|
|
|
if test "$GLIBFOUND" = "yes"; then
|
|
|
|
# only use glib if we need it anyway, also has to be at lease 2.16
|
2010-02-09 21:16:24 +01:00
|
|
|
PKG_CHECK_MODULES(GLIB216, [glib-2.0 >= 2.16],
|
2010-02-08 19:42:25 +01:00
|
|
|
[AC_DEFINE(USE_SHA256, 1, [choose implementation of SHA-256])
|
2010-02-09 21:16:24 +01:00
|
|
|
have_sha="glib"],
|
|
|
|
[true])
|
2010-02-08 19:42:25 +01:00
|
|
|
fi
|
|
|
|
if test "$have_sha" = "no"; then
|
|
|
|
# Fallback is Mozilla NSS. In contrast to libgcrypt it has a .pc
|
|
|
|
# file and a simple API.
|
|
|
|
PKG_CHECK_MODULES(NSS, "nss",
|
|
|
|
[AC_DEFINE(USE_SHA256, 2, [choose implementation of SHA-256])
|
|
|
|
have_sha="nss"])
|
|
|
|
fi
|
|
|
|
|
2008-07-30 19:30:10 +02:00
|
|
|
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
|
|
|
|
|
2008-10-08 23:30:06 +02:00
|
|
|
dnl --enable-evolution-compatibility
|
|
|
|
if test "$enable_evolution_compatibility" == "yes"; then
|
|
|
|
AC_DEFINE(EVOLUTION_COMPATIBILITY, 1, [avoid hard dependency on Evolution shared objects])
|
|
|
|
fi
|
2009-10-12 23:49:26 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" == "yes"])
|
2008-10-08 23:30:06 +02:00
|
|
|
|
2009-09-02 05:13:10 +02:00
|
|
|
dnl --enable-developer-mode
|
|
|
|
if test "$enable_developer_mode" == "yes"; then
|
2009-09-24 16:52:57 +02:00
|
|
|
backendsearchdir="`pwd`/src/backends/"
|
2009-09-02 05:13:10 +02:00
|
|
|
else
|
|
|
|
backendsearchdir='$(libdir)'/syncevolution/backends/
|
|
|
|
fi
|
|
|
|
|
2009-11-30 18:41:08 +01:00
|
|
|
backenddir='$(libdir)'/syncevolution/backends
|
2009-09-02 05:13:10 +02:00
|
|
|
AC_SUBST(backenddir)
|
|
|
|
AC_SUBST(backendsearchdir)
|
|
|
|
|
2008-07-30 19:30:10 +02:00
|
|
|
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)
|
|
|
|
|
2009-03-30 17:54:47 +02:00
|
|
|
AC_DEFINE(SYNTHESIS, 1, "using Synthesis engine")
|
|
|
|
|
2010-01-11 18:15:10 +01:00
|
|
|
# fallback for lack of --with-docdir support in older automake
|
|
|
|
if test ! "$docdir"; then
|
|
|
|
docdir = ${datadir}/doc/syncevolution
|
|
|
|
AC_SUBST(docdir)
|
|
|
|
fi
|
|
|
|
|
XML config: use configuration composed from fragments (MB #7712)
This patch replaces src/syncclient_sample_config.xml with a
combination of src/syncevo/configs/syncevolution.xml and the
config fragments that are shared with Synthesis upstream.
These fragments are installed in /usr/share/syncevolution/xml (or
the corresponding data path). From there they are read at runtime
to compose the final XML configuration. Users can copy individual files
into the corresponding directory hierarchy rooted at
$XDG_CONFIG_HOME/syncevolution-xml to replace individual fragments.
New fragments can be added there or in /usr/share.
For testing, these two directories can be overridden with the
SYNCEVOLUTION_XML_CONFIG_DIR env variable. No tests have been added
for this yet. There's also no documentation about it except this
commit message - add something to the HACKING guide once this
new concept stabilizes.
Developers can add new fragments in the source tree, invoke make and run the
resulting binary in client mode. As before, a complete config is included
in the binary. However, it is only sufficient for SyncML client mode.
For server mode, the files are expected to be installed (no need to maintain
a list of files in a Makefile for that) or SYNCEVOLUTION_XML_CONFIG_DIR
must be set.
At the moment, the following sub-directories are scanned for .xml files:
- the root directory to find syncevolution.xml
- datatypes, datatypes/client, datatypes/server
- scripting, scripting/client, scripting/server
- remoterules, remoterules/client, remoterules/server
Files inside "client" or "server" sub-directories are only used
when assembling a config for the corresponding mode of operation.
The goal of this patch is to simplify config sharing with Synthesis
(individual files are easier to manage than the monolitithic one), to
share files between client and server with the possibility to add
mode-specific files, and to allow users to extend the XML
configuration. The most likely use case for the latter is support for
more devices.
Previously, remote rules for the different devices listed in
syncserv_sample_config.xml were not used by SyncEvolution.
This patch moves the ZYB remote rule into a client-specific remote rule,
thus removing a complaint from libsynthesis about the unknown <client>
element when running as server.
Because we are using the unified upstream config, some parts of the config
have changed:
- There is a SYNCLVL field in all field list. This is currently unused
by SyncEvolution, but doesn't hurt either.
- A new iCalendar 2.0 all-day sanity check was added (for older Oracle servers?).
- The CATEGORIES defition in vBookmark was extended.
- some comment and white space changes
Because this is such fundamental change, extra care was taken to
minimize and verify the config changes. Here's the command which compares
old and new config for clients plus its output:
$ update-samples.pl syncevolution.xml client | diff -c -b syncclient_sample_config.xml -
***************
*** 31,42 ****
<scripting>
<looptimeout>5</looptimeout>
- <function><![CDATA[
- // create a UID
- string newuid() {
- return "syuid" + NUMFORMAT(RANDOM(1000000),6,"0") + "." + (string)MILLISECONDS(NOW());
- }
- ]]></function>
<macro name="VCARD_BEFOREWRITE_SCRIPT_EVOLUTION"><![CDATA[
// a wordaround for cellphone in evolution. for incoming contacts, if there is only one CELL,
// strip the HOME or WORK flag from it. Evolution then should show it. */
--- 30,35 ----
***************
*** 118,123 ****
--- 111,124 ----
}
]]></macro>
+ <function><![CDATA[
+ // create a UID
+ string newuid() {
+ return "syuid" + NUMFORMAT(RANDOM(1000000),6,"0") + "." + (string)MILLISECONDS(NOW());
+ }
+ ]]></function>
+
+
<!-- define script macros for scripts that are used by both vCalendar 1.0 and iCalendar 2.0 -->
<macro name="VCALENDAR_INCOMING_SCRIPT"><![CDATA[
***************
*** 145,150 ****
--- 146,158 ----
DTSTART = CONVERTTOUSERZONE(DTSTART);
MAKEALLDAY(DTSTART,DTEND,i);
}
+ else {
+ // iCalendar 2.0 - only if DTSTART is a date-only value this really is an allday
+ if (ISDATEONLY(DTSTART)) {
+ // reshape to make sure we don't have invalid zero-duration alldays (old OCS 9 servers)
+ MAKEALLDAY(DTSTART,DTEND,i);
+ }
+ }
// Make sure that all EXDATE times are in the same timezone as the start
// time. Some servers send them as UTC, which is all fine and well, but
***************
*** 265,275 ****
</scripting>
-
<datatypes>
-
<!-- list of internal fields representing vCard data -->
<fieldlist name="contacts">
<field name="REV" type="timestamp" compare="never" age="yes"/>
<!-- Name elements -->
--- 274,283 ----
</scripting>
<datatypes>
<!-- list of internal fields representing vCard data -->
<fieldlist name="contacts">
+ <field name="SYNCLVL" type="integer" compare="never"/>
<field name="REV" type="timestamp" compare="never" age="yes"/>
<!-- Name elements -->
***************
*** 680,689 ****
$VCARD_INCOMING_NAMECHANGE_SCRIPT
]]></incomingscript>
</datatype>
-
-
<!-- common field list for events and todos (both represented by vCalendar/iCalendar) -->
<fieldlist name="calendar">
<field name="ISEVENT" type="integer" compare="always"/>
<field name="DMODIFIED" type="timestamp" compare="never" age="yes"/>
--- 688,696 ----
$VCARD_INCOMING_NAMECHANGE_SCRIPT
]]></incomingscript>
</datatype>
<!-- common field list for events and todos (both represented by vCalendar/iCalendar) -->
<fieldlist name="calendar">
+ <field name="SYNCLVL" type="integer" compare="never"/>
<field name="ISEVENT" type="integer" compare="always"/>
<field name="DMODIFIED" type="timestamp" compare="never" age="yes"/>
***************
*** 787,793 ****
<subprofile onlyformode="standard" name="VTIMEZONE" mode="vtimezones"/>
! <!-- sub-profile for todoz -->
<subprofile name="VTODO" nummandatory="1" showifselectedonly="yes" field="ISEVENT" value="0">
<property name="LAST-MODIFIED" suppressempty="yes">
--- 792,798 ----
<subprofile onlyformode="standard" name="VTIMEZONE" mode="vtimezones"/>
! <!-- sub-profile for tasks -->
<subprofile name="VTODO" nummandatory="1" showifselectedonly="yes" field="ISEVENT" value="0">
<property name="LAST-MODIFIED" suppressempty="yes">
***************
*** 1394,1401 ****
<!-- non-standard properties -->
! <property name="CATEGORIES">
! <value field="CATEGORIES"/>
</property>
<property name="CLASS" suppressempty="yes">
--- 1394,1402 ----
<!-- non-standard properties -->
! <!-- inherit CATEGORIES from vCard 3.0, i.e. comma separated -->
! <property name="CATEGORIES" values="list" valueseparator="," altvalueseparator=";">
! <value field="CATEGORIES" combine=","/>
</property>
<property name="CLASS" suppressempty="yes">
***************
*** 1416,1435 ****
<use profile="vBookmark"/>
</datatype>
! <fieldlists/>
! <profiles/>
! <datatypes/>
</datatypes>
<clientorserver/>
-
- <client type="plugin">
- <remoterule name="ZYB">
- <manufacturer>ZYB</manufacturer>
- <model>ZYB</model>
- <!-- information to disable anchors checking -->
- <lenientmode>yes</lenientmode>
- </remoterule>
- </client>
-
</sysync_config>
--- 1417,1424 ----
<use profile="vBookmark"/>
</datatype>
!
</datatypes>
<clientorserver/>
</sysync_config>
2010-02-02 21:29:53 +01:00
|
|
|
AC_CONFIG_FILES(Makefile src/dbus/interfaces/Makefile src/gdbus/Makefile src/dbus/Makefile src/Makefile src/syncevo/Makefile src/syncevo/syncevolution.pc src/syncevo/configs/Makefile src/gtk-ui/Makefile po/Makefile.in test/Makefile src/dbus/syncevo-dbus.pc)
|
2009-03-30 17:54:47 +02:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2008-07-30 19:30:10 +02:00
|
|
|
echo
|
|
|
|
echo CONFIGURATION SUMMARY
|
|
|
|
for backend in $BACKENDS; do
|
|
|
|
eval echo $backend: \${enable_${backend}}
|
|
|
|
done
|
2009-03-30 17:54:47 +02:00
|
|
|
echo "DBus service: $enable_dbus_service"
|
2009-04-24 17:23:03 +02:00
|
|
|
echo "UI (DBus client): $enable_gui"
|
2009-12-23 18:15:24 +01:00
|
|
|
echo "Bluetooth transport: $have_bluetooth"
|
2010-02-04 14:32:33 +01:00
|
|
|
echo "GNOME Bluetooth panel plugin: $enable_gnome_bluetooth_panel"
|
2010-02-08 19:42:25 +01:00
|
|
|
echo "SHA-256: $have_sha"
|
2008-07-30 19:30:10 +02:00
|
|
|
echo
|