summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzesimir Nowak <krnowak@openismus.com>2011-08-30 16:24:58 +0200
committerKrzesimir Nowak <krnowak@openismus.com>2011-08-30 16:38:34 +0200
commita7ad98fabc965b053cb9e92db431d5b535adee26 (patch)
tree56a912b2390a0dab17a8b1ae85b5911d64840b31
parent36dd42a030f31bc281a8027bd947bbe226a0ea7a (diff)
Port build system to non-recursive Automake.
All but toplevel Makefile.am are replaced with their non-recursive counterparts. The generation of configure.in was removed (and thus configure-{pre,post}.in are also removed) in favor of configure.ac and m4 macros adding backend specific configure parts. Version number is generated like in old build system. There are still many things to improve, but for now there are no immediate regressions. AUTOTOOLS-TODO contains a list of possible improvements and fixes. AUTOTOOLS-TESTING contains what was tested with current build system (configure flags, make options).
-rw-r--r--.cvsignore20
-rw-r--r--.gitignore151
-rw-r--r--AUTOTOOLS-TESTING41
-rw-r--r--AUTOTOOLS-TODO126
-rw-r--r--INSTALL324
-rw-r--r--Makefile.am161
-rw-r--r--README.packagers3
-rwxr-xr-xautogen.sh18
-rw-r--r--autotroll.am (renamed from m4-repo/autotroll.mk)89
-rw-r--r--build/build.am1
-rwxr-xr-xbuild/gen-backends-am.sh38
-rwxr-xr-xbuild/gen-backends.sh24
-rwxr-xr-xbuild/gen-git-version.sh105
-rwxr-xr-xbuild/gen-linguas.sh15
-rw-r--r--configure-post.in194
-rw-r--r--configure.ac (renamed from configure-pre.in)394
-rwxr-xr-xgen-autotools.sh178
-rw-r--r--m4-repo/dk-warn.m4114
-rw-r--r--m4-repo/se_macros.m4173
-rw-r--r--po/.gitignore4
-rw-r--r--po/LINGUAS.README6
-rw-r--r--setup-variables.am49
-rw-r--r--src/.cvsignore13
-rw-r--r--src/.gitignore9
-rw-r--r--src/Makefile-gen.am350
-rw-r--r--src/backends/addressbook/Makefile.am23
-rw-r--r--src/backends/addressbook/addressbook.am24
-rw-r--r--src/backends/addressbook/configure-sub.in8
-rw-r--r--src/backends/akonadi/Makefile.am20
-rw-r--r--src/backends/akonadi/akonadi.am21
-rw-r--r--src/backends/akonadi/configure-sub.in8
-rw-r--r--src/backends/buteo/Makefile.am39
-rw-r--r--src/backends/buteo/buteo.am33
-rw-r--r--src/backends/buteo/configure-sub.in4
-rw-r--r--src/backends/buteo/profiles/profiles.am21
-rw-r--r--src/backends/evolution/Makefile.am50
-rw-r--r--src/backends/evolution/configure-sub.in16
-rw-r--r--src/backends/evolution/evolution.am56
-rw-r--r--src/backends/file/Makefile.am29
-rw-r--r--src/backends/file/configure-sub.in10
-rw-r--r--src/backends/file/file.am28
-rw-r--r--src/backends/kcalextended/Makefile.am22
-rw-r--r--src/backends/kcalextended/configure-sub.in10
-rw-r--r--src/backends/kcalextended/kcalextended.am19
-rw-r--r--src/backends/maemo/Makefile.am22
-rw-r--r--src/backends/maemo/configure-sub.in11
-rw-r--r--src/backends/maemo/maemo.am21
-rw-r--r--src/backends/qtcontacts/Makefile.am27
-rw-r--r--src/backends/qtcontacts/configure-sub.in10
-rw-r--r--src/backends/qtcontacts/qtcontacts.am22
-rw-r--r--src/backends/sqlite/Makefile.am31
-rw-r--r--src/backends/sqlite/configure-sub.in8
-rw-r--r--src/backends/sqlite/sqlite.am32
-rw-r--r--src/backends/webdav/Makefile.am39
-rw-r--r--src/backends/webdav/configure-sub.in10
-rw-r--r--src/backends/webdav/webdav.am38
-rw-r--r--src/backends/xmlrpc/Makefile.am29
-rw-r--r--src/backends/xmlrpc/configure-sub.in22
-rw-r--r--src/backends/xmlrpc/xmlrpc.am30
-rw-r--r--src/dbus/.gitignore1
-rw-r--r--src/dbus/Makefile.am1
-rw-r--r--src/dbus/dbus.am4
-rw-r--r--src/dbus/glib/Makefile.am75
-rw-r--r--src/dbus/glib/glib.am108
-rw-r--r--src/dbus/interfaces/Makefile.am38
-rw-r--r--src/dbus/interfaces/interfaces.am45
-rw-r--r--src/dbus/qt/Makefile.am74
-rw-r--r--src/dbus/qt/configure-sub.in17
-rw-r--r--src/dbus/qt/qt.am76
-rw-r--r--src/dbus/server/.gitignore3
-rw-r--r--src/dbus/server/Makefile.am101
-rw-r--r--src/dbus/server/server.am84
-rw-r--r--src/gdbus/.gitignore1
-rw-r--r--src/gdbus/Makefile.am24
-rw-r--r--src/gdbus/gdbus.am35
-rw-r--r--src/gnome-bluetooth/Makefile.am9
-rw-r--r--src/gnome-bluetooth/gnome-bluetooth.am10
-rw-r--r--src/gtk-ui/Makefile.am81
-rw-r--r--src/gtk-ui/gtk-ui.am104
-rw-r--r--src/src.am351
-rw-r--r--src/syncevo/.gitignore3
-rw-r--r--src/syncevo/Makefile.am220
-rw-r--r--src/syncevo/SingleFileConfigTree.h6
-rw-r--r--src/syncevo/SoupTransportAgent.cpp2
-rw-r--r--src/syncevo/configs/Makefile.am2
-rw-r--r--src/syncevo/configs/configs.am7
-rw-r--r--src/syncevo/configs/configs_xml.am31
-rw-r--r--src/syncevo/syncevo.am246
-rw-r--r--src/syncevo/syncevolution.pc.in1
-rw-r--r--src/templates/templates.am16
-rw-r--r--src/testcases.am27
-rw-r--r--test/Makefile.am31
-rwxr-xr-xtest/run_src_client_test.sh6
-rwxr-xr-xtest/test-dbus.py22
-rw-r--r--test/test.am36
95 files changed, 3137 insertions, 2154 deletions
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 24dcda16..00000000
--- a/.cvsignore
+++ /dev/null
@@ -1,20 +0,0 @@
-autom4te.cache
-aclocal.m4
-config.h
-config.h.in
-config.log
-config.status
-libtool
-stamp-h1
-Makefile
-Makefile.in
-README.syncevolution
-syncevolution-*.tar.gz
-config.guess
-config.sub
-configure
-depcomp
-install-sh
-ltmain.sh
-missing
-mkinstalldirs
diff --git a/.gitignore b/.gitignore
index 39160226..30e61d97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,34 +1,129 @@
-*~
-/.dotest
-/Makefile.am
-aclocal.m4
-m4
-autom4te.cache
-config.guess
-config.h.in
-config.sub
-configure
-configure.in
-depcomp
-install-sh
-ltmain.sh
-missing
-Makefile.in
-mkinstalldirs
-intltool-*.in
-/*.patch
-*.o
-*.lo
+# general
*.la
+*.lo
+*.o
+*~
.deps
+.dirstamp
.libs
-.*.swp
Makefile
-*.gmo
-stamp-h1
-CONFIGURE.sh
-config.status
-config.log
-/libtool
+Makefile.in
+
+# top level
+/autom4te.cache
+/aclocal.m4
+/compile
+/config.guess
/config.h
+/config.h.in
+/config.log
+/config.status
+/config.sub
+/configure
+/depcomp
+/install-sh
+/libtool
+/ltmain.sh
+/m4
+/missing
+/mkinstalldirs
/README
+/README.html
+/stamp-h1
+/syncevolution.1
+/syncevolution-*.tar.gz
+
+# po
+/po/*.gmo
+/po/.intltool-merge-cache
+/po/LINGUAS
+/po/Makefile.in.in
+/po/POTFILES
+/po/stamp-it
+
+# src
+/src/autotroll.mk
+/src/Client_Source_*.log
+/src/Client_Sync_*.log
+/src/Client_Sync_*.A
+/src/client-test
+/src/LogDirTest
+/src/LogRedirectTest_glib.out
+/src/N7SyncEvo*.log
+/src/synccompare
+/src/syncevo-dbus-server
+/src/syncevo-http-server
+/src/syncevolution
+/src/testcases/
+
+# src/backends
+/src/backends/backends.am
+
+# src/backends/buteo
+/src/backends/buteo/autotroll.mk
+
+# src/backends/webdav
+/src/backends/webdav/syncevo-webdav-lookup
+
+# src/dbus/glib
+/src/dbus/glib/stamp-syncevo-connection-bindings.h
+/src/dbus/glib/stamp-syncevo-connection-glue.h
+/src/dbus/glib/stamp-syncevo-server-bindings.h
+/src/dbus/glib/stamp-syncevo-server-glue.h
+/src/dbus/glib/stamp-syncevo-session-bindings.h
+/src/dbus/glib/stamp-syncevo-session-glue.h
+/src/dbus/glib/syncevo-connection-glue.h
+/src/dbus/glib/syncevo-connection-bindings.h
+/src/dbus/glib/syncevo-connection.xml
+/src/dbus/glib/syncevo-dbus.pc
+/src/dbus/glib/syncevo-marshal.c
+/src/dbus/glib/syncevo-marshal.h
+/src/dbus/glib/syncevo-server-glue.h
+/src/dbus/glib/syncevo-server-bindings.h
+/src/dbus/glib/syncevo-server.xml
+/src/dbus/glib/syncevo-session-glue.h
+/src/dbus/glib/syncevo-session-bindings.h
+/src/dbus/glib/syncevo-session.xml
+/src/dbus/glib/test-syncevo-dbus
+
+# src/dbus/interfaces
+/src/dbus/interfaces/syncevo-connection-doc.xml
+/src/dbus/interfaces/syncevo-dbus-api-doc.html
+/src/dbus/interfaces/syncevo-dbus-api-doc.xml
+/src/dbus/interfaces/syncevo-server-doc.xml
+/src/dbus/interfaces/syncevo-session-doc.xml
+
+# src/dbus/qt
+/src/dbus/qt/autotroll.mk
+/src/dbus/qt/syncevolution-qt-dbus.pc
+/src/dbus/qt/stamp-connection
+/src/dbus/qt/stamp-server
+/src/dbus/qt/stamp-session
+/src/dbus/qt/syncevo-connection-full.cpp
+/src/dbus/qt/syncevo-connection-full.h
+/src/dbus/qt/syncevo-connection-full.moc.cpp
+/src/dbus/qt/syncevo-server-full.cpp
+/src/dbus/qt/syncevo-server-full.h
+/src/dbus/qt/syncevo-server-full.moc.cpp
+/src/dbus/qt/syncevo-session-full.cpp
+/src/dbus/qt/syncevo-session-full.h
+/src/dbus/qt/syncevo-session-full.moc.cpp
+
+# src/dbus/server
+/src/dbus/server/org.syncevolution.service
+/src/dbus/server/syncevo-dbus-server-startup.sh
+/src/dbus/server/syncevo-dbus-server.desktop
+
+# src/gdbus
+/src/gdbus/example
+
+# src/gtk-ui
+/src/gtk-ui/sync-ui
+/src/gtk-ui/sync.desktop
+/src/gtk-ui/ui.xml
+
+# src/syncevo
+/src/syncevo-phone-config
+/src/syncevo/CmdlineHelp.c
+/src/syncevo/SyncEvolutionXML.c
+/src/syncevo/syncevolution.pc
diff --git a/AUTOTOOLS-TESTING b/AUTOTOOLS-TESTING
new file mode 100644
index 00000000..49fb6532
--- /dev/null
+++ b/AUTOTOOLS-TESTING
@@ -0,0 +1,41 @@
+Untested:
+- flags of configure script:
+ --enable-mlite
+ --enable-gui=all or --enable-gui=moblin
+ --enable-akonadi
+ --enable-kcalextended
+ --enable-qtcontacts (see TODO)
+ --enable-kwallet
+ --enable-buteo-tests
+ --enable-buteo
+ --enable-maemocal
+ ... probably more.
+- make -j and make -jX where X>2, because gcc is being killed by oom-killer).
+
+Partially tested:
+--enable-gnome-bluetooth-panel-plugin (installation not tested - plugin is not
+ installed under given prefix, but somewhere into /usr/lib...)
+
+Tested and passed:
+- flags of configure script:
+ --enable-unit-tests
+ --enable-integration-tests
+ --enable-maemo
+ --enable-libcurl
+ --enable-libsoup
+ --enable-bluetooth
+ --enable-gui=gtk
+ --enable-core
+ --enable-dbus-service
+ --enable-gnome-keyring
+ --enable-notify
+ --enable-doc
+ --enable-sqlite
+ --enable-dav
+ --enable-xmlrpc
+ --enable-qt-dbus
+ --enable-static
+ --disable-shared
+- make -jX
+- make V=0
+- make -j2 distcheck
diff --git a/AUTOTOOLS-TODO b/AUTOTOOLS-TODO
new file mode 100644
index 00000000..23b77caa
--- /dev/null
+++ b/AUTOTOOLS-TODO
@@ -0,0 +1,126 @@
+REGRESSIONS:
+
+
+- None.
+
+
+IMPROVEMENTS:
+
+
+- Add a check for qt-mobility for QtContacts backend.
+
+
+- Probably client test should be built only when unit tests or integration tests
+ are enabled.
+
+
+- Look at the note at the bottom of configure.ac:
+
+ # Avoid hard-coding paths in backends. These names are chosen so
+ # that a backend can alternatively use its own top-level configure
+ # with PKG_CHECK_MODULES(SYNCEVOLUTION, "syncevolution") to set them.
+ # need absolute path, use pwd instead of relative $srcdir
+ SYNCEVOLUTION_CFLAGS=-I`cd $srcdir && pwd`/src
+ SYNCEVOLUTION_LIBS=`pwd`/src/syncevo/libsyncevolution.la
+ AC_SUBST(SYNCEVOLUTION_CFLAGS)
+ AC_SUBST(SYNCEVOLUTION_LIBS)
+
+ Backends does not have their own top-level configure scripts, so usage of
+ absolute path have to be checked. For now this is worked around
+ in generated backends.am. Also, for relative path not $(srcdir) should be used
+ but $(builddir).
+
+
+- Review CLEANFILES, DISTCLEANFILES, MAINTAINERCLEANFILES and MOSTLYCLEANFILES.
+ That is - check which files should be assigned to which of CLEAN variables.
+
+
+- Check why distcheck outputs:
+ ==================
+ All 0 tests passed
+ ==================
+
+ There should have been at least one test being run. The same behavior exists
+ in old build system.
+
+
+- Check why there are so many failed tests when running `make check' explicitly.
+ The same number of failures exists in old build system:
+
+ Run: 583 Failure total: 528 Failures: 206 Errors: 322
+
+
+- Tidy up configure.ac and some .am files.
+
+
+- Maybe write scripts generating configs_xml.am, templates.am and profiles.am.
+
+
+QUESTIONS:
+
+
+- None.
+
+
+PERSISTENT:
+
+
+- Hunt for common variables clobbering.
+
+
+- Silence more verbose output if found.
+
+
+NITPICKS:
+
+
+- Check if SyncEvolutionXML.c should always be recreated, patches always checked
+ and test-client always relinked.
+
+
+- Check if /etc/sync and /lib/sync really have to be created, even if they are
+ going to be empty after install (this is probably some buteo stuff).
+
+
+- Maybe do not create /share/man/man1 directory if we do not put there anything.
+
+
+- If backends are static libraries then do not create /lib/syncevolution,
+ because nothing is put here.
+
+
+- Change $(foo) to @foo@ for all variables substituted by configure script. This
+ might be useful when looking for actual value of variable appearing out of
+ nowhere in .am file. Maybe make also all configure variables UPPER_CASE
+ and all local Automake variables lower_case.
+
+
+- Lower autoreconf's warnings level later. Namely - don't warn about some
+ portability issues. The warnings about obsolete stuff should rather remain.
+ For now only some glib macros are using obsolete features.
+
+
+- Should stamp files be marked as intermediate or rather as secondary files?
+
+
+- Check why 'copying selected object files to avoid basename conflicts...' is
+ displayed between linking src/dbus/server/libsyncevodbusserver.la
+ and compiling src/gdbus/src_gdbus_libgdbussyncevo_la-debug.lo. This is
+ probably harmless.
+
+
+TRACKING:
+
+
+- Handle nobase prefixes. Link to track:
+ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9289
+
+
+- Explanation why make -jX used to fail:
+ It failed because usually Automake generates dependencies of a library/program
+ by looking at its _LIBADD/_LDADD variable. But this generation doesn't work
+ correctly when _LIBADD/_LDADD variable has AC_SUBSTed variable - automake then
+ just discards them and resulting _DEPENDENCIES variable does not contain them.
+ As a workaround _DEPENDENCIES variable have to be written explicitly. Link to
+ track:
+ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9320
diff --git a/INSTALL b/INSTALL
index 7217fd04..7d1c323b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,49 +1,80 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
Basic Installation
==================
- These are generic installation instructions. Specific installation
-instructions for Sync4jEvolution are in the README file.
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
-The simplest way to compile this package is:
+ The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
+ `./configure' to configure the package for your system.
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
- the package.
+ the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
@@ -52,62 +83,119 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
+own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
- If you have to use a `make' that does not supports the `VPATH'
-variable, you have to compile the package for one architecture at a time
-in the source code directory. After you have installed the package for
-one architecture, use `make distclean' before reconfiguring for another
-architecture.
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
Installation Names
==================
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
+options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-Optional Features
-=================
-
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
@@ -120,25 +208,75 @@ find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
Specifying the System Type
==========================
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
CPU-COMPANY-SYSTEM
-See the file `config.sub' for the possible values of each field. If
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
+need to know the machine type.
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
Sharing Defaults
================
@@ -151,19 +289,55 @@ default values for variables like `CC', `cache_file', and `prefix'.
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
-Operation Controls
+Defining Variables
==================
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
`configure' recognizes the following options to control how it
operates.
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
`--cache-file=FILE'
- Use and save the results of the tests in FILE instead of
- `./config.cache'. Set FILE to `/dev/null' to disable caching, for
- debugging `configure'.
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
-`--help'
- Print a summary of the options to `configure', and exit.
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
@@ -176,8 +350,16 @@ operates.
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
-`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.am b/Makefile.am
index dbfd322d..5de1e225 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,38 +1,56 @@
+include $(top_srcdir)/setup-variables.am
+include $(top_srcdir)/autotroll.am
+include $(top_srcdir)/build/build.am
+
+AUTOMAKE_OPTIONS = subdir-objects
+
## Process this file with automake to produce Makefile.in
-ACLOCAL_AMFLAGS = -I m4 -I m4-repo
+ACLOCAL_AMFLAGS = -I m4 -I m4-repo ${ACLOCAL_FLAGS}
+
+if COND_CORE
+SUBDIRS += $(SYNTHESIS_SUBDIR)
+else
+SUBDIRS += $(SYNTHESIS_SUBDIR_INCLUDES)
+endif
+
+SUBDIRS += .
+
+disted_docs =
+distbin_docs =
man_MANS =
-dist_doc_DATA =
-SUBDIRS = src
+include src/src.am
if COND_CORE
-SUBDIRS += po test
-dist_doc_DATA += README NEWS COPYING $(TEST_README_FILES) test/syncevo-http-server-logging.conf
+include test/test.am
+SUBDIRS += po
+disted_docs += README NEWS COPYING $(TEST_README_FILES) test/syncevo-http-server-logging.conf
+distbin_docs += $(disted_docs)
+dist_doc_DATA += $(disted_docs)
if COND_HTML_README
-dist_doc_DATA += README.html
+distbin_docs += README.html
+# do not distribute in tarball.
+doc_DATA += README.html
endif
if COND_MAN_PAGES
man_MANS += syncevolution.1
endif
endif
-DIST_SUBDIRS = src po test
+DIST_SUBDIRS += po
-EXTRA_DIST = \
- HACKING \
- LICENSE.txt \
- LICENSE.LGPL-21 \
- README.rst \
- description \
- configure-pre.in \
- configure-post.in \
- gen-autotools.sh \
- autogen.sh \
- Doxyfile
+dist_noinst_DATA += \
+ HACKING \
+ LICENSE.txt \
+ LICENSE.LGPL-21 \
+ README.rst \
+ description \
+ autogen.sh \
+ Doxyfile \
+ po/LINGUAS.README
-MAINTAINERCLEANFILES = Makefile.in config.h.in config.guess config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
-CLEANFILES =
+MAINTAINERCLEANFILES += Makefile.in config.h.in config.guess config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
-TEST_README_FILES = $(wildcard $(srcdir)/test/README.*)
+TEST_README_FILES = $(wildcard $(top_srcdir)/test/README.*)
DEV_FILE_PATTERN = $(1)$(2)/etc $(1)$(2)/include $(1)$(2)/lib/*.so $(1)$(2)/lib/*.a $(1)$(2)/lib/*.la $(1)$(2)/lib/*/*.la $(1)$(2)/lib/pkgconfig
@@ -40,7 +58,7 @@ DEV_FILE_PATTERN = $(1)$(2)/etc $(1)$(2)/include $(1)$(2)/lib/*.so $(1)$(2)/lib/
if COND_DBUS
# when building with D-Bus, we have no choice: the service has to go into /usr
# in order to be found
-distbin : $(dist_doc_DATA) INSTALL-tar-gz all
+distbin : $(distbin_docs) INSTALL-tar-gz all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
@ [ "$(prefix)" = "/usr" ] || (echo "please reconfigure with --prefix=/usr"; exit 1 )
rm -rf $(distdir)
@@ -56,11 +74,11 @@ distbin : $(dist_doc_DATA) INSTALL-tar-gz all
else
# without D-Bus, we can simply create an archive with a bin directory
# and everything works
-distbin : $(dist_doc_DATA) all
+distbin : $(distbin_docs) all
@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
rm -rf $(distdir)
$(MAKE) prefix=`pwd`/$(distdir) install
- echo removing developer files and empty directories
+ @echo removing developer files and empty directories
rm -rf $(call DEV_FILE_PATTERN,$(distdir),/)
for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
cp $(filter-out all, $+) $(distdir)
@@ -73,10 +91,10 @@ iphone : SyncEvolution.plist
IPHONE_FILENAME = syncevolution-$(VERSION)-iphone.zip
SyncEvolution.plist : SyncEvolution.plist.in $(IPHONE_FILENAME)
- sed -e 's/__FILENAME__/$(IPHONE_FILENAME)/' \
- -e 's/__VERSION__/$(VERSION)/' \
- -e 's/__SIZE__/$(shell ls -l $(IPHONE_FILENAME) | sed -e 's/ */ /g' | cut -d ' ' -f 5)/' \
- $< >$@
+ $(AM_V_GEN)sed -e 's/__FILENAME__/$(IPHONE_FILENAME)/' \
+ -e 's/__VERSION__/$(VERSION)/' \
+ -e 's/__SIZE__/$(shell ls -l $(IPHONE_FILENAME) | sed -e 's/ */ /g' | cut -d ' ' -f 5)/' \
+ $< >$@
$(IPHONE_FILENAME) : all
rm -rf syncevolution-iphone $@
@@ -147,7 +165,7 @@ deb rpm : dist/$(distdir) dist/debian/control description-pak
cp -r `pwd`/$</usr/* /usr
if [ $@ = "rpm" ]; then cp /usr/src/rpm/RPMS/*/${PKGNAME}-${VERSION}-2.*.rpm .; fi
-.PHONY: dist/$(distdir) clean_dist
+all_phonies += dist/$(distdir) clean_dist
dist/$(distdir): all
rm -rf $@
$(MAKE) install DESTDIR=`pwd`/$@
@@ -159,7 +177,7 @@ clean_dist:
# required by dpkg-shlibdeps
dist/debian/control:
- mkdir -p ${@D}
+ mkdir -p ${dir $@}
touch $@
# for checkinstall
@@ -169,7 +187,7 @@ description-pak : description
# Build "html" inside the build dir, using source files
# from the SyncEvolution source directory and (if built)
# the installed client-api.build directory.
-.PHONY: doc clean-html
+all_phonies += doc clean-html
doc:
rm -rf html
export VERSION="SyncEvolution $(VERSION)"; \
@@ -182,35 +200,21 @@ clean-local: clean-html
clean-html:
rm -rf html
-# configure.in is updated
-# by gen-autotools.sh. This scripts is run
-# each time "make all" (which depends on "Makefile")
-# runs; this is easier than trying to anticipated
-# when the script would produce different output.
-# The no-op "true" seem to be necessary for make to
-# re-check the configure.in time stamps.
-$(srcdir)/configure.in: check-autotools
- @ true
-
-# Rebuilding the autotools files should never be necessary
-# with source tar balls. Some parts of it depend on "git describe".
-# So avoid it when there is no .git repo.
-.PHONY: check-autotools
-check-autotools:
- @ cd $(srcdir) && ( [ ! -e .git ] || ./gen-autotools.sh )
-
-dist-hook:
+all_dist_hooks += dot_dist_hook
+dot_dist_hook:
@if test -d "$(srcdir)/.git"; \
then \
- echo Creating ChangeLog && \
- ( cd "$(top_srcdir)" && \
- echo '# Generated by configure. Do no edit.'; echo; \
- $(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl ) > ChangeLog.tmp \
- && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
- || ( rm -f ChangeLog.tmp ; \
- echo Failed to generate ChangeLog >&2 ); \
+ printf '%s' 'Creating ChangeLog...' && \
+ ( cd "$(top_srcdir)" && \
+ printf '%s\n\n' '# Generated by configure. Do not edit.'; \
+ $(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl ) > ChangeLog.tmp && \
+ ( mv -f ChangeLog.tmp $(top_distdir)/ChangeLog && \
+ printf '%s\n' ' done.' ) || \
+ ( rm -f ChangeLog.tmp ; \
+ printf '%s\n' ' failed.'; \
+ echo Failed to generate ChangeLog >&2 ); \
else \
- echo A git checkout is required to generate a ChangeLog >&2; \
+ echo 'A git checkout is required to generate a ChangeLog.' >&2; \
fi
if ENABLE_EVOLUTION_COMPATIBILITY
@@ -219,16 +223,18 @@ if ENABLE_EVOLUTION_COMPATIBILITY
# problematic libraries and symbols
#
# ical_strdup is an exception because it is in SyncEvolution.
-installcheck-local:
- for i in `find $(DESTDIR)/$(libdir)/syncevolution $(DESTDIR)/$(libdir)/libsyncevo* $(DESTDIR)/$(libdir)/libsynthesis* -name *.so` $(DESTDIR)/$(bindir)/syncevolution; do \
- if objdump -T -C $$i | grep -v :: | grep '\*UND\*' | sort | grep -v -w ical_strdup | grep -e ical -e " e_"; then \
- echo "$$i should not depend on EDS, libical or libbluetooth"; \
- exit 1; \
- fi; \
- if ldd $$i | grep -e libecal -e libebook -e libedata -e libical -e libbluetooth; then \
- echo "$$i should not be linked against EDS, libical or libbluetooth"; \
- exit 1; \
- fi; \
+all_local_installchecks += toplevel_so_check
+toplevel_so_check:
+ for i in `find $(DESTDIR)/$(libdir)/syncevolution $(DESTDIR)/$(libdir)/libsyncevo* $(DESTDIR)/$(libdir)/libsynthesis* -name *.so` $(DESTDIR)/$(bindir)/syncevolution; \
+ do \
+ if objdump -T -C $$i | grep -v :: | grep '\*UND\*' | sort | grep -v -w ical_strdup | grep -e ical -e " e_"; then \
+ echo "$$i should not depend on EDS, libical or libbluetooth"; \
+ exit 1; \
+ fi; \
+ if ldd $$i | grep -e libecal -e libebook -e libedata -e libical -e libbluetooth; then \
+ echo "$$i should not be linked against EDS, libical or libbluetooth"; \
+ exit 1; \
+ fi; \
done
endif
@@ -237,17 +243,32 @@ PATCH_README = -e "s/^:Version: .*/:Version: $(VERSION)/" -e "s/:Date: .*/:Date:
# produce man pages
syncevolution.1: README.rst
- sed $(PATCH_README) $< | $(RST2MAN) --exit-status=3 - >$@
+ $(AM_V_GEN)sed $(PATCH_README) $< | $(RST2MAN) --exit-status=3 - >$@
CLEANFILES += syncevolution.1
# README is the traditional name in the distribution,
# continue using it instead of README.rst.
README: README.rst
- sed $(PATCH_README) $< >$@
+ $(AM_V_GEN)sed $(PATCH_README) $< >$@
CLEANFILES += README
# The README.html is also used on syncevolution.org as "Usage" page,
# therefore we must use <h3> headers and lower to fit into the page.
README.html: README.rst
- sed $(PATCH_README) $< | $(RST2HTML) --initial-header-level=3 --exit-status=3 - >$@
+ $(AM_V_GEN)sed $(PATCH_README) $< | $(RST2HTML) --initial-header-level=3 --exit-status=3 - >$@
CLEANFILES += README.html
+
+.PHONY: $(all_phonies) ;
+
+installcheck-local: $(all_local_installchecks) ;
+
+dist-hook: $(all_dist_hooks)
+
+# Force sequential installation. This is a workaround for relinking failures
+# during concurrent distcheck (a backed was relinked against not yet installed
+# libsyncevolution.la).
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-data-am
+
+.DELETE_ON_ERROR:
diff --git a/README.packagers b/README.packagers
index 8a924b7a..3128aa88 100644
--- a/README.packagers
+++ b/README.packagers
@@ -22,3 +22,6 @@ backends there are more subtle dependencies:
http://lists.manyfish.co.uk/pipermail/neon/2010-November/001294.html)
- ensure that one of the following commands is available at runtime:
adnshost, host, nslookup
+- as of SyncEvolution >= 1.3 rst2html tool should be made as a build
+ requirement, because README.html is optionally generated during build instead
+ of being distributed.
diff --git a/autogen.sh b/autogen.sh
index d04dfec6..15e80211 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,19 +9,23 @@ rm -rf aclocal.m4 m4 autom4te.cache config.guess config.sub config.h.in configur
# intltoolize fails to copy its macros unless m4 exits
mkdir m4
-env GEN_AUTOTOOLS_SET_VERSION=1 sh ./gen-autotools.sh
+#env GEN_AUTOTOOLS_SET_VERSION=1 sh ./gen-autotools.sh
-libtoolize -c
glib-gettextize --force --copy
intltoolize --force --copy --automake
-aclocal -I m4 -I m4-repo
-autoheader
-automake -a -c -Wno-portability
-autoconf
+autoreconf -vifW all -W no-portability -W no-obsolete
+
+#libtoolize -c
+#glib-gettextize --force --copy
+#intltoolize --force --copy --automake
+#aclocal -I m4 -I m4-repo
+#autoheader
+#automake -a -c -Wno-portability
+#autoconf
# This hack is required for the autotools on Debian Etch.
# Without it, configure expects a po/Makefile where
# only po/Makefile.in is available. This patch fixes
# configure so that it uses po/Makefile.in, like more
# recent macros do.
-perl -pi -e 's;test ! -f "po/Makefile";test ! -f "po/Makefile.in";; s;mv "po/Makefile" "po/Makefile.tmp";cp "po/Makefile.in" "po/Makefile.tmp";;' configure
+#perl -pi -e 's;test ! -f "po/Makefile";test ! -f "po/Makefile.in";; s;mv "po/Makefile" "po/Makefile.tmp";cp "po/Makefile.in" "po/Makefile.tmp";;' configure
diff --git a/m4-repo/autotroll.mk b/autotroll.am
index 45d6cf36..b3bdce92 100644
--- a/m4-repo/autotroll.mk
+++ b/autotroll.am
@@ -39,70 +39,63 @@
# See autotroll.m4 :)
-
-SUFFIXES = .moc.cpp .moc.cc .moc.cxx .moc.C .h .hh .hpp \
- .ui .ui.h .ui.hh .ui.hpp \
- .qrc .qrc.cpp .qrc.cc .qrc.cxx .qrc.C
-
# --- #
# MOC #
# --- #
-.hpp.moc.cpp:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.hh.moc.cpp:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.h.moc.cpp:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-
-.hpp.moc.cc:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.hh.moc.cc:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.h.moc.cc:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-
-.hpp.moc.cxx:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.hh.moc.cxx:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.h.moc.cxx:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-
-.hpp.moc.C:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.hh.moc.C:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
-.h.moc.C:
- $(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cpp: %.hpp
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cpp: %.hh
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cpp: %.h
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+
+%moc.cc: %.hpp
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cc: %.hh
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cc: %.h
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+
+%.moc.cxx: %.hpp
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cxx: %.hh
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.cxx: %.h
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+
+%.moc.C: %.hpp
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.C: %.hh
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
+%.moc.C: %.h
+ $(AM_V_GEN)$(MOC) $(QT_CPPFLAGS) $(EXTRA_CPPFLAGS) $< -o $@
# --- #
# UIC #
# --- #
-.ui.ui.hpp:
- $(UIC) $< -o $@
+%.ui.hpp: %.ui
+ $(AM_V_GEN)$(UIC) $< -o $@
-.ui.ui.hh:
- $(UIC) $< -o $@
+%.ui.hh: %.ui
+ $(AM_V_GEN)$(UIC) $< -o $@
-.ui.ui.h:
- $(UIC) $< -o $@
+%.ui.h: %.ui
+ $(AM_V_GEN)$(UIC) $< -o $@
# --- #
# RCC #
# --- #
-.qrc.qrc.cpp:
- $(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
-
-.qrc.qrc.cc:
- $(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
+%.qrc.cpp: %.qrc
+ $(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
-.qrc.qrc.cxx:
- $(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
+%.qrc.cc: %.qrc
+ $(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
-.qrc.qrc.C:
- $(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
+%.qrc.cxx: %.qrc
+ $(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
-DISTCLEANFILES = $(BUILT_SOURCES)
+%.qrc.C: %.qrc
+ $(AM_V_GEN)$(RCC) -name `echo "$<" | sed 's|^.*/\(.*\)\.qrc$$|\1|'` $< -o $@
diff --git a/build/build.am b/build/build.am
new file mode 100644
index 00000000..5f0bdce5
--- /dev/null
+++ b/build/build.am
@@ -0,0 +1 @@
+dist_noinst_SCRIPTS += build/gen-git-version.sh
diff --git a/build/gen-backends-am.sh b/build/gen-backends-am.sh
new file mode 100755
index 00000000..f4fbb73a
--- /dev/null
+++ b/build/gen-backends-am.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+amfile='src/backends/backends.am'
+tmpfile="$amfile.$$"
+
+rm -f "$tmpfile"
+touch "$tmpfile"
+
+BACKENDS="`echo src/backends/*/configure-sub.in | sed -e 's%/configure-sub\.in%%g' | sort`"
+BACKEND_REGISTRIES="`echo src/backends/*/*Register.cpp | sort`"
+
+tf()
+{
+ echo "$1" >>"$tmpfile"
+}
+
+tf '# This is a stupid workaround for an absolute path in SYNCEVOLUTION_LIBS.'
+tf '# See AUTOTOOLS-TODO for details.'
+tf '@SYNCEVOLUTION_LIBS@: src/syncevo/libsyncevolution.la ; @true'
+tf ''
+tf "BACKENDS = $BACKENDS"
+tf ''
+tf "BACKEND_REGISTRIES = $BACKEND_REGISTRIES"
+tf ''
+tf '# backend includes'
+
+for backend in $BACKENDS
+do
+ name=`echo "$backend" | sed -e 's%src/backends/%%'`
+ tf "include \$(top_srcdir)/$backend/$name.am"
+done
+
+if test ! -f "$amfile" || ! cmp -s "$amfile" "$tmpfile"
+then
+ mv "$tmpfile" "$amfile"
+else
+ rm -f "$tmpfile"
+fi
diff --git a/build/gen-backends.sh b/build/gen-backends.sh
new file mode 100755
index 00000000..b7d10955
--- /dev/null
+++ b/build/gen-backends.sh
@@ -0,0 +1,24 @@
+#! /bin/sh
+#
+# This script prints all configure-sub.in in src/backends
+# directory to standard output. This is meant to be used
+# from m4_esyscmd inside configure.ac.
+#
+# The motivation for this non-standard approach was that
+# it allows adding new backends without touching core
+# files, which should have simplified the development of
+# out-of-tree backends. Now git pretty much removes
+# the need for such tricks, but it's still around.
+
+tmpfile="configure.in.$$"
+rm -f "$tmpfile"
+
+for sub in src/backends/*/configure-sub.in
+do
+ echo "# vvvvvvvvvvvvvv $sub vvvvvvvvvvvvvv" >>"$tmpfile"
+ cat "$sub" >>"$tmpfile"
+ echo "# ^^^^^^^^^^^^^^ $sub ^^^^^^^^^^^^^^" >>"$tmpfile"
+ echo >>"$tmpfile"
+done
+cat "$tmpfile"
+rm -f "$tmpfile"
diff --git a/build/gen-git-version.sh b/build/gen-git-version.sh
new file mode 100755
index 00000000..bd5c8d5e
--- /dev/null
+++ b/build/gen-git-version.sh
@@ -0,0 +1,105 @@
+#! /bin/sh
+
+# This scripts takes current version as a parameter, generates the version
+# and prints it to standard output - this way it is usable with m4_esyscmd,
+# which can be used inside AC_INIT. The script will print the passed version if
+# the following checks pass:
+# - SyncEvolution source is clean (git status reports
+# no "modified" files or "untracked" files, or the source
+# is not in git at all)
+# - the source is tagged with the version of SyncEvolution
+# (git describe --tags HEAD reports something which matches,
+# for example syncevolution-1-0-beta-2a for 1.0beta2a)
+# - same for libsynthesis, if the SYNTHESISSRC env variable
+# is set
+#
+# If these tests fail, the version is extended:
+# +<yyyymmdd>+SE+<status>+SYSYNC+<status>
+# <yyyymmdd> = date
+# <status> = <hash>[+unclean]
+# <hash> = shortened hash from describe (for example, 1040ffd)
+# +unclean = source was dirty
+
+set -e
+
+version="$1"
+checksource ()
+{
+ dir=$1
+ force=$2
+ dirty=
+ if [ ! -d $dir/.git ]; then
+ return
+ fi
+
+ cur=`pwd`
+ cd $dir
+
+ if git status | grep -e "modified:" -e "Untracked files:" -q; then
+ dirty='+unclean'
+ fi
+ describe=`git describe --tags`
+ hash=`cat .git/HEAD | sed -e 's/ref: //'`
+ if [ "`echo $hash | sed -e 's/[0-9a-fA-F]//g'`" ] ; then
+ # contains other characters than simple hex, probably a reference:
+ # convert to abbreviated hash
+ hash=`git show-ref --abbrev --hash --verify $hash`
+ else
+ # already a hash, abbreviate
+ hash=`echo $hash | sed -e 's/\(......\).*/\1/'`
+ fi
+ # detect -<number of changes>-g<hash> suffix added when tag is older than HEAD
+ if perl -e "exit !('$describe' =~ m/-[0-9]+-[0-9a-g]{8}\$/);"; then
+ # remove suffix to get tag (doesn't matter if we do not pick
+ # the most recent one)
+ exact=
+ tag=`echo $describe | sed -e 's/-[0123456789]*-g.*//'`
+ else
+ # there is at least one tag matching HEAD;
+ # pick the most recent one (based on lexical sorting)
+ exact=1
+ tag=`git show-ref --tags | grep $hash | sort | tail -1 | sed -e 's;.*refs/tags/;;'`
+ fi
+ simpletag=$tag
+ # Hyphens between numbers in the tag are dots in the version
+ # and all other hyphens can be removed.
+ while true; do
+ tmp=`echo $simpletag | sed -e 's/\([0123456789]\)-\([0123456789]\)/\1.\2/'`
+ if [ $tmp = $simpletag ]; then
+ break
+ else
+ simpletag=$tmp
+ fi
+ done
+ simpletag=`echo $simpletag | sed -e 's/-//g'`
+ if [ "$dirty" ] || [ "$force" ]; then
+ # previous check failed, always print hash
+ echo $hash$dirty
+ elif [ "$exact" ] &&
+ echo $simpletag | grep -q "syncevolution${version}\$"; then
+ true
+ else
+ echo $hash$dirty
+ fi
+ cd $cur
+}
+
+versionsuffix=''
+syncevo=`checksource .`
+if [ "$SYNTHESISSRC" ]; then
+ sysync=`checksource $SYNTHESISSRC $syncevo`
+fi
+# run check again, to get hash when only libsynthesis failed
+syncevo=`checksource . $sysync`
+if [ "$syncevo" ]; then
+ versionsuffix="+SE+$syncevo"
+fi
+if [ "$sysync" ]; then
+ versionsuffix="$versionsuffix+SYSYNC+$sysync"
+fi
+if [ "$versionsuffix" ]; then
+ versionsuffix="+`date +%Y%m%d`$versionsuffix"
+fi
+
+# using printf, because echo -n is not portable. hopefully printf is.
+printf %s "$version$versionsuffix"
diff --git a/build/gen-linguas.sh b/build/gen-linguas.sh
new file mode 100755
index 00000000..b8e3ceb9
--- /dev/null
+++ b/build/gen-linguas.sh
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+
+lings_new="LINGUAS.new.$$"
+lings="LINGUAS"
+
+# create LINGUAS file: every .po is included
+cd po
+ls -1 *.po | sort -u | sed -e 's/.po$//' >"$lings_new"
+
+if test -f "$lings" && cmp -s "$lings" "$lings_new"
+then
+ rm "$lings_new"
+else
+ mv "$lings_new" "$lings"
+fi
diff --git a/configure-post.in b/configure-post.in
deleted file mode 100644
index e7d71c53..00000000
--- a/configure-post.in
+++ /dev/null
@@ -1,194 +0,0 @@
-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 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)
- PKG_CHECK_MODULES(GIO, "gio-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
-
-# Check for Qt if some backend needs it.
-if test "$need_qt_modules"; then
- AT_WITH_QT([-gui $need_qt_modules],
- [$qt_config],
- [$qt_misc])
-fi
-
-# 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
- PKG_CHECK_MODULES(GLIB216, [glib-2.0 >= 2.16],
- [AC_DEFINE(USE_SHA256, 1, [choose implementation of SHA-256])
- have_sha="glib"],
- [true])
-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"],
- [true])
-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])
- # don't link against libs wrapped by eds_abi_wrapper (no longer limited to EDS alone...)
- ECAL_LIBS=
- EBOOK_LIBS=
- EPACKAGE_LIBS=
- BLUEZ_LIBS=
-fi
-AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" = "yes"])
-PKG_CHECK_MODULES(LIBICAL_AVAILABLE,
- libical >= 0.43,
- AC_DEFINE(HAVE_LIBICAL_R, 1, [have recent enough libical with _r variants]),
- pass)
-
-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)
-
-# for ActiveSync backend
-syncevo_backenddir='$(libdir)'/syncevolution/backends
-AC_SUBST(syncevo_backenddir)
-
-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_ARG_ENABLE(dbus-timeout-hack,
- AS_HELP_STRING([--enable-dbus-timeout-hack],
- [Enables code which overrides the default timeout in dbus_connection_send_with_reply() so that the method call never times out. Needed for libecal/ebook >= 2.30, so enabled by default if either of these is enabled.]),
- [enable_dbus_timeout_hack=$enableval],
- [if test $enable_ebook = "yes" || test $enable_ecal = "yes"; then
- enable_dbus_timeout_hack="yes"
- fi])
-if test "$enable_dbus_timeout_hack" = "yes"; then
- AC_DEFINE(ENABLE_DBUS_TIMEOUT_HACK, 1, [overrides the default D-Bus timeout so that synchronous calls never time out])
-fi
-
-# Avoid hard-coding paths in backends. These names are chosen so
-# that a backend can alternatively use its own top-level configure
-# with PKG_CHECK_MODULES(SYNCEVOLUTION, "syncevolution") to set them.
-# need absolute path, use pwd instead of relative $srcdir
-SYNCEVOLUTION_CFLAGS=-I`cd $srcdir && pwd`/src
-SYNCEVOLUTION_LIBS=`pwd`/src/syncevo/libsyncevolution.la
-AC_SUBST(SYNCEVOLUTION_CFLAGS)
-AC_SUBST(SYNCEVOLUTION_LIBS)
-
-AC_CONFIG_FILES(
- Makefile
- src/dbus/interfaces/Makefile
- src/gdbus/Makefile
- src/dbus/Makefile
- src/dbus/glib/Makefile
- src/dbus/server/Makefile
- src/Makefile
- src/syncevo/Makefile
- src/syncevo/syncevolution.pc
- src/syncevo/configs/Makefile
- src/synthesis-includes/Makefile
- src/gtk-ui/Makefile
- po/Makefile.in
- test/Makefile
- src/dbus/glib/syncevo-dbus.pc)
-
-AC_OUTPUT
-
-echo
-echo CONFIGURATION SUMMARY
-echo "Core SyncEvolution: $enable_core"
-for backend in $BACKENDS; do
- eval echo $backend: \${enable_${backend}}
-done
-echo "DBus service: $enable_dbus_service"
-echo "GNOME keyring: $enable_gnome_keyring"
-echo "UI (DBus client): $enable_gui"
-echo "Bluetooth transport: $have_bluetooth"
-echo "GNOME Bluetooth panel plugin: $enable_gnome_bluetooth_panel"
-echo "SHA-256: $have_sha"
-echo "API documentation: $enable_doc"
-echo "D-Bus Timeout Hack: $enable_dbus_timeout_hack"
-echo
diff --git a/configure-pre.in b/configure.ac
index 4f661285..677ed308 100644
--- a/configure-pre.in
+++ b/configure.ac
@@ -8,17 +8,20 @@ dnl Invoke autogen.sh to produce a configure script.
#
# Starting with the 1.1 release cycle, the rpm-style
# .99 pseudo-version number is used to mark a pre-release.
-AC_INIT([syncevolution], [1.1.99.6])
+AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.1.99.6])])
# STABLE_VERSION=1.0.1+
AC_SUBST(STABLE_VERSION)
+# Generate some files.
+SE_GENERATE_AM_FILES
+SE_GENERATE_LINGUAS
+
# Default value for --enable/disable-release-mode.
# Determined by gen-autotools.sh based on versioning.
# Official, stable releases enable it, pre-releases
# disable it.
#
-# SyncEvolution >= 1.1.99.5: release mode by default
-define([STABLE_RELEASE], [yes])
+SE_CHECK_FOR_STABLE_RELEASE
# Minimum version of libsynthesis as defined in its
# configure script and thus .pc files:
@@ -26,7 +29,7 @@ define([SYNTHESIS_MIN_VERSION], [3.4.0.16.1])
# Line above is patched by gen-autotools.sh. Handle
# both "yes" and "no".
-define([STABLE_RELEASE_HELP], ifelse(STABLE_RELEASE,yes,--disable-release-mode,--enable-release-mode))
+m4_define([STABLE_RELEASE_HELP], m4_if(STABLE_RELEASE,[yes],[--disable-release-mode],[--enable-release-mode]))
AC_ARG_ENABLE(release-mode,
AS_HELP_STRING([STABLE_RELEASE_HELP],
@@ -41,21 +44,28 @@ if test "$enable_release_mode" = "yes"; then
AC_DEFINE(SYNCEVOLUTION_STABLE_RELEASE, 1, [binary is meant for end-users])
fi
-AM_INIT_AUTOMAKE([tar-ustar])
+AM_INIT_AUTOMAKE([1.11.1 tar-ustar silent-rules subdir-objects -Wno-portability])
+
+AM_PROG_CC_C_O
+
AM_MAINTAINER_MODE([enable]) # needed for nightly builds where reconfiguration fails under certain chroots
AC_CONFIG_MACRO_DIR([m4])
define([SYNTHESISSRC_REPO], [])
dnl Specify git revisions/branches without prefix, i.e., without 'origin'.
dnl We'll sort that out below.
define([SYNTHESISSRC_REVISION], [syncevolution-0.9])
-AM_CONFIG_HEADER(config.h)
-AC_LIBTOOL_DLOPEN
+AC_CONFIG_HEADERS(config.h)
+LT_INIT([dlopen])
dnl check for programs.
AC_PROG_CXX
-AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
+DK_ARG_ENABLE_WARNINGS([SYNCEVO_WFLAGS],
+ [-Wall],
+ [-pedantic -Wall -Wextra],
+ [G GDK GDK_PIXBUF CAIRO PANGO GTK])
+
dnl default device type (see AC_DEFINE below)
DEVICE_TYPE=workstation
@@ -84,7 +94,7 @@ AC_ARG_WITH(syncml-engines,
case $SYNCML_ENGINES in both|client) AC_DEFINE(ENABLE_SYNCML_CLIENT, 1, [SyncML client support available]);; esac
case $SYNCML_ENGINES in both|server) AC_DEFINE(ENABLE_SYNCML_SERVER, 1, [SyncML server support available]);; esac
-case $SYNCML_ENGINES in both|server|client) true;; *) AC_ERROR([Invalid value for --with-syncml-engines: $SYNCML_ENGINES]);; esac
+case $SYNCML_ENGINES in both|server|client) true;; *) AC_MSG_ERROR([Invalid value for --with-syncml-engines: $SYNCML_ENGINES]);; esac
AC_ARG_WITH(synthesis-username,
AS_HELP_STRING([--with-synthesis-username=<svn username>],
@@ -136,10 +146,10 @@ AC_ARG_ENABLE(evolution-compatibility,
[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]),
enable_evolution_compatibility="$enableval", enable_evolution_compatibility="no")
-AC_ARG_ENABLE(developer-mode,
- AC_HELP_STRING([--enable-developer-mode],
- [The dynamic loadble backend libraries is loaded from current build directory instead of the standard library path]),
- enable_developer_mode="$enableval", enable_developer_mode="no")
+AC_ARG_ENABLE(developer-mode,
+ AS_HELP_STRING([--enable-developer-mode],
+ [The dynamic loadble backend libraries is loaded from current build directory instead of the standard library path]),
+ enable_developer_mode="$enableval", enable_developer_mode="no")
# Maemo hacks:
# - wrap e_book_from_string() to fix invalid parameter
@@ -154,18 +164,24 @@ AC_SUBST(MODIFY_SYNCCOMPARE)
AC_CHECK_HEADERS(signal.h dlfcn.h)
+# cppunit-config is used even when both unit tests and integration tests are disabled.
+AC_PATH_PROG([CPPUNIT_CONFIG], [cppunit-config], [no])
+
+test "x$CPPUNIT_CONFIG" != 'xno' || AC_MSG_ERROR("cppunit-config not found.")
+
# cppunit needed?
-if test $enable_unit_tests = "yes" || test $enable_integration_tests = yes; then
- CPPUNIT_CXXFLAGS=`cppunit-config --cflags` || AC_MSG_ERROR("cppunit-config --cflags failed - is it installed?")
- CPPUNIT_LDFLAGS=`cppunit-config --libs` || AC_MSG_ERROR("cppunit-config --libs failed - is it installed?")
-fi
+#if test "x$enable_unit_tests" = 'xyes' || test "x$enable_integration_tests" = 'xyes'
+#then
+ CPPUNIT_CXXFLAGS=`$CPPUNIT_CONFIG --cflags`
+ CPPUNIT_LDFLAGS=`$CPPUNIT_CONFIG --libs`
+#fi
AC_SUBST(CPPUNIT_CXXFLAGS)
AC_SUBST(CPPUNIT_LDFLAGS)
-if test "$enable_unit_tests" = "yes"; then
+if test "x$enable_unit_tests" = 'xyes'; then
AC_DEFINE(ENABLE_UNIT_TESTS, 1, [enable unit tests inside the library's source code])
fi
-if test "$enable_integration_tests" = "yes"; then
+if test "x$enable_integration_tests" = 'xyes'; then
AC_DEFINE(ENABLE_INTEGRATION_TESTS, 1, [enable integration tests inside the final library])
fi
if test "$enable_buteo_tests" = "yes"; then
@@ -173,7 +189,7 @@ if test "$enable_buteo_tests" = "yes"; then
need_qt_modules="$need_qt_modules dbus xml"
AC_PATH_PROG(SQLITE3, sqlite3)
if test -z "$SQLITE3"; then
- AC_ERROR([sqlite3 not found, is required for buteo testing])
+ AC_MSG_ERROR([sqlite3 not found, is required for buteo testing])
fi
fi
AM_CONDITIONAL([ENABLE_UNIT_TESTS], [test "$enable_unit_tests" = "yes"])
@@ -241,7 +257,7 @@ elif test "$have_libcurl" = "yes"; then
fi
AC_ARG_ENABLE(libcurl,
- AC_HELP_STRING([--enable-libcurl],
+ AS_HELP_STRING([--enable-libcurl],
[enable libcurl as transport layer]),
[ if test "$enableval" = "yes"; then
test "$have_libcurl" = "yes" || AC_MSG_ERROR([libcurl not found])
@@ -260,7 +276,7 @@ AC_ARG_ENABLE(libcurl,
fi ])
AC_ARG_ENABLE(libsoup,
- AC_HELP_STRING([--enable-libsoup],
+ AS_HELP_STRING([--enable-libsoup],
[enable libsoup as transport layer]),
[ if test "$enableval" = "yes"; then
test "$have_libsoup" = "yes" || AC_MSG_ERROR([libsoup not found])
@@ -283,7 +299,7 @@ case "$TRANSPORT" in *libsoup*) need_glib=yes;; esac
bluetooth_disabled=no
AC_ARG_ENABLE(bluetooth,
- AC_HELP_STRING([--enable-bluetooth],
+ AS_HELP_STRING([--enable-bluetooth],
[enable bluetooth transport support]),
[ enable_bluetooth="$enableval"
if test "$enableval" = "no"; then
@@ -294,7 +310,7 @@ AC_ARG_ENABLE(bluetooth,
if test "$enable_bluetooth" = "yes"; then
# currently we need Bluetooth and OBEX support
- test "$have_bluetooth" = "yes" || AC_MSG_ERROR([openobex or bluez not found])
+ test "$have_bluetooth" = "yes" || AC_MSG_ERROR([openobex or bluez not found])
AC_LANG(C)
CFLAGS_old="$CFLAGS"
@@ -325,7 +341,7 @@ if test "$enable_bluetooth" = "yes"; then
sdp_extract_pdu_safe;
void foo(void) {
uint8_t *pdata = NULL;
- int scanned;
+ int scanned;
sdp_extract_pdu_safe(pdata, 100, &scanned);
}
])],
@@ -347,7 +363,7 @@ if test ! "$TRANSPORT" &&
test "$libcurl_disabled" != "yes" &&
test "$bluetooth_disabled" != "yes" &&
test "$have_bluetooth" != "yes" ; then
- AC_ERROR([no transport library found, configure with --disable-libcurl --disable-libsoup --disable-bluetooth to continue anyway (only useful if users of libsyncevolution provide transport implementation)])
+ AC_MSG_ERROR([no transport library found, configure with --disable-libcurl --disable-libsoup --disable-bluetooth to continue anyway (only useful if users of libsyncevolution provide transport implementation)])
fi
# for libsoup we must specify the SSL certificate file outself
@@ -361,7 +377,7 @@ AC_SUBST(TRANSPORT_LIBS)
AC_SUBST(TRANSPORT_CFLAGS)
AC_ARG_ENABLE(ssl-certificate-check,
- AC_HELP_STRING([--disable-ssl-certificate-check],
+ AS_HELP_STRING([--disable-ssl-certificate-check],
[Disable SSL certificate checking in all server
*templates*. Users can still choose to enable or
disable it in their configuration. This is necessary on
@@ -394,7 +410,7 @@ AC_ARG_ENABLE(gui,
elif test "$enableval" = "all" ; then
enable_gui=all
else
- AC_ERROR([Unknown gui type: '$enableval'])
+ AC_MSG_ERROR([Unknown gui type: '$enableval'])
fi
],
[ enable_gui=no ])
@@ -425,8 +441,8 @@ AC_ARG_ENABLE(gnome-keyring,
AS_HELP_STRING([--enable-gnome-keyring],
[enables or disables support for the GNOME keyring; default is on if development files are available]),
[enable_gnome_keyring="$enableval"
- test "$enable_gnome_keyring" = "yes" || test "$enable_gnome_keyring" = "no" || AC_ERROR([invalid value for --enable-gnome-keyring: $enable_gnome_keyring])
- test "$enable_gnome_keyring" = "no" || test "$HAVE_KEYRING" = "yes" || AC_ERROR([gnome-keyring-1 pkg not found, needed for --enable-gnome-keyring])],
+ test "$enable_gnome_keyring" = "yes" || test "$enable_gnome_keyring" = "no" || AC_MSG_ERROR([invalid value for --enable-gnome-keyring: $enable_gnome_keyring])
+ test "$enable_gnome_keyring" = "no" || test "$HAVE_KEYRING" = "yes" || AC_MSG_ERROR([gnome-keyring-1 pkg not found, needed for --enable-gnome-keyring])],
enable_gnome_keyring="$HAVE_KEYRING")
if test $enable_gnome_keyring = "yes"; then
AC_DEFINE(USE_GNOME_KEYRING, 1, [define if gnome keyring should be used in dbus service])
@@ -439,24 +455,33 @@ fi
## Begin KWallet ##############################
-AC_CHECK_PROGS([QMAKE], [qmake qmake-qt4])
+# first check for qmake-qt4, because qmake may point to qmake-qt3.
+AC_CHECK_PROGS([QMAKE], [qmake-qt4 qmake])
-if test "$QMAKE"; then
- KDEKWALLETFOUND=yes
- if ! test "$KDE_KWALLET_CFLAGS"; then
- KDE_KWALLET_CFLAGS="-I`kde4-config --path include` -I`kde4-config --path include`/KDE -I`$QMAKE -query QT_INSTALL_HEADERS`"
- fi
- if ! test "$KDE_KWALLET_LIBS"; then
+if test "x$QMAKE" != 'x'
+then
+ AC_PATH_PROG([KDE4_CONFIG], [kde4-config], [no])
+
+ if test "x$KDE4_CONFIG" != 'xno'
+ then
+ KDEKWALLETFOUND=yes
+ if ! test "$KDE_KWALLET_CFLAGS"; then
+ KDE_KWALLET_CFLAGS="-I`$KDE4_CONFIG --path include` -I`$KDE4_CONFIG --path include`/KDE -I`$QMAKE -query QT_INSTALL_HEADERS`"
+ fi
+ if ! test "$KDE_KWALLET_LIBS"; then
KDE_KWALLET_LIBS="-lkdeui -lkdecore `pkg-config --libs QtDBus`"
- fi
- AC_LANG_PUSH(C++)
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $KDE_KWALLET_CFLAGS"
- AC_CHECK_HEADERS(kwallet.h, [], [KDEKWALLETFOUND=no])
- CPPFLAGS="$old_CPPFLAGS"
- AC_LANG_POP(C++)
+ fi
+ AC_LANG_PUSH(C++)
+ old_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $KDE_KWALLET_CFLAGS"
+ AC_CHECK_HEADERS(kwallet.h, [], [KDEKWALLETFOUND=no])
+ CPPFLAGS="$old_CPPFLAGS"
+ AC_LANG_POP(C++)
+ else
+ KDEKWALLETFOUND=no
+ fi
else
- KDEKWALLETFOUND=no
+ KDEKWALLETFOUND=no
fi
# In contrast to the GNOME KEYRING, the KWallet is
@@ -491,7 +516,7 @@ AM_CONDITIONAL([USE_KDE_KWALLET], [test "$use_kde_kwallet" = "yes"])
if test $enable_dbus_service = "yes"; then
if test -z "$XSLT"; then
- AC_ERROR([xsltproc not found, is required for D-Bus service])
+ AC_MSG_ERROR([xsltproc not found, is required for D-Bus service])
fi
PKG_CHECK_MODULES(DBUS, dbus-1, dummy=yes,
AC_MSG_ERROR(libdbus-1 is required))
@@ -507,8 +532,8 @@ if test $enable_dbus_service = "yes"; then
AC_ARG_ENABLE(notify,
AS_HELP_STRING([--enable-notify],
[send notifications for automatic sync events, using libnotify]),
- [ test "$enableval" = "no" || test $HAVE_LIBNOTIFY = "yes" || AC_ERROR([required libnotify package not found]) ],
- [ test $HAVE_LIBNOTIFY = "yes" || AC_ERROR([required libnotify package not found, use --disable-notify to compile without libnotify based notifications]) ])
+ [ test "$enableval" = "no" || test $HAVE_LIBNOTIFY = "yes" || AC_MSG_ERROR([required libnotify package not found]) ],
+ [ test $HAVE_LIBNOTIFY = "yes" || AC_MSG_ERROR([required libnotify package not found, use --disable-notify to compile without libnotify based notifications]) ])
if test $HAVE_LIBNOTIFY = "yes"; then
AC_DEFINE(HAS_NOTIFY, 1, [define if libnotify could be used in dbus service])
fi
@@ -531,7 +556,7 @@ if test $enable_dbus_service = "yes"; then
AS_HELP_STRING([--enable-mlite],
[send notifications for automatic sync events, using mlite (off by default)]),
[ enable_mlite="$enableval"
- test "$enableval" = "no" || test $HAVE_MLITE = "yes" || AC_ERROR([required mlite package not found]) ],
+ test "$enableval" = "no" || test $HAVE_MLITE = "yes" || AC_MSG_ERROR([required mlite package not found]) ],
[ enable_mlite="no" ])
if test $enable_mlite = "yes"; then
AC_DEFINE(HAS_MLITE, 1, [define if mlite could be used in dbus service])
@@ -548,8 +573,8 @@ AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
AC_SUBST(DBUS_GLIB_CFLAGS)
AC_SUBST(DBUS_GLIB_LIBS)
-AC_SUBST(KEYRING_CFLAGS)
-AC_SUBST(KEYRING_LIBS)
+AC_SUBST(KEYRING_CFLAGS)
+AC_SUBST(KEYRING_LIBS)
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)
AC_SUBST(LIBEXECDIR)
@@ -573,10 +598,10 @@ fi
# decide which sync-ui(s) we are building:
# sync-ui (in either GTK or Moblin mode) or both (in separate binaries)
case $enable_gui in
- all) GUI_PROGRAMS='sync-ui-gtk${EXEEXT} sync-ui-moblin${EXEEXT}'; GUI_DESKTOP_FILES="sync-gtk.desktop sync-moblin.desktop";;
- gtk|moblin) GUI_PROGRAMS='sync-ui${EXEEXT}'; GUI_DESKTOP_FILES="sync.desktop";;
+ all) GUI_PROGRAMS='src/gtk-ui/sync-ui-gtk${EXEEXT} src/gtk-ui/sync-ui-moblin${EXEEXT}'; GUI_DESKTOP_FILES="src/gtk-ui/sync-gtk.desktop src/gtk-ui/sync-moblin.desktop";;
+ gtk|moblin) GUI_PROGRAMS='src/gtk-ui/sync-ui${EXEEXT}'; GUI_DESKTOP_FILES="src/gtk-ui/sync.desktop";;
no) GUI_PROGRAMS=; GUI_DESKTOP_FILES=;;
- *) AC_ERROR([Unknown enable_gui type: '$enable_gui'])
+ *) AC_MSG_ERROR([Unknown enable_gui type: '$enable_gui'])
esac
if test $enable_gui != "no"; then
@@ -603,7 +628,7 @@ if test $enable_gui != "no"; then
have_unique="yes",
have_unique="no")
if test $have_unique = "yes"; then
- gui_modules="$gui_modules unique-1.0"
+ gui_modules="$gui_modules unique-1.0"
AC_DEFINE(ENABLE_UNIQUE, 1, [enable single-app-instance functionality])
fi
@@ -647,7 +672,7 @@ AC_ARG_WITH(rst2man,
if test "$RST2MAN" = "yes"; then
AC_PATH_PROG(RST2MAN, rst2man, "no")
fi
- test "$RST2MAN" = "no" || test -x "$RST2MAN" || AC_ERROR([--with-rst2man=$RST2MAN: tool not found])],
+ test "$RST2MAN" = "no" || test -x "$RST2MAN" || AC_MSG_ERROR([--with-rst2man=$RST2MAN: tool not found])],
[AC_PATH_PROG(RST2MAN, rst2man, "no")])
AM_CONDITIONAL([COND_MAN_PAGES], [test "$RST2MAN" != "no"])
@@ -661,7 +686,7 @@ AC_ARG_WITH(rst2html,
if test "$RST2HTML" = "yes"; then
AC_PATH_PROG(RST2HTML, rst2html, "no")
fi
- test "$RST2HTML" = "no" || test -x "$RST2HTML" || AC_ERROR([--with-rst2html=$RST2HTML: tool not found])],
+ test "$RST2HTML" = "no" || test -x "$RST2HTML" || AC_MSG_ERROR([--with-rst2html=$RST2HTML: tool not found])],
[AC_PATH_PROG(RST2HTML, rst2html, "no")])
AM_CONDITIONAL([COND_HTML_README], [test "$RST2HTML" != "no"])
@@ -701,23 +726,23 @@ if test "$SYNTHESISSRC" && test "$SYNTHESISSRC" != "none"; then
fi
fi
if test -d $SYNTHESIS_SRC ; then
- ( set -x; cd $SYNTHESIS_SRC && svn --username=$USERNAME switch $revarg "$SYNTHESISSRC" ) || AC_ERROR([updating from $SYNTHESISSRC failed])
+ ( set -x; cd $SYNTHESIS_SRC && svn --username=$USERNAME switch $revarg "$SYNTHESISSRC" ) || AC_MSG_ERROR([updating from $SYNTHESISSRC failed])
else
- (set -x; svn --username=$USERNAME checkout $revarg "$SYNTHESISSRCREV" $SYNTHESIS_SRC ) || AC_ERROR([checking out $SYNTHESISSRC failed])
+ (set -x; svn --username=$USERNAME checkout $revarg "$SYNTHESISSRCREV" $SYNTHESIS_SRC ) || AC_MSG_ERROR([checking out $SYNTHESISSRC failed])
fi
;;
*)
if test -d $SYNTHESIS_SRC ; then
- ( set -x; cd $SYNTHESIS_SRC && git fetch "$SYNTHESISSRC" ) || AC_ERROR([updating from $SYNTHESISSRC failed])
+ ( set -x; cd $SYNTHESIS_SRC && git fetch "$SYNTHESISSRC" ) || AC_MSG_ERROR([updating from $SYNTHESISSRC failed])
else
- ( set -x; git clone "$SYNTHESISSRC" $SYNTHESIS_SRC ) || AC_ERROR([cloning $SYNTHESISSRC failed])
+ ( set -x; git clone "$SYNTHESISSRC" $SYNTHESIS_SRC ) || AC_MSG_ERROR([cloning $SYNTHESISSRC failed])
fi
if test "$REVISION"; then
# git 1.6 finds tags and branches without explicit prefix, 1.4.4.4 doesn't
( set -x; cd $SYNTHESIS_SRC &&
(git checkout "$REVISION" ||
git checkout "tags/$REVISION" ||
- git checkout "origin/$REVISION") ) || AC_ERROR([checking out $SYNTHESISSRC failed])
+ git checkout "origin/$REVISION") ) || AC_MSG_ERROR([checking out $SYNTHESISSRC failed])
fi
;;
esac
@@ -754,9 +779,9 @@ if test $SYNTHESIS_SRC != "no-synthesis-source"; then
SYNTHESIS_CFLAGS="-I$SYNTHESIS_SUBDIR/src"
SYNTHESIS_LIBS="$SYNTHESIS_SUBDIR/src/libsynthesissdk.la"
- if test "$enable_core" = "no" && test "$enable_gui" != "no"; then
+ if test "x$enable_core" = "xno" && test "x$enable_gui" != "xno"; then
# SYNTHESIS_SUBDIR is ignored, at least build headers for GUI
- SYNTHESIS_SUBDIR_INCLUDES=synthesis-includes
+ SYNTHESIS_SUBDIR_INCLUDES=src/synthesis-includes
fi
if test "$enable_shared" = "no"; then
@@ -798,30 +823,6 @@ AC_SUBST(SYNTHESIS_ENGINE)
AC_SUBST(SYNTHESIS_LIB)
AC_SUBST(SYNTHESISSRC)
-dnl select backends
-BACKENDS=""
-
-# AC_ARG_ENABLE_BACKEND(BACKEND, DIR, HELP-STRING, [ACTION-IF-GIVEN],
-# [ACTION-IF-NOT-GIVEN])
-#
-# Same as AC_ARG_ENABLE(), but also tells configure that the
-# backend exists.
-#
-# BACKEND = name of modules built in that dir as .la files without the
-# obligatory sync prefix, e.g. "ebook"
-# DIR = name of the directory inside src/backends, e.g., "evolution"
-AC_DEFUN([AC_ARG_ENABLE_BACKEND],
-[
- AC_ARG_ENABLE($1, $3, $4, $5)
- BACKENDS="$BACKENDS $1"
- BACKEND_DEFINES="$BACKEND_DEFINES ENABLE_`echo $1 | tr a-z A-Z`"
- for source in $2; do
- SYNCSOURCES="$SYNCSOURCES backends/$2/sync$1.la"
- done
-])
-AC_SUBST(SYNCSOURCES)
-AC_SUBST(BACKEND_DEFINES)
-
BACKEND_CPPFLAGS="$SYNTHESIS_CFLAGS $EPACKAGE_CFLAGS $EBOOK_CFLAGS $ECAL_CFLAGS $GLIB_CFLAGS $BOOST_CPPFLAGS"
AC_SUBST(BACKEND_CPPFLAGS)
@@ -833,8 +834,8 @@ PKG_CHECK_MODULES(GNOMEBLUETOOTH, [gnome-bluetooth-1.0 >= 2.27.6],
AC_SUBST(GNOMEBLUETOOTH_CFLAGS)
AC_SUBST(GNOMEBLUETOOTH_DIR)
-AC_ARG_ENABLE(gnome-bluetooth-panel-plugin,
- AC_HELP_STRING([--enable-gnome-bluetooth-panel-plugin],
+AC_ARG_ENABLE(gnome-bluetooth-panel-plugin,
+ AS_HELP_STRING([--enable-gnome-bluetooth-panel-plugin],
[GNOME Bluetooth panel plugin adding a "sync" button for paired devices (off by default)]),
[enable_gnome_bluetooth_panel="$enableval"],
[enable_gnome_bluetooth_panel="no"]
@@ -843,14 +844,219 @@ if test "$enable_gnome_bluetooth_panel" = "yes"; then
test "$have_gbt" = "yes" || AC_MSG_ERROR([--enable-gnome-bluetooth-panel requires
pkg-config information for gnome-bluetooth-1.0 >= 2.27.6 which was not found])
fi
-AC_CONFIG_FILES(src/gnome-bluetooth/Makefile)
AM_CONDITIONAL([ENABLE_GNOME_BLUETOOTH_PANEL], [test "$have_gbt" = "yes" && test "$enable_gnome_bluetooth_panel" = "yes"])
AC_ARG_ENABLE(doc,
- AC_HELP_STRING([--enable-doc],
+ AS_HELP_STRING([--enable-doc],
[generate backend and DBus API documentation]),
enable_doc="$enableval", enable_doc="no")
-
+
AM_CONDITIONAL([COND_DOC], [test "$enable_doc" != "no"])
-dnl src/backends/*/configure-sub.in and configure-post.in follow
+dnl add backends stuff.
+SE_ADD_BACKENDS
+
+dnl -*- mode: Autoconf; -*-
+dnl Invoke autogen.sh to produce a configure script.
+
+AC_ARG_ENABLE(qt-dbus,
+ AS_HELP_STRING([--enable-qt-dbus],
+ [build Qt bindings for D-Bus]),
+ enable_qt_dbus="$enableval", enable_qt_dbus="no")
+
+if test "$enable_qt_dbus" = "yes"; then
+ AC_DEFINE(ENABLE_QT_DBUS, 1, [Qt D-Bus bindings available])
+ need_qt_modules="$need_qt_modules +dbus"
+ AC_PATH_PROG([QDBUSXML_TO_CPP], [qdbusxml2cpp], [no])
+ test "x$QDBUSXML_TO_CPP" != 'xno' || AC_MSG_ERROR([--enable-qt-dbus requires qdbusxml2cpp, which was not found])
+fi
+
+AM_CONDITIONAL([ENABLE_QT_DBUS], [test "$enable_qt_dbus" = "yes"])
+
+AC_SUBST(QT_DBUS_LIBS)
+AC_CONFIG_FILES([src/dbus/qt/syncevolution-qt-dbus.pc])
+
+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 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)
+ PKG_CHECK_MODULES(GIO, "gio-2.0", , GLIBFOUND=no)
+
+ if test "x${GLIBFOUND}" = "xyes"; then
+ AC_DEFINE(HAVE_GLIB, 1, [glib found])
+ else
+ AC_MSG_ERROR([not all GNOME libraries found])
+ fi
+ BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $GLIB_CFLAGS $GTHREAD_CFLAGS $GOBJECT_CFLAGS"
+fi
+
+# Check for Qt if some backend needs it.
+if test "$need_qt_modules"; then
+ AT_WITH_QT([-gui $need_qt_modules],
+ [$qt_config],
+ [$qt_misc])
+fi
+
+# 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
+ PKG_CHECK_MODULES(GLIB216, [glib-2.0 >= 2.16],
+ [AC_DEFINE(USE_SHA256, 1, [choose implementation of SHA-256])
+ have_sha="glib"],
+ [true])
+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"],
+ [true])
+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])
+ # don't link against libs wrapped by eds_abi_wrapper (no longer limited to EDS alone...)
+ ECAL_LIBS=
+ EBOOK_LIBS=
+ EPACKAGE_LIBS=
+ BLUEZ_LIBS=
+fi
+AM_CONDITIONAL([ENABLE_EVOLUTION_COMPATIBILITY], [test "$enable_evolution_compatibility" = "yes"])
+PKG_CHECK_MODULES(LIBICAL_AVAILABLE,
+ libical >= 0.43,
+ AC_DEFINE(HAVE_LIBICAL_R, 1, [have recent enough libical with _r variants]),
+ pass)
+
+dnl --enable-developer-mode
+if test "$enable_developer_mode" = "yes"; then
+BACKENDS_SEARCH_DIRECTORY="`pwd`/src/backends/"
+else
+BACKENDS_SEARCH_DIRECTORY='$(libdir)/syncevolution/backends/'
+fi
+
+BACKENDS_DIRECTORY='$(libdir)/syncevolution/backends'
+AC_SUBST(BACKENDS_DIRECTORY)
+AC_SUBST(BACKENDS_SEARCH_DIRECTORY)
+
+# for ActiveSync backend
+syncevo_backenddir='$(libdir)'/syncevolution/backends
+AC_SUBST(syncevo_backenddir)
+
+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_ARG_ENABLE(dbus-timeout-hack,
+ AS_HELP_STRING([--enable-dbus-timeout-hack],
+ [Enables code which overrides the default timeout in dbus_connection_send_with_reply() so that the method call never times out. Needed for libecal/ebook >= 2.30, so enabled by default if either of these is enabled.]),
+ [enable_dbus_timeout_hack=$enableval],
+ [if test $enable_ebook = "yes" || test $enable_ecal = "yes"; then
+ enable_dbus_timeout_hack="yes"
+ fi])
+if test "$enable_dbus_timeout_hack" = "yes"; then
+ AC_DEFINE(ENABLE_DBUS_TIMEOUT_HACK, 1, [overrides the default D-Bus timeout so that synchronous calls never time out])
+fi
+
+# Avoid hard-coding paths in backends. These names are chosen so
+# that a backend can alternatively use its own top-level configure
+# with PKG_CHECK_MODULES(SYNCEVOLUTION, "syncevolution") to set them.
+# need absolute path, use pwd instead of relative $srcdir
+SYNCEVOLUTION_CFLAGS=-I`cd $srcdir && pwd`/src
+SYNCEVOLUTION_LIBS=`pwd`/src/syncevo/libsyncevolution.la
+AC_SUBST(SYNCEVOLUTION_CFLAGS)
+AC_SUBST(SYNCEVOLUTION_LIBS)
+
+AC_CONFIG_FILES([
+ Makefile
+ src/syncevo/syncevolution.pc
+ src/synthesis-includes/Makefile
+ po/Makefile.in
+ src/dbus/glib/syncevo-dbus.pc
+])
+AC_OUTPUT
+
+echo
+echo CONFIGURATION SUMMARY
+echo "Core SyncEvolution: $enable_core"
+for backend in $BACKENDS; do
+ eval echo $backend: \${enable_${backend}}
+done
+echo "DBus service: $enable_dbus_service"
+echo "GNOME keyring: $enable_gnome_keyring"
+echo "UI (DBus client): $enable_gui"
+echo "Bluetooth transport: $have_bluetooth"
+echo "GNOME Bluetooth panel plugin: $enable_gnome_bluetooth_panel"
+echo "SHA-256: $have_sha"
+echo "API documentation: $enable_doc"
+echo "D-Bus Timeout Hack: $enable_dbus_timeout_hack"
+echo
diff --git a/gen-autotools.sh b/gen-autotools.sh
deleted file mode 100755
index 8b7ab027..00000000
--- a/gen-autotools.sh
+++ /dev/null
@@ -1,178 +0,0 @@
-#! /bin/sh
-#
-# This script generates the autotools configure.in and
-# Makefile.am files from the information provided by
-# SyncEvolution and backends in src/backends. The
-# motivation for this non-standard approach was that
-# it allows adding new backends without touching core
-# files, which should have simplified the development of
-# out-of-tree backends. Now git pretty much removes
-# the need for such tricks, but it's still around.
-
-# Another reason for gen-autotools.sh is that it generates
-# the version in the configure script. This cannot be
-# done inside the script because autoconf expects a
-# literal string, not some kind of variable.
-#
-# To use the version specified in AC_INIT() unmodified,
-# the following checks must pass:
-# - SyncEvolution source is clean (git status reports
-# no "modified" files or "untracked" files, or the source
-# is not in git at all)
-# - the source is tagged with the version of SyncEvolution
-# (git describe --tags HEAD reports something which matches,
-# for example syncevolution-1-0-beta-2a for 1.0beta2a)
-# - same for libsynthesis, if the SYNTHESISSRC env variable
-# is set
-#
-# If these tests fail, the version is extended:
-# +<yyyymmdd>+SE+<status>+SYSYNC+<status>
-# <yyyymmdd> = date
-# <status> = <hash>[+unclean]
-# <hash> = shortened hash from describe (for example, 1040ffd)
-# +unclean = source was dirty
-
-set -e
-
-version=`grep '^AC_INIT' configure-pre.in | sed -e 's/.*\[\(.*\)\])/\1/'`
-checksource () {
- dir=$1
- force=$2
- dirty=
- if [ ! -d $dir/.git ]; then
- return
- fi
-
- cur=`pwd`
- cd $dir
-
- if git status | grep -e "modified:" -e "Untracked files:" -q; then
- dirty=+unclean
- fi
- describe=`git describe --tags`
- hash=`cat .git/HEAD | sed -e 's/ref: //'`
- if [ "`echo $hash | sed -e 's/[0-9a-fA-F]//g'`" ] ; then
- # contains other characters than simple hex, probably a reference:
- # convert to abbreviated hash
- hash=`git show-ref --abbrev --hash --verify $hash`
- else
- # already a hash, abbreviate
- hash=`echo $hash | sed -e 's/\(......\).*/\1/'`
- fi
- # detect -<number of changes>-g<hash> suffix added when tag is older than HEAD
- if perl -e "exit !('$describe' =~ m/-[0-9]+-[0-9a-g]{8}\$/);"; then
- # remove suffix to get tag (doesn't matter if we do not pick
- # the most recent one)
- exact=
- tag=`echo $describe | sed -e 's/-[0123456789]*-g.*//'`
- else
- # there is at least one tag matching HEAD;
- # pick the most recent one (based on lexical sorting)
- exact=1
- tag=`git show-ref --tags | grep $hash | sort | tail -1 | sed -e 's;.*refs/tags/;;'`
- fi
- simpletag=$tag
- # Hyphens between numbers in the tag are dots in the version
- # and all other hyphens can be removed.
- while true; do
- tmp=`echo $simpletag | sed -e 's/\([0123456789]\)-\([0123456789]\)/\1.\2/'`
- if [ $tmp = $simpletag ]; then
- break
- else
- simpletag=$tmp
- fi
- done
- simpletag=`echo $simpletag | sed -e 's/-//g'`
- if [ "$dirty" ] || [ "$force" ]; then
- # previous check failed, always print hash
- echo $hash$dirty
- elif [ "$exact" ] &&
- echo $simpletag | grep -q "syncevolution${version}\$"; then
- true
- else
- echo $hash$dirty
- fi
- cd $cur
-}
-
-versionsuffix=
-syncevo=`checksource .`
-if [ "$SYNTHESISSRC" ]; then
- sysync=`checksource $SYNTHESISSRC $syncevo`
-fi
-# run check again, to get hash when only libsynthesis failed
-syncevo=`checksource . $sysync`
-if [ "$syncevo" ]; then
- versionsuffix=+SE+$syncevo
-fi
-if [ "$sysync" ]; then
- versionsuffix=$versionsuffix+SYSYNC+$sysync
-fi
-if [ "$versionsuffix" ]; then
- versionsuffix=+`date +%Y%m%d`$versionsuffix
-fi
-
-# don't touch final output file unless new
-# content is different
-update () {
- if [ ! "$GEN_AUTOTOOLS_SET_VERSION" ]; then
- # ignore AC_INIT because it
- # contains a version number including git hashes,
- # thus changes on each commit and forces a recompile
- diffargs=--ignore-matching-lines=^AC_INIT
- else
- # a version change due to that must be set up
- # with autogen.sh, which disables this check
- diffargs=
- fi
-
- if [ -f $1 ] && diff $diffargs $1 $2; then
- rm $2
- else
- echo gen-autotools.sh: $1 updated
- mv $2 $1
- fi
-}
-
-# generate configure.in from main configure-*.in pieces
-# and all backend configure-sub.in pieces
-out=configure.in
-tmpfile=configure.in.$$
-rm -f $tmpfile
-sed -e "s/^\\(AC_INIT.*\\)\\[\\(.*\\)\\]/\\1[\\2$versionsuffix]/" configure-pre.in >>$tmpfile
-
-# Very simplistic detection of pre-releases:
-# either the code isn't clean or properly tagged (versionsuffix non-empty)
-# or the version contains "99" (part of the rpm-style versioning scheme).
-if [ ! "$versionsuffix" ] && ! grep 'AC_INIT' $tmpfile | grep -q 99; then
- perl -pi -e 's/define\(\[STABLE_RELEASE\], \[no\]\)/define([STABLE_RELEASE], [yes])/' $tmpfile
-fi
-
-BACKENDS=
-SUBS=
-for sub in `find -L src -name configure-sub.in`; do
- case $sub in src/backends/*)
- BACKENDS="$BACKENDS `dirname $sub | sed -e 's;^src/;;'`";;
- esac
- SUBS="$SUBS $sub"
- echo "# vvvvvvvvvvvvvv $sub vvvvvvvvvvvvvv" >>$tmpfile
- cat $sub >>$tmpfile
- echo "AC_CONFIG_FILES(`echo $sub | sed -e s/configure-sub.in/Makefile/`)" >>$tmpfile
- echo "# ^^^^^^^^^^^^^^ $sub ^^^^^^^^^^^^^^" >>$tmpfile
- echo >>$tmpfile
-done
-cat configure-post.in >>$tmpfile
-update $out $tmpfile
-
-TEMPLATE_FILES=`cd src && find templates -type f \( -name README -o -name '*.png' -o -name '*.svg' -o -name '*.ini' \) | sort`
-TEMPLATE_FILES=`echo $TEMPLATE_FILES`
-
-# create src/Makefile.am file
-sed -e "s;@BACKEND_REGISTRIES@;`echo src/backends/*/*Register.cpp | sed -e s%src/%%g`;" \
- -e "s;@BACKENDS@;$BACKENDS;" \
- -e "s;@TEMPLATE_FILES@;$TEMPLATE_FILES;" \
- src/Makefile-gen.am >src/Makefile.am.new.$$
-update src/Makefile.am src/Makefile.am.new.$$
-
-# create LINGUAS file: every .po is included
-(cd po && ls -1 *.po | sort -u | sed -e 's/.po$//' > LINGUAS.new.$$ && update LINGUAS LINGUAS.new.$$)
diff --git a/m4-repo/dk-warn.m4 b/m4-repo/dk-warn.m4
new file mode 100644
index 00000000..90243bd8
--- /dev/null
+++ b/m4-repo/dk-warn.m4
@@ -0,0 +1,114 @@
+## Copyright (c) 2004-2007 Daniel Elstner <daniel.kitta@gmail.com>
+##
+## This file is part of danielk's Autostuff.
+##
+## danielk's Autostuff is free software; you can redistribute it and/or
+## modify it under the terms of the GNU General Public License as published
+## by the Free Software Foundation; either version 2 of the License, or (at
+## your option) any later version.
+##
+## danielk's Autostuff is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+## for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with danielk's Autostuff; if not, write to the Free Software Foundation,
+## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#serial 20070116
+
+## DK_ARG_ENABLE_WARNINGS(variable, min-flags, max-flags, [deprecation-prefixes])
+##
+## Provide the --enable-warnings configure argument, set to "min" by default.
+## <min-flags> and <max-flags> should be space-separated lists of compiler
+## warning flags to use with --enable-warnings=min or --enable-warnings=max,
+## respectively. Warning level "fatal" is the same as "max" but in addition
+## enables -Werror mode.
+##
+## If not empty, <deprecation-prefixes> should be a list of module prefixes
+## which is expanded to -D<module>_DISABLE_DEPRECATED flags if fatal warnings
+## are enabled, too.
+##
+AC_DEFUN([DK_ARG_ENABLE_WARNINGS],
+[dnl
+m4_if([$3],, [AC_FATAL([3 arguments expected])])[]dnl
+dnl
+AC_ARG_ENABLE([warnings], [AS_HELP_STRING(
+ [--enable-warnings=@<:@min|max|fatal|no@:>@],
+ [control compiler pickyness @<:@min@:>@])],
+ [dk_enable_warnings=$enableval],
+ [dk_enable_warnings=min])[]dnl
+
+dk_lang=
+case $ac_compile in
+ *'$CXXFLAGS '*)
+ dk_lang='C++'
+ dk_cc=$CXX
+ dk_conftest=conftest.${ac_ext-cc}
+ ;;
+ *'$CFLAGS '*)
+ dk_lang=C
+ dk_cc=$CC
+ dk_conftest=conftest.${ac_ext-c}
+ ;;
+esac
+
+AS_IF([test "x$dk_lang" != x],
+[
+ AC_MSG_CHECKING([which $dk_lang compiler warning flags to use])
+
+ case $dk_enable_warnings in
+ no) dk_warning_flags=;;
+ max) dk_warning_flags="$3";;
+ fatal) dk_warning_flags="$3 -Werror";;
+ *) dk_warning_flags="$2";;
+ esac
+
+ dk_deprecation_flags=
+m4_if([$4],,, [
+ AS_IF([test "x$dk_enable_warnings" = xfatal],
+ [
+ dk_deprecation_prefixes="$4"
+ for dk_prefix in $dk_deprecation_prefixes
+ do
+ dk_deprecation_flags="${dk_deprecation_flags}-D${dk_prefix}_DISABLE_DEPRECATED "
+ done
+ ])
+])[]dnl
+ dk_tested_flags=
+
+ AS_IF([test "x$dk_warning_flags" != x],
+ [
+ # Keep in mind that the dummy source must be devoid of any
+ # problems that might cause diagnostics.
+ AC_LANG_CONFTEST([AC_LANG_SOURCE(
+ [[int main(int argc, char** argv) { return (argv != 0) ? argc : 0; }]])])
+
+ for dk_flag in $dk_warning_flags
+ do
+ # Test whether the compiler accepts the flag. GCC doesn't bail
+ # out when given an unsupported flag but prints a warning, so
+ # check the compiler output instead.
+ dk_cc_out=`$dk_cc $dk_tested_flags $dk_flag -c "$dk_conftest" 2>&1 || echo failed`
+ rm -f "conftest.${OBJEXT-o}"
+
+ AS_IF([test "x$dk_cc_out" = x],
+ [
+ AS_IF([test "x$dk_tested_flags" = x],
+ [dk_tested_flags=$dk_flag],
+ [dk_tested_flags="$dk_tested_flags $dk_flag"])
+ ], [
+ echo "$dk_cc_out" >&AS_MESSAGE_LOG_FD
+ ])
+ done
+
+ rm -f "$dk_conftest"
+ ])
+ dk_all_flags=$dk_deprecation_flags$dk_tested_flags
+ AC_SUBST([$1], [$dk_all_flags])
+
+ test "x$dk_all_flags" != x || dk_all_flags=none
+ AC_MSG_RESULT([$dk_all_flags])
+])
+])
diff --git a/m4-repo/se_macros.m4 b/m4-repo/se_macros.m4
new file mode 100644
index 00000000..b46625b9
--- /dev/null
+++ b/m4-repo/se_macros.m4
@@ -0,0 +1,173 @@
+#serial 20110803
+
+## _SE_VERSIONS(MAJOR_VERSION, MINOR_VERSION, MICRO_VERSION, NANO_VERSION)
+##
+## exports MICRO_VERSION and NANO_VERSION to se_test_micro_version and
+## se_test_nano_version defines respectively. If any of passed parameters are
+## empty, those defines are defined as '0'. MAJOR_VERSION and MINOR_VERSION are
+## ignored.
+##
+m4_define([_SE_VERSIONS],
+ [dnl
+ m4_ifval([$3],
+ [dnl nonempty part
+ m4_define([se_test_micro_version], [$3])
+ ],
+ [dnl empty part
+ m4_define([se_test_micro_version], [0])
+ ]
+ )[]dnl
+ m4_ifval([$4],
+ [dnl nonempty part
+ m4_define([se_test_nano_version], [$4])
+ ],
+ [dnl empty part
+ m4_define([se_test_nano_version], [0])
+ ]
+ )[]dnl
+ ]
+ )[]dnl
+
+## SE_CHECK_FOR_STABLE_RELEASE
+##
+## No-op if STABLE_RELEASE is already defined.
+## Defines STABLE_RELEASE to 'yes' if nano and micro versions are greater or
+## equal 99.5. (So 1.1.99.5b is counted as table release.)
+## If above condition is not true then STABLE_RELEASE is defined to 'yes' if
+## current version is not dirty (nothing is appended by gen-git-version.sh).
+## If above fails, then STABLE_RELEASE is defined to 'no'.
+##
+AC_DEFUN([SE_CHECK_FOR_STABLE_RELEASE],
+ [m4_ifndef([STABLE_RELEASE],
+ [dnl ifndef part
+ m4_define([se_test_plus_index], m4_index(AC_PACKAGE_VERSION, [+]))[]dnl
+ m4_if(se_test_plus_index, [-1],
+ [dnl if part
+ m4_define([se_test_version], AC_PACKAGE_VERSION)
+ ],
+ [dnl else part
+ m4_define([se_test_version], m4_substr(AC_PACKAGE_VERSION, [0], se_test_plus_index))
+ m4_define([se_test_dirty_version], [yes])
+ ]
+ )[]dnl
+ _SE_VERSIONS(m4_bpatsubst(se_test_version, [[^0-9A-Za-z]+], [,]))[]dnl
+
+ m4_if(se_test_micro_version, [99],
+ [dnl if part
+ m4_define([se_test_nano_number], m4_translit(se_test_nano_version, [A-Za-z]))
+ m4_if(m4_eval(se_test_nano_number [>= 5]), [1],
+ [dnl if part
+ m4_define([STABLE_RELEASE], [yes])
+ ]
+ )
+ ],
+ [dnl else part
+ m4_ifndef([se_test_dirty_version],
+ [dnl ifndef part
+ m4_define([STABLE_RELEASE], [yes])
+ ]
+ )
+ ]
+ )[]dnl
+ m4_ifndef([STABLE_RELEASE],
+ [dnl ifndef part
+ m4_define([STABLE_RELEASE], [no])
+ ]
+ )
+ dnl macros cleanup
+ m4_ifdef([se_test_plus_index],
+ [dnl ifdef part
+ m4_undefine([se_test_plus_index])
+ ]
+ )[]dnl
+ m4_ifdef([se_test_version],
+ [dnl ifdef part
+ m4_undefine([se_test_version])
+ ]
+ )[]dnl
+ m4_ifdef([se_test_dirty_version],
+ [dnl ifdef part
+ m4_undefine([se_test_dirty_version])
+ ]
+ )[]dnl
+ m4_ifdef([se_test_micro_version],
+ [dnl ifdef part
+ m4_undefine([se_test_micro_version])
+ ]
+ )[]dnl
+ m4_ifdef([se_test_nano_version],
+ [dnl ifdef part
+ m4_undefine([se_test_nano_version])
+ ]
+ )[]dnl
+ m4_ifdef([se_test_nano_number],
+ [dnl ifdef part
+ m4_undefine([se_test_nano_number])
+ ]
+ )[]dnl
+ ]
+ )[]dnl
+ ]
+ )
+
+## SE_ENABLE_BACKENDS_PRE
+##
+## Marks BACKEND_DEFINES and SYNCSOURCES as variables to be substituted.
+## For internal use only.
+##
+AC_DEFUN([SE_ENABLE_BACKENDS_PRE],
+ [AC_SUBST(SYNCSOURCES)
+ AC_SUBST(BACKEND_DEFINES)
+ BACKENDS=''
+ BACKEND_DEFINES=''
+ SYNCSOURCES=''
+ ])
+
+## SE_ARG_ENABLE_BACKEND(BACKEND, DIR, HELP-STRING, [ACTION-IF-GIVEN],
+## [ACTION-IF-NOT-GIVEN])
+##
+## Same as AC_ARG_ENABLE(), but also tells configure that the
+## backend exists.
+##
+## BACKEND = name of modules built in that dir as .la files without the
+## obligatory sync prefix, e.g. "ebook"
+## DIR = name of the directory inside src/backends, e.g., "evolution"
+##
+AC_DEFUN([SE_ARG_ENABLE_BACKEND],
+ [AC_REQUIRE([SE_ENABLE_BACKENDS_PRE])
+ AC_ARG_ENABLE($1, $3, $4, $5)
+ BACKENDS="$BACKENDS $1"
+ BACKEND_DEFINES="$BACKEND_DEFINES ENABLE_[]m4_translit($1, [a-z], [A-Z])"
+ for source in $2
+ do
+ SYNCSOURCES="$SYNCSOURCES src/backends/$2/sync$1.la"
+ done
+ ]
+ )
+
+## SE_ADD_BACKENDS
+##
+## Adds backends available under src/backends. See build/gen-backends.sh script.
+##
+AC_DEFUN([SE_ADD_BACKENDS],
+ [m4_esyscmd(build/gen-backends.sh)
+ ]
+ )
+
+## SE_GENERATE_AM_FILES
+##
+## Generates some .am files needed by automake.
+##
+AC_DEFUN([SE_GENERATE_AM_FILES],
+ [m4_syscmd(build/gen-backends-am.sh)
+ ]
+ )
+
+## SE_GENERATE_LINGUAS
+##
+## Generates LINGUAS file.
+##
+AC_DEFUN([SE_GENERATE_LINGUAS],
+ [m4_syscmd(build/gen-linguas.sh)
+ ]
+ )
diff --git a/po/.gitignore b/po/.gitignore
deleted file mode 100644
index 9625334b..00000000
--- a/po/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/Makefile.in.in
-/LINGUAS
-/POTFILES
-/stamp-it
diff --git a/po/LINGUAS.README b/po/LINGUAS.README
new file mode 100644
index 00000000..4ad05aa2
--- /dev/null
+++ b/po/LINGUAS.README
@@ -0,0 +1,6 @@
+For translators:
+
+LINGUAS file is generated, so putting .po file here is enough.
+
+To test translation please run ./autogen.sh in top level
+directory of the project.
diff --git a/setup-variables.am b/setup-variables.am
new file mode 100644
index 00000000..ffc3df18
--- /dev/null
+++ b/setup-variables.am
@@ -0,0 +1,49 @@
+## This file just specifies all variables used in entire project.
+## If any of them was specified before this file is included then those ones
+## won't change the value.
+##
+## The reason for it is that many files are using BUILT_SOURCES, CLEANFILES and
+## other variables. This file allows them to harmlessly append stuff
+## to them without worrying whether the variable was defined earlier.
+
+# clean variables
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+MOSTLYCLEANFILES =
+
+
+# standard arch dependent pkg-config dir
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA =
+
+
+# standard variables with standard prefixes
+dist_doc_DATA =
+dist_noinst_DATA =
+dist_pkgdata_DATA =
+doc_DATA =
+
+lib_LTLIBRARIES =
+noinst_LTLIBRARIES =
+
+bin_PROGRAMS =
+libexec_PROGRAMS =
+noinst_PROGRAMS =
+
+bin_SCRIPTS =
+dist_noinst_SCRIPTS =
+libexec_SCRIPTS =
+nodist_bin_SCRIPTS =
+
+
+# other
+all_dist_hooks =
+all_local_installchecks =
+all_phonies =
+BUILT_SOURCES =
+DIST_SUBDIRS =
+EXTRA_DIST =
+EXTRA_PROGRAMS =
+SUBDIRS =
+TESTS =
diff --git a/src/.cvsignore b/src/.cvsignore
deleted file mode 100644
index 5ba731a8..00000000
--- a/src/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-syncevolution
-test
-*.log
-test*.diff
-*.test.vcf
-synclog.txt
-client-api
-client-api.build
-normalize_vcard
diff --git a/src/.gitignore b/src/.gitignore
deleted file mode 100644
index ea2631f8..00000000
--- a/src/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-/Makefile.am
-/syncevolution
-/synccompare
-/client-test
-/build-synthesis
-/syncevo-http-server
-/syncevo-dbus-server
-/syncevo-phone-config
-/testcases
diff --git a/src/Makefile-gen.am b/src/Makefile-gen.am
deleted file mode 100644
index 9c3bb421..00000000
--- a/src/Makefile-gen.am
+++ /dev/null
@@ -1,350 +0,0 @@
-include $(top_srcdir)/m4-repo/autotroll.mk
-
-BACKENDS = @BACKENDS@
-
-# start with building nothing and add more targets below
-SUBDIRS =
-EXTRA_PROGRAMS =
-TESTS =
-bin_PROGRAMS =
-bin_SCRIPTS =
-nodist_bin_SCRIPTS =
-libexec_PROGRAMS =
-libexec_SCRIPTS =
-nobase_dist_template_DATA =
-CLEANFILES =
-BUILT_SOURCES =
-
-if ENABLE_GNOME_BLUETOOTH_PANEL
-SUBDIRS += gnome-bluetooth
-endif
-if COND_CORE
-SUBDIRS += $(SYNTHESIS_SUBDIR) syncevo $(BACKENDS)
-bin_PROGRAMS += syncevolution
-bin_SCRIPTS += synccompare
-nobase_dist_template_DATA += $(TEMPLATE_FILES)
-else
-SUBDIRS += $(SYNTHESIS_SUBDIR_INCLUDES)
-endif
-if COND_DBUS
-SUBDIRS += gdbus
-endif
-SUBDIRS += dbus
-if COND_GUI
-SUBDIRS += gtk-ui
-else
-endif
-
-DIST_SUBDIRS = gdbus dbus syncevo $(BACKENDS) gtk-ui gnome-bluetooth synthesis-includes
-
-AM_CPPFLAGS = $(SUBDIRS:%=-I$(srcdir)/%) -I$(srcdir)/../test -I$(top_srcdir) $(BACKEND_CPPFLAGS)
-
-DISTCLEANFILES += synccompare
-CLEANFILES += libstdc++.a client-test $(CLIENT_LIB_TEST_FILES)
-
-if COND_DBUS
-nodist_bin_SCRIPTS += syncevo-http-server
-endif
-syncevo-http-server: $(srcdir)/../test/syncevo-http-server.py
- cp $< $@
-CLEANFILES += syncevo-http-server
-
-nodist_bin_SCRIPTS += syncevo-phone-config
-syncevo-phone-config: $(srcdir)/../test/syncevo-phone-config.py
- cp $< $@
-CLEANFILES += syncevo-phone-config
-
-SYNCEVOLUTION_DEP =
-if ENABLE_MODULES
-else
-SYNCEVOLUTION_LDADD += $(SYNCSOURCES)
-SYNCEVOLUTION_DEP += $(SYNCSOURCES)
-endif
-EXTRA_DIST = shlibs.local Makefile-gen.am
-
-TEMPLATE_FILES = @TEMPLATE_FILES@
-templatedir = $(datadir)/syncevolution/
-
-# synccompare is created by replacing its 'import Algorithm::Diff;'
-# with a simplified copy of Diff.pm.
-synccompare : ../test/Algorithm/Diff.pm ../test/synccompare.pl
- perl -e '$$diff = shift; open(DIFF, "<$$diff"); ($$_) = split(/__END__/, join("", <DIFF>)); s/\*import.*//m; s/require +Exporter;//; s/^#.*\n//mg; s/ +#.*\n//mg; $$diff = $$_;' -e 'while(<>) {' @MODIFY_SYNCCOMPARE@ -e 's/use +Algorithm::Diff;/"# embedded version of Algorithm::Diff follows, copyright by the original authors\n" . $$diff . "# end of embedded Algorithm::Diff\n"/e; print;}' $+ >$@
- chmod u+x $@
-
-CORE_SOURCES =
-
-# The files which register backends have to be compiled into
-# "client-test" and "syncevolution" in order to pull in the
-# code from the libs which implement the backends.
-#
-# Unit testing also goes there.
-#
-# When using modules the registration is done inside the
-# module and the register file is unnecessary. However, they
-# still need to be included in "make dist".
-BACKEND_REGISTRIES = @BACKEND_REGISTRIES@
-if ENABLE_MODULES
-EXTRA_DIST += $(BACKEND_REGISTRIES)
-else
-CORE_SOURCES += $(BACKEND_REGISTRIES)
-endif
-
-CORE_CXXFLAGS = $(SYNTHESIS_CFLAGS)
-CORE_LDADD = $(SYNCEVOLUTION_LDADD) syncevo/libsyncevolution.la $(GLIB_LIBS) $(GTHREAD_LIBS) $(GOBJECT_LIBS) $(LIBS)
-CORE_DEP = $(SYNCEVOLUTION_DEP) syncevo/libsyncevolution.la $(SYNTHESIS_DEP)
-CORE_LD_FLAGS = -Wl,-uSyncEvolution_Module_Version -Wl,--export-dynamic
-
-# put link to static c++ library into current directory, needed if compiling with --enable-static-c++
-libstdc++.a :
- path=`$(CXX) $(CORE_LDADD) $(LD_FLAGS) -print-file-name=libstdc++.a` && ln -s $$path .
-
-syncevolution_SOURCES = \
- syncevolution.cpp \
- CmdlineSyncClient.h \
- CmdlineSyncClient.cpp \
- $(CORE_SOURCES)
-if ENABLE_UNIT_TESTS
-nodist_syncevolution_SOURCES = ../test/test.cpp
-endif
-
-# SYNCEVOLUTION_LDADD will be replaced with libsyncebook.la/libsyncecal.la/libsyncsqlite.la
-# if linking statically against them, empty otherwise;
-# either way this does not lead to a dependency on those libs - done explicitly
-syncevolution_LDADD = $(CORE_LDADD) $(KEYRING_LIBS) $(KDE_KWALLET_LIBS)
-if COND_DBUS
-syncevolution_LDADD += gdbus/libgdbussyncevo.la
-endif
-syncevolution_LDFLAGS = $(CORE_LD_FLAGS) $(DBUS_LIBS)
-syncevolution_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) -I$(srcdir)/gdbus $(DBUS_CFLAGS) $(KDE_KWALLET_CFLAGS)
-syncevolution_DEPENDENCIES = $(EXTRA_LTLIBRARIES) $(CORE_DEP) # $(SYNTHESIS_DEP)
-
-# rule which is only relevant when compiling Synthesis in subdirectory
-#$(SYNTHESIS_LIB) : $(SYNTHESIS_SUBDIR)/all
-#$(SYNTHESIS_SUBDIR)/% :
-# [ ! "$(SYNTHESIS_SUBDIR)" ] || ( cd ${@D} && $(MAKE) ${@F} )
-
-# include Synthesis in distribution: package only files in git if using a git checkout
-dist-hook:
- set -x; [ ! "$(SYNTHESIS_SUBDIR)" ] || \
- mkdir -p $(distdir)/synthesis && \
- if test -d "$(SYNTHESIS_SRC)/.git"; \
- then \
- ( ( cd "$(SYNTHESIS_SRC)" && git archive HEAD ) | ( cd "$(distdir)/synthesis" && tar xf - && $$SHELL autogen.sh && rm -rf autom4te.cache ) ) && \
- ( echo Creating ChangeLog && \
- ( ( cd "$(SYNTHESIS_SRC)" && \
- echo '# Generated by configure. Do no edit.' && \
- githash=`git show-ref --head --hash | head -1` && \
- echo "# git revision $$githash" && \
- echo "# git tag `git describe --tags $$githash`" && \
- echo && \
- "$(top_srcdir)/missing" --run perl "$(top_srcdir)/build/gen-changelog.pl" ) > ChangeLog.tmp ) && \
- mv -f ChangeLog.tmp "$(distdir)/synthesis/ChangeLog" || \
- ( rm -f ChangeLog.tmp ; \
- echo Failed to generate ChangeLog >&2 ) \
- ); \
- elif test $(SYNTHESIS_SRC) != "no-synthesis-source"; then \
- cp -a $(SYNTHESIS_SRC)/* $(distdir)/synthesis && \
- for i in _build autom4te.cache; do [ ! -d "$(SYNTHESIS_SRC)/$$i" ] || chmod -R u+rwx "$(SYNTHESIS_SRC)/$$i"; done && \
- find "$(distdir)" -name .libs -o -name "*~" -o -name ".*" -o -name "*.o" -o -name "*.lo" -o -name CVS -o -name .svn -o -name .git -o -name autom4te.cache -print0 | xargs -0 rm -rf; \
- fi
-
-clean-local: testclean
- rm -rf testcases
- [ ! -L templates ] || rm templates
-
-# files created during testing
-testclean:
- rm -rf *.test.vcf *.log *.tests *.diff *.dat *Client_Sync_*client.*
-
-distclean-local:
- rm -rf $(SYNTHESIS_SUBDIR)
- rm -rf $(CLEAN_CLIENT_SRC)
-
-# Do the linking here, as with all SyncEvolution executables.
-# Sources are compiled in dbus/server.
-if COND_DBUS
-libexec_PROGRAMS += syncevo-dbus-server
-
-syncevo_dbus_server_SOURCES = \
- $(CORE_SOURCES)
-if ENABLE_UNIT_TESTS
-nodist_syncevo_dbus_server_SOURCES = ../test/test.cpp
-endif
-
-syncevo_dbus_server_LDADD = dbus/server/libsyncevodbusserver.la gdbus/libgdbussyncevo.la $(CORE_LDADD) $(KEYRING_LIBS) $(LIBNOTIFY_LIBS) $(MLITE_LIBS) $(KDE_KWALLET_LIBS) $(DBUS_LIBS)
-syncevo_dbus_server_CPPFLAGS = -DHAVE_CONFIG_H -I$(srcdir)/gdbus $(AM_CPPFLAGS) -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\"
-syncevo_dbus_server_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(KEYRING_CFLAGS) $(LIBNOTIFY_CFLAGS) $(MLITE_CFLAGS) $(KDE_KWALLET_CFLAGS)
-syncevo_dbus_server_LDFLAGS = $(CORE_LD_FLAGS) $(LIBSOUP_LIBS)
-syncevo_dbus_server_DEPENDENCIES = dbus/server/libsyncevodbusserver.la gdbus/libgdbussyncevo.la $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(SYNTHESIS_DEP)
-endif
-
-# With --disable-shared autotools links against libfunambol.a which does not
-# pull any of the test suites into the test binary, so they would not be
-# executed. The workaround is to explicitly set them as undefined on the
-# link line.
-client_test_SOURCES = \
- client-test-app.cpp \
- CmdlineSyncClient.cpp \
- ../test/ClientTest.cpp \
- ../test/ClientTest.h \
- ../test/client-test-main.cpp \
- $(CORE_SOURCES)
-nodist_client_test_SOURCES = ../test/test.cpp
-
-if ENABLE_BUTEO_TESTS
-client_test_SOURCES += client-test-buteo.h
-client_test_SOURCES += client-test-buteo.cpp
-nodist_client_test_SOURCES += client-test-buteo.moc.cpp
-endif
-
-# list of test file base files
-#
-# Generated files (testcases/eds_event.ics.funambol.tem) are derived from
-# the original base file ($(srcdir)/test/testcases/eds_event.ics) by
-# applying a patch ($(srcdir)/test/testcases/eds_event.ics.funambol.tem.patch).
-CLIENT_LIB_TEST_FILES = \
- testcases/lcs/file1.txt \
- testcases/lcs/file2.txt \
- testcases/local.png \
- testcases/templates/clients/SyncEvolution.ini \
- testcases/templates/clients/phone/nokia/S40/7210c.ini \
- testcases/google_event.ics \
- testcases/yahoo_contact.vcf \
- testcases/eds_contact.vcf \
- testcases/eds_event.ics \
- testcases/eds_event.ics.local \
- testcases/eds_memo.ics \
- testcases/eds_task.ics
-
-# all patch files
-TEST_FILES_PATCHES = $(wildcard $(srcdir)/../test/testcases/*.patch)
-# generated local files
-TEST_FILES_GENERATED = $(subst .patch,,$(subst $(srcdir)/../test/,,$(TEST_FILES_PATCHES)))
-# all patched files, regardless whether the patch already exists
-TEST_FILES_PATCHED = $(wildcard testcases/*.tem)
-# add files created via patches
-CLIENT_LIB_TEST_FILES += $(TEST_FILES_GENERATED)
-
-client_test_CPPFLAGS = -DHAVE_CONFIG_H -DENABLE_INTEGRATION_TESTS -DENABLE_UNIT_TESTS $(AM_CPPFLAGS) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(QT_CPPFLAGS)
-client_test_CXXFLAGS = `cppunit-config --cflags` $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS))
-client_test_LDFLAGS = `cppunit-config --libs` `nm syncevo/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-Wl,-u/'` $(CORE_LD_FLAGS) $(KEYRING_LIBS) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LDFLAGS)
-client_test_LDADD = $(CORE_LDADD) $(SYNTHESIS_ENGINE) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LIBS)
-# These dependencies are intentionally a bit too broad:
-# they ensure that all files are in place to *run* client-test.
-
-# rule to generate patched files from patches:
-# make cannot compute the dependencies completely, so run the commands
-# on each make invocation and do the time stamp test ourselves
-#
-# If we create the patched file anew, then set its time to the more
-# recent of the two input files. That way it won't be re-generated
-# (because it is not older), and it won't be used to refresh the patch
-# either in testcase2patch (because it is not newer either).
-# That is useful on platforms where diff produces different results
-# than the one in the source (possible because the "find shortest
-# patch" problem may have multiple solutions).
-.PHONY: $(TEST_FILES_GENERATED)
-$(TEST_FILES_GENERATED):
- @ mkdir -p testcases
- @ echo "checking whether server specific test case $@ is up-to-date"
- @ set -e; \
- patchfile=$(srcdir)/../test/$@.patch; \
- basefile=$(srcdir)/../test/$(basename $(basename $@)); \
- ( [ -e $@ ] && [ ! $@ -ot $$patchfile ] && [ ! $@ -ot $$basefile ] && echo " $@ up-to-date" ) || \
- ( [ ! -s $$patchfile ] && echo " copy $$basefile to $@ because patch file is empty" && cp $$basefile $@ ) || \
- ( echo " generating $@ by applying $$patchfile to $$basefile" && \
- (echo '*** foo'; echo '--- bar'; cat $$patchfile) | patch -s -o $@ $$basefile && \
- ( if [ $$basefile -ot $$patchfile ]; then \
- touch -r $$patchfile $@; else \
- touch -r $$basefile $@; fi ) \
- )
-
-
-# rule to regenerate patches:
-# like generating the patched files, this is run every time.
-# It must avoid making the patch file more recent than the
-# patched file, otherwise the rule above would needlessly recreate
-# it (not nice when having the file open in an editor).
-#
-# To avoid needlessly updating the content of the patch file,
-# the first two lines with changing information (paths, file dates)
-# are stripped from it.
-.PHONY: testcase2patch
-testcase2patch: $(TEST_FILES_GENERATED)
- @ echo "checking whether test case patch files are up-to-date"
- @ set -e; \
- for i in testcases/*.tem; do \
- patchfile=$(srcdir)/../test/$$i.patch; \
- basefile=$(srcdir)/../test/`echo $$i | cut -d . -f -2`; \
- if [ $$patchfile -ot $$i ] || [ $$patchfile -ot $$basefile ]; then \
- diff -u $$basefile $$i | tail -n +3 > $$patchfile || true; \
- touch -r $$i $$patchfile; \
- echo " updated $$patchfile"; \
- else \
- echo " $$patchfile up-to-date"; \
- fi; \
- done
-
-# copy base test files
-$(filter-out %.tem, $(filter testcases/%, $(subst $(srcdir)/../test/,,$(CLIENT_LIB_TEST_FILES)))) : % : $(srcdir)/../test/%
- mkdir -p ${@D}
- cp $< $@
-
-# The binary does not really depend on the test cases, only running it does.
-# Listing the dependencies here is done to ensure that one doesn't accidentally
-# runs the binary with out-dated auxiliary files.
-client_test_DEPENDENCIES = $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(CLIENT_LIB_TEST_FILES) testcase2patch synccompare templates
-
-CLEANFILES += client-test-buteo.moc.cpp
-
-# copy template directory into current working directory, if not there
-# yet
-.PHONY: templates
-templates:
- if test "$(srcdir)/templates" != "./templates"; then \
- rm -rf ./templates; \
- ln -s "$(srcdir)/templates" .; \
- fi
-
-# distribute test system?
-if ENABLE_TESTING
-# yes: install client-test in bindir, test files in datadir
-TESTS += client-test
-bin_PROGRAMS += client-test
-nobase_dist_doc_DATA = $(CLIENT_LIB_TEST_FILES)
-else
-# The "all" dependency causes a rebuild even if the actual input files
-# haven't changed. If client-test is part of the regular targets built
-# by "all", then it must not depend on all!
-EXTRA_PROGRAMS += client-test
-nodist_client_test_SOURCES += $(CLIENT_LIB_TEST_FILES)
-client_test_DEPENDENCIES += all
-endif
-
-# test program for output redirection, has to be built
-# and run manually
-EXTRA_PROGRAMS += abort-redirect
-CLEANFILES += abort-redirect.log
-abort_redirect_SOURCES = ../test/abort-redirect.cpp
-abort_redirect_CPPFLAGS = -DHAVE_CONFIG_H $(AM_CPPFLAGS)
-abort_redirect_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS)
-abort_redirect_LDFLAGS = $(CORE_LD_FLAGS)
-abort_redirect_LDADD = $(CORE_LDADD)
-abort_redirect_DEPENDENCIES = all
-
-
-# special target for testing with valgrind
-valgrind : test
- valgrind --leak-check=yes --suppressions=valgrind.supp ./client-test
-
-# Same solution for rebuilding as in top-level Makefile, see there
-# for further comments.
-$(srcdir)/Makefile.am: check-autotools
- @ true
-.PHONY: check-autotools
-check-autotools:
- @ cd $(top_srcdir) && ( [ ! -e .git ] || ./gen-autotools.sh )
-
-# old-style name for test program(s)
-.PHONY: test
-test: client-test
diff --git a/src/backends/addressbook/Makefile.am b/src/backends/addressbook/Makefile.am
deleted file mode 100644
index ed1aed8f..00000000
--- a/src/backends/addressbook/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncaddressbook.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCADDRESSBOOK_SOURCES = \
- AddressBookSource.h \
- AddressBookConstants.cpp \
- AddressBookSource.cpp
-
-syncaddressbook_la_SOURCES = $(SYNCADDRESSBOOK_SOURCES)
-syncaddressbook_la_LIBADD = $(ADDRESSBOOK_LIBS) $(SYNCEVOLUTION_LIBS)
-syncaddressbook_la_LDFLAGS = -module -avoid-version
-syncaddressbook_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
diff --git a/src/backends/addressbook/addressbook.am b/src/backends/addressbook/addressbook.am
new file mode 100644
index 00000000..260a1c1b
--- /dev/null
+++ b/src/backends/addressbook/addressbook.am
@@ -0,0 +1,24 @@
+dist_noinst_DATA += src/backends/addressbook/configure-sub.in
+
+src_backends_addressbook_lib = src/backends/addressbook/syncaddressbook.la
+MOSTLYCLEANFILES += $(src_backends_addressbook_lib)
+if ENABLE_MODULES
+src_backends_addressbook_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_addressbook_backend_LTLIBRARIES = $(src_backends_addressbook_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_addressbook_lib)
+endif
+
+MAINTAINERCLEANFILES += src/backends/addressbook/Makefile.in
+
+src_backends_addressbook_src = \
+ src/backends/addressbook/AddressBookSource.h \
+ src/backends/addressbook/AddressBookConstants.cpp \
+ src/backends/addressbook/AddressBookSource.cpp
+
+src_backends_addressbook_syncaddressbook_la_SOURCES = $(src_backends_addressbook_src)
+src_backends_addressbook_syncaddressbook_la_LIBADD = $(ADDRESSBOOK_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_addressbook_syncaddressbook_la_LDFLAGS = -module -avoid-version
+src_backends_addressbook_syncaddressbook_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_addressbook_syncaddressbook_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_addressbook_syncaddressbook_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
diff --git a/src/backends/addressbook/configure-sub.in b/src/backends/addressbook/configure-sub.in
index a883b921..879e0afb 100644
--- a/src/backends/addressbook/configure-sub.in
+++ b/src/backends/addressbook/configure-sub.in
@@ -9,9 +9,11 @@ AC_SUBST(ADDRESSBOOK_CFLAGS)
AC_SUBST(ADDRESSBOOK_LIBS)
BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $ADDRESSBOOK_CFLAGS"
-AC_ARG_ENABLE_BACKEND(addressbook, addressbook,
- AS_HELP_STRING([--enable-addressbook], [enable access to Mac OS X address book (default off)]),
- [enable_addressbook="$enableval"], [enable_addressbook="no"])
+SE_ARG_ENABLE_BACKEND(addressbook, addressbook,
+ [AS_HELP_STRING([--enable-addressbook],
+ [enable access to Mac OS X address book (default off)])],
+ [enable_addressbook="$enableval"], [enable_addressbook="no"]
+ )
if test "$enable_addressbook" = "yes"; then
AC_DEFINE(ENABLE_ADDRESSBOOK, 1, [addressbook available])
diff --git a/src/backends/akonadi/Makefile.am b/src/backends/akonadi/Makefile.am
deleted file mode 100644
index 1930154a..00000000
--- a/src/backends/akonadi/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-AM_CPPFLAGS = -I$(srcdir)/../../ -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncakonadi.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-syncakonadi_la_SOURCES = \
- akonadisyncsource.h \
- akonadisyncsource.cpp
-syncakonadi_la_LIBADD = $(KDEPIM_LIBS) ../../syncevo/libsyncevolution.la
-syncakonadi_la_LDFLAGS = -module -avoid-version
-syncakonadi_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
diff --git a/src/backends/akonadi/akonadi.am b/src/backends/akonadi/akonadi.am
new file mode 100644
index 00000000..23b37e77
--- /dev/null
+++ b/src/backends/akonadi/akonadi.am
@@ -0,0 +1,21 @@
+dist_noinst_DATA += \
+ src/backends/akonadi/configure-sub.in \
+ src/backends/akonadi/README
+
+src_backends_akonadi_lib = src/backends/akonadi/syncakonadi.la
+MOSTLYCLEANFILES += $(src_backends_akonadi_lib)
+if ENABLE_MODULES
+src_backends_akonadi_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_akonadi_backend_LTLIBRARIES = $(src_backends_akonadi_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_akonadi_lib)
+endif
+
+src_backends_akonadi_syncakonadi_la_SOURCES = \
+ src/backends/akonadi/akonadisyncsource.h \
+ src/backends/akonadi/akonadisyncsource.cpp
+src_backends_akonadi_syncakonadi_la_LIBADD = $(KDEPIM_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_akonadi_syncakonadi_la_LDFLAGS = -module -avoid-version
+src_backends_akonadi_syncakonadi_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_akonadi_syncakonadi_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_akonadi_syncakonadi_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
diff --git a/src/backends/akonadi/configure-sub.in b/src/backends/akonadi/configure-sub.in
index 5e4516e5..41bb9cfd 100644
--- a/src/backends/akonadi/configure-sub.in
+++ b/src/backends/akonadi/configure-sub.in
@@ -27,11 +27,13 @@ AC_LANG_POP(C++)
# currently considered optional. "configure" will enable it only
# if explicitly enabled (was turned on automatically previously,
# for example on Ubuntu Hardy, and didn't compile).
-AC_ARG_ENABLE_BACKEND(akonadi, akonadi,
- AS_HELP_STRING([--disable-akonadi], [disable access to Akonadi (default is to use it if akonadi.pc is found)]),
+SE_ARG_ENABLE_BACKEND(akonadi, akonadi,
+ [AS_HELP_STRING([--disable-akonadi],
+ [disable access to Akonadi (default is to use it if akonadi.pc is found)])],
[enable_akonadi="$enableval"
test $AKONADIFOUND = "yes" || test $enable_akonadi = "no" || AC_MSG_ERROR([akonadi.pc not found. Install it to compile with the Akonadi backend enabled.])],
- [enable_akonadi=no])
+ [enable_akonadi=no]
+ )
if test "$enable_akonadi" = "yes"; then
# conditional compilation in preprocessor
diff --git a/src/backends/buteo/Makefile.am b/src/backends/buteo/Makefile.am
deleted file mode 100644
index 711a4cb2..00000000
--- a/src/backends/buteo/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-include $(top_srcdir)/m4-repo/autotroll.mk
-
-# "test" only works when compiling as part of SyncEvolution
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(srcdir)/../../../test $(BACKEND_CPPFLAGS)
-EXTRA_DIST = configure-sub.in
-MAINTAINERCLEANFILES = Makefile.in
-
-# directories required by Buteo for plugins and config files
-syncdir = $(libdir)/sync
-profilesdir = $(sysconfdir)/sync
-
-if ENABLE_BUTEO
-nobase_dist_profiles_DATA = \
- profiles/sync/google-calendar.xml \
- profiles/service/google-calendar.xml \
- profiles/sync/google-contacts.xml \
- profiles/service/google-contacts.xml \
- profiles/sync/yahoo.xml \
- profiles/service/yahoo.xml \
- profiles/client/syncevo-buteo.xml
-sync_LTLIBRARIES = libsyncevo-buteo-client.la
-
-BUILT_SOURCES = ButeoBridge.moc.cpp
-
-libsyncevo_buteo_client_la_SOURCES = \
- ButeoBridge.h \
- ButeoBridge.cpp
-nodist_libsyncevo_buteo_client_la_SOURCES = \
- $(BUILT_SOURCES)
-
-libsyncevo_buteo_client_la_LIBADD = $(BUTEO_LIBS) $(QT_LIBS) $(SYNCEVOLUTION_LIBS)
-libsyncevo_buteo_client_la_LDFLAGS = -module -avoid-version $(QT_LDFLAGS)
-libsyncevo_buteo_client_la_CPPFLAGS = $(AM_CPPFLAGS) $(QT_CPPFLAGS)
-
-# Allow Qt to set some compile flags, but not the ones normally set via configure.
-# In particular -W is not compatible with the SyncEvolution header files (we have
-# unused parameters in some inline functions).
-libsyncevo_buteo_client_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(BUTEO_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS))
-endif
diff --git a/src/backends/buteo/buteo.am b/src/backends/buteo/buteo.am
new file mode 100644
index 00000000..88c6967a
--- /dev/null
+++ b/src/backends/buteo/buteo.am
@@ -0,0 +1,33 @@
+# "test" only works when compiling as part of SyncEvolution
+dist_noinst_DATA += \
+ src/backends/buteo/configure-sub.in \
+ src/backends/buteo/README
+
+
+if ENABLE_BUTEO
+include $(top_srcdir)/src/backends/buteo/profiles/profiles.am
+
+# directory required by Buteo for plugins
+src_backends_buteo_syncdir = $(libdir)/sync
+src_backends_buteo_sync_LTLIBRARIES = src/backends/buteo/libsyncevo-buteo-client.la
+
+src_backends_buteo_built_sources = src/backends/buteo/ButeoBridge.moc.cpp
+
+BUILT_SOURCES += $(src_backends_buteo_built_sources)
+
+src_backends_buteo_libsyncevo_buteo_client_la_SOURCES = \
+ src/backends/buteo/ButeoBridge.h \
+ src/backends/buteo/ButeoBridge.cpp
+nodist_src_backends_buteo_libsyncevo_buteo_client_la_SOURCES = \
+ $(src_backends_buteo_built_sources)
+
+src_backends_buteo_libsyncevo_buteo_client_la_LIBADD = $(BUTEO_LIBS) $(QT_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_buteo_libsyncevo_buteo_client_la_LDFLAGS = -module -avoid-version $(QT_LDFLAGS)
+src_backends_buteo_libsyncevo_buteo_client_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS) $(QT_CPPFLAGS)
+src_backends_buteo_libsyncevo_buteo_client_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
+
+# Allow Qt to set some compile flags, but not the ones normally set via configure.
+# In particular -W is not compatible with the SyncEvolution header files (we have
+# unused parameters in some inline functions).
+src_backends_buteo_libsyncevo_buteo_client_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(BUTEO_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
+endif
diff --git a/src/backends/buteo/configure-sub.in b/src/backends/buteo/configure-sub.in
index d0f1029d..8f96c7c2 100644
--- a/src/backends/buteo/configure-sub.in
+++ b/src/backends/buteo/configure-sub.in
@@ -6,9 +6,9 @@ dnl Invoke autogen.sh to produce a configure script.
AC_ARG_ENABLE(buteo,
AS_HELP_STRING([--enable-buteo],
[enable Buteo client plugin]),
- [enable_buteo="$enableval"],
+ [enable_buteo="$enableval"],
[enable_buteo="no"]
- )
+ )
if test "$enable_buteo" = "yes"; then
AC_DEFINE(ENABLE_BUTEO, 1, [Buteo available])
diff --git a/src/backends/buteo/profiles/profiles.am b/src/backends/buteo/profiles/profiles.am
new file mode 100644
index 00000000..6eca237b
--- /dev/null
+++ b/src/backends/buteo/profiles/profiles.am
@@ -0,0 +1,21 @@
+# TODO: preferably generate this list instead
+# $(sysconfdir)/sync is directory required by Buteo for config files
+# client
+src_backends_buteo_profiles_clientdir = $(sysconfdir)/sync/profiles/client
+dist_src_backends_buteo_profiles_client_DATA = \
+ src/backends/buteo/profiles/client/syncevo-buteo.xml
+# $(wildcard src/backends/buteo/profiles/client/*.xml)
+# service
+src_backends_buteo_profiles_servicedir = $(sysconfdir)/sync/profiles/service
+dist_src_backends_buteo_profiles_service_DATA = \
+ src/backends/buteo/profiles/service/google-calendar.xml \
+ src/backends/buteo/profiles/service/google-contacts.xml \
+ src/backends/buteo/profiles/service/yahoo.xml
+# $(wildcard src/backends/buteo/profiles/service/*.xml)
+# sync
+src_backends_buteo_profiles_syncdir = $(sysconfdir)/sync/profiles/sync
+dist_src_backends_buteo_profiles_sync_DATA = \
+ src/backends/buteo/profiles/sync/google-calendar.xml \
+ src/backends/buteo/profiles/sync/google-contacts.xml \
+ src/backends/buteo/profiles/sync/yahoo.xml
+# $(wildcard src/backends/buteo/profiles/sync/*.xml)
diff --git a/src/backends/evolution/Makefile.am b/src/backends/evolution/Makefile.am
deleted file mode 100644
index 38e8f085..00000000
--- a/src/backends/evolution/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncecal.la syncebook.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCECAL_SOURCES = \
- EvolutionSyncSource.h \
- EvolutionSyncSource.cpp \
- EvolutionCalendarSource.h \
- EvolutionMemoSource.h \
- EvolutionCalendarSource.cpp \
- EvolutionMemoSource.cpp
-
-if ENABLE_ECAL
-SYNCECAL_SOURCES += \
- e-cal-check-timezones.c \
- e-cal-check-timezones.h
-endif
-
-SYNCEBOOK_SOURCES = \
- EvolutionSyncSource.h \
- EvolutionSyncSource.cpp \
- EvolutionContactSource.h \
- EvolutionContactSource.cpp
-
-syncecal_la_SOURCES = $(SYNCECAL_SOURCES)
-syncecal_la_LIBADD = $(ECAL_LIBS) $(SYNCEVOLUTION_LIBS)
-# _GNU_SOURCE and -ldl for libical.c + dlsym():
-syncecal_la_CPPFLAGS = -D_GNU_SOURCE \
- -De_cal_check_timezones=syncevolution_check_timezones \
- -De_cal_tzlookup_ecal=syncevolution_tzlookup_ecal \
- -De_cal_tzlookup_icomp=syncevolution_tzlookup_icomp \
- -De_cal_match_tzid=syncevolution_match_tzid \
- $(AM_CPPFLAGS)
-syncecal_la_LDFLAGS = -module -avoid-version -ldl
-syncecal_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
-
-syncebook_la_SOURCES = $(SYNCEBOOK_SOURCES)
-syncebook_la_LIBADD = $(EBOOK_LIBS) $(SYNCEVOLUTION_LIBS)
-syncebook_la_LDFLAGS = -module -avoid-version
-syncebook_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
diff --git a/src/backends/evolution/configure-sub.in b/src/backends/evolution/configure-sub.in
index 51fe0e30..29730217 100644
--- a/src/backends/evolution/configure-sub.in
+++ b/src/backends/evolution/configure-sub.in
@@ -50,16 +50,20 @@ if test "x${EBOOKFOUND}" = "xno"; then
fi
fi
-AC_ARG_ENABLE_BACKEND(ebook, evolution,
- AS_HELP_STRING([--disable-ebook], [disable access to Evolution addressbooks (must be used to compile without it)]),
+SE_ARG_ENABLE_BACKEND(ebook, evolution,
+ [AS_HELP_STRING([--disable-ebook],
+ [disable access to Evolution addressbooks (must be used to compile without it)])],
[enable_ebook="$enableval"],
[test "$EBOOKFOUND" = "yes" && enable_ebook="yes" ||
- AC_MSG_ERROR([libebook not found. Use --disable-ebook to compile without or install the necessary development files.])])
-AC_ARG_ENABLE_BACKEND(ecal, evolution,
- AS_HELP_STRING([--disable-ecal], [disable access to Evolution calendars and tasks (must be used to compile without it)]),
+ AC_MSG_ERROR([libebook not found. Use --disable-ebook to compile without or install the necessary development files.])]
+ )
+SE_ARG_ENABLE_BACKEND(ecal, evolution,
+ [AS_HELP_STRING([--disable-ecal],
+ [disable access to Evolution calendars and tasks (must be used to compile without it)])],
[enable_ecal="$enableval"],
[test "$ECALFOUND" = "yes" && enable_ecal="yes" ||
- AC_MSG_ERROR([libecal not found. Use --disable-ecal to compile without or install the necessary development files.])])
+ AC_MSG_ERROR([libecal not found. Use --disable-ecal to compile without or install the necessary development files.])]
+ )
enable_evo="no"
if test "$enable_ebook" = "yes"; then
diff --git a/src/backends/evolution/evolution.am b/src/backends/evolution/evolution.am
new file mode 100644
index 00000000..d5b7ddb8
--- /dev/null
+++ b/src/backends/evolution/evolution.am
@@ -0,0 +1,56 @@
+dist_noinst_DATA += src/backends/evolution/configure-sub.in
+
+src_backends_evolution_lib = src/backends/evolution/syncecal.la src/backends/evolution/syncebook.la
+MOSTLYCLEANFILES += $(src_backends_evolution_lib)
+if ENABLE_MODULES
+src_backends_evolution_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_evolution_backend_LTLIBRARIES = $(src_backends_evolution_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_evolution_lib)
+endif
+
+src_backends_evolution_syncecal_src = \
+ src/backends/evolution/EvolutionSyncSource.h \
+ src/backends/evolution/EvolutionSyncSource.cpp \
+ src/backends/evolution/EvolutionCalendarSource.h \
+ src/backends/evolution/EvolutionMemoSource.h \
+ src/backends/evolution/EvolutionCalendarSource.cpp \
+ src/backends/evolution/EvolutionMemoSource.cpp
+
+if ENABLE_ECAL
+src_backends_evolution_syncecal_src += \
+ src/backends/evolution/e-cal-check-timezones.c \
+ src/backends/evolution/e-cal-check-timezones.h
+endif
+
+src_backends_evolution_syncebook_src = \
+ src/backends/evolution/EvolutionSyncSource.h \
+ src/backends/evolution/EvolutionSyncSource.cpp \
+ src/backends/evolution/EvolutionContactSource.h \
+ src/backends/evolution/EvolutionContactSource.cpp
+
+src_backends_evolution_cppflags = \
+ $(SYNCEVOLUTION_CFLAGS) \
+ -I$(top_srcdir)/test \
+ $(BACKEND_CPPFLAGS) \
+ -I$(top_srcdir)/src/backends/evolution
+
+src_backends_evolution_syncecal_la_SOURCES = $(src_backends_evolution_syncecal_src)
+src_backends_evolution_syncecal_la_LIBADD = $(ECAL_LIBS) $(SYNCEVOLUTION_LIBS)
+# _GNU_SOURCE and -ldl for libical.c + dlsym():
+src_backends_evolution_syncecal_la_CPPFLAGS = -D_GNU_SOURCE \
+ -De_cal_check_timezones=syncevolution_check_timezones \
+ -De_cal_tzlookup_ecal=syncevolution_tzlookup_ecal \
+ -De_cal_tzlookup_icomp=syncevolution_tzlookup_icomp \
+ -De_cal_match_tzid=syncevolution_match_tzid \
+ $(src_backends_evolution_cppflags)
+src_backends_evolution_syncecal_la_LDFLAGS = -module -avoid-version -ldl
+src_backends_evolution_syncecal_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_evolution_syncecal_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
+
+src_backends_evolution_syncebook_la_SOURCES = $(src_backends_evolution_syncebook_src)
+src_backends_evolution_syncebook_la_LIBADD = $(EBOOK_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_evolution_syncebook_la_LDFLAGS = -module -avoid-version
+src_backends_evolution_syncebook_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_evolution_syncebook_la_CPPFLAGS = $(src_backends_evolution_cppflags)
+src_backends_evolution_syncebook_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
diff --git a/src/backends/file/Makefile.am b/src/backends/file/Makefile.am
deleted file mode 100644
index fa56ff13..00000000
--- a/src/backends/file/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncfile.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCFILE_SOURCES = \
- FileSyncSource.h \
- FileSyncSource.cpp
-
-syncfile_la_SOURCES = $(SYNCFILE_SOURCES)
-syncfile_la_LIBADD = $(FILE_LIBS) $(SYNCEVOLUTION_LIBS)
-syncfile_la_LDFLAGS = -module -avoid-version
-syncfile_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
-# If you need special test cases for your sync source, then
-# install them here. Here's how the sqlite backend does that:
-#
-#../../testcases/sqlite_vcard21.vcf: $(FUNAMBOL_SUBDIR)/test/test/testcases/vcard21.vcf
-# mkdir -p ${@D}
-# perl -e '$$_ = join("", <>); s/^(ADR|TEL|EMAIL|PHOTO).*?(?=^\S)//msg; s/;X-EVOLUTION-UI-SLOT=\d+//g; print;' $< >$@
-#all: ../../testcases/sqlite_vcard21.vcf
diff --git a/src/backends/file/configure-sub.in b/src/backends/file/configure-sub.in
index a2bbf78f..fa51bb0f 100644
--- a/src/backends/file/configure-sub.in
+++ b/src/backends/file/configure-sub.in
@@ -22,13 +22,13 @@ dnl name of the directory,
dnl help string,
dnl --enable/disable chosen explicitly
dnl default, may depend on availability of prerequisites in more complex backends
-AC_ARG_ENABLE_BACKEND(file,
+SE_ARG_ENABLE_BACKEND(file,
file,
- AS_HELP_STRING([--disable-file],
- [disable file-based backend which stores items in separate files in a fixed directory (default on)]),
- [enable_file="$enableval"],
+ [AS_HELP_STRING([--disable-file],
+ [disable file-based backend which stores items in separate files in a fixed directory (default on)])],
+ [enable_file="$enableval"],
[enable_file="yes"]
- )
+ )
if test "$enable_file" = "yes"; then
dnl It's good to check the prerequisites here, in case --enable-file was used.
diff --git a/src/backends/file/file.am b/src/backends/file/file.am
new file mode 100644
index 00000000..9ecb2ed3
--- /dev/null
+++ b/src/backends/file/file.am
@@ -0,0 +1,28 @@
+dist_noinst_DATA += src/backends/file/configure-sub.in
+
+src_backends_file_lib = src/backends/file/syncfile.la
+MOSTLYCLEANFILES += $(src_backends_file_lib)
+if ENABLE_MODULES
+src_backends_file_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_file_backend_LTLIBRARIES = $(src_backends_file_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_file_lib)
+endif
+
+src_backends_file_src = \
+ src/backends/file/FileSyncSource.h \
+ src/backends/file/FileSyncSource.cpp
+
+src_backends_file_syncfile_la_SOURCES = $(src_backends_file_src)
+src_backends_file_syncfile_la_LIBADD = $(FILE_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_file_syncfile_la_LDFLAGS = -module -avoid-version
+src_backends_file_syncfile_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_file_syncfile_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_file_syncfile_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
+# If you need special test cases for your sync source, then
+# install them here. Here's how the sqlite backend does that:
+#
+#../../testcases/sqlite_vcard21.vcf: $(FUNAMBOL_SUBDIR)/test/test/testcases/vcard21.vcf
+# mkdir -p ${@D}
+# perl -e '$$_ = join("", <>); s/^(ADR|TEL|EMAIL|PHOTO).*?(?=^\S)//msg; s/;X-EVOLUTION-UI-SLOT=\d+//g; print;' $< >$@
+#all: ../../testcases/sqlite_vcard21.vcf
diff --git a/src/backends/kcalextended/Makefile.am b/src/backends/kcalextended/Makefile.am
deleted file mode 100644
index 66f23798..00000000
--- a/src/backends/kcalextended/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-include $(top_srcdir)/m4-repo/autotroll.mk
-
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = synckcalextended.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-synckcalextended_la_SOURCES = \
- KCalExtendedSource.h \
- KCalExtendedSource.cpp
-synckcalextended_la_LIBADD = $(KCALEXTENDED_LIBS) $(SYNCEVOLUTION_LIBS)
-synckcalextended_la_LDFLAGS = -module -avoid-version
-synckcalextended_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(KCALEXTENDED_CFLAGS)
diff --git a/src/backends/kcalextended/configure-sub.in b/src/backends/kcalextended/configure-sub.in
index 96759f21..38614160 100644
--- a/src/backends/kcalextended/configure-sub.in
+++ b/src/backends/kcalextended/configure-sub.in
@@ -3,13 +3,13 @@ dnl Invoke autogen.sh to produce a configure script.
# BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS ..."
-AC_ARG_ENABLE_BACKEND(kcalextended,
+SE_ARG_ENABLE_BACKEND(kcalextended,
kcalextended,
- AS_HELP_STRING([--enable-kcalextended],
- [enable support for Maemo's KCalExtended storage]),
- [enable_kcalextended="$enableval"],
+ [AS_HELP_STRING([--enable-kcalextended],
+ [enable support for Maemo's KCalExtended storage])],
+ [enable_kcalextended="$enableval"],
[enable_kcalextended="no"]
- )
+ )
if test "$enable_kcalextended" = "yes"; then
AC_DEFINE(ENABLE_KCALEXTENDED, 1, [KCalExtended available])
diff --git a/src/backends/kcalextended/kcalextended.am b/src/backends/kcalextended/kcalextended.am
new file mode 100644
index 00000000..ef1ab6d3
--- /dev/null
+++ b/src/backends/kcalextended/kcalextended.am
@@ -0,0 +1,19 @@
+dist_noinst_DATA += src/backends/kcalextended/configure-sub.in
+
+src_backends_kcalextended_lib = src/backends/kcalextended/synckcalextended.la
+MOSTLYCLEANFILES += $(src_backends_kcalextended_lib)
+if ENABLE_MODULES
+src_backends_kcalextended_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_kcalextended_backend_LTLIBRARIES = $(src_backends_kcalextended_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_kcalextended_lib)
+endif
+
+src_backends_kcalextended_synckcalextended_la_SOURCES = \
+ src/backends/kcalextended/KCalExtendedSource.h \
+ src/backends/kcalextended/KCalExtendedSource.cpp
+src_backends_kcalextended_synckcalextended_la_LIBADD = $(KCALEXTENDED_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_kcalextended_synckcalextended_la_LDFLAGS = -module -avoid-version
+src_backends_kcalextended_synckcalextended_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(KCALEXTENDED_CFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_kcalextended_synckcalextended_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_kcalextended_synckcalextended_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
diff --git a/src/backends/maemo/Makefile.am b/src/backends/maemo/Makefile.am
deleted file mode 100644
index e156bf68..00000000
--- a/src/backends/maemo/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncmaemocal.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCMAEMOCAL_SOURCES = \
- MaemoCalendarSource.h \
- MaemoCalendarSource.cpp
-
-syncmaemocal_la_SOURCES = $(SYNCMAEMOCAL_SOURCES)
-syncmaemocal_la_LIBADD = $(MCALB_LIBS) $(SYNCEVOLUTION_LIBS)
-syncmaemocal_la_LDFLAGS = -module -avoid-version
-syncmaemocal_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
diff --git a/src/backends/maemo/configure-sub.in b/src/backends/maemo/configure-sub.in
index a5f5d215..09771034 100644
--- a/src/backends/maemo/configure-sub.in
+++ b/src/backends/maemo/configure-sub.in
@@ -7,12 +7,13 @@ AC_SUBST(MCALB_CFLAGS)
AC_SUBST(MCALB_LIBS)
BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $MCALB_CFLAGS"
-AC_ARG_ENABLE_BACKEND(maemocal, maemo,
- AS_HELP_STRING([--enable-maemo-calendar],
- [enable access to PIM data stored in Maemo 5 calendar application (default off)]),
- [enable_maemocal="$enableval"], [enable_maemocal="no"])
+SE_ARG_ENABLE_BACKEND(maemocal, maemo,
+ [AS_HELP_STRING([--enable-maemocal],
+ [enable access to PIM data stored in Maemo 5 calendar application (default off)])],
+ [enable_maemocal="$enableval"], [enable_maemocal="no"]
+ )
if test "$enable_maemocal" = "yes"; then
- test "x${MCALBFOUND}" = "xyes" || AC_MSG_ERROR([--enable-maemo-calendar requires pkg-config information for calendar-backend, which was not found])
+ test "x${MCALBFOUND}" = "xyes" || AC_MSG_ERROR([--enable-maemocal requires pkg-config information for calendar-backend, which was not found])
AC_DEFINE(ENABLE_MAEMO_CALENDAR, 1, [Maemo 5 calendar available])
fi
diff --git a/src/backends/maemo/maemo.am b/src/backends/maemo/maemo.am
new file mode 100644
index 00000000..922f94d3
--- /dev/null
+++ b/src/backends/maemo/maemo.am
@@ -0,0 +1,21 @@
+dist_noinst_DATA += src/backends/maemo/configure-sub.in
+
+src_backends_maemo_lib = src/backends/maemo/syncmaemocal.la
+MOSTLYCLEANFILES += $(src_backends_maemo_lib)
+if ENABLE_MODULES
+src_backends_maemo_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_maemo_backend_LTLIBRARIES = $(src_backends_maemo_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_maemo_lib)
+endif
+
+src_backends_maemo_src = \
+ src/backends/maemo/MaemoCalendarSource.h \
+ src/backends/maemo/MaemoCalendarSource.cpp
+
+src_backends_maemo_syncmaemocal_la_SOURCES = $(src_backends_maemo_src)
+src_backends_maemo_syncmaemocal_la_LIBADD = $(MCALB_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_maemo_syncmaemocal_la_LDFLAGS = -module -avoid-version
+src_backends_maemo_syncmaemocal_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_maemo_syncmaemocal_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_maemo_syncmaemocal_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
diff --git a/src/backends/qtcontacts/Makefile.am b/src/backends/qtcontacts/Makefile.am
deleted file mode 100644
index 60a336b2..00000000
--- a/src/backends/qtcontacts/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-include $(top_srcdir)/m4-repo/autotroll.mk
-
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncqtcontacts.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-syncqtcontacts_la_SOURCES = \
- QtContactsSource.h \
- QtContactsSource.cpp
-
-syncqtcontacts_la_LIBADD = $(QT_CONTACTS_LIBS) $(QT_LIBS) $(SYNCEVOLUTION_LIBS)
-syncqtcontacts_la_LDFLAGS = -module -avoid-version $(QT_LDFLAGS)
-syncqtcontacts_la_CPPFLAGS = $(AM_CPPFLAGS) $(QT_CPPFLAGS)
-# Allow Qt to set some compile flags, but not the ones normally set via configure.
-# In particular -W is not compatible with the SyncEvolution header files (we have
-# unused parameters in some inline functions).
-syncqtcontacts_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS))
diff --git a/src/backends/qtcontacts/configure-sub.in b/src/backends/qtcontacts/configure-sub.in
index 2a6f80d6..7f595a9c 100644
--- a/src/backends/qtcontacts/configure-sub.in
+++ b/src/backends/qtcontacts/configure-sub.in
@@ -3,13 +3,13 @@ dnl Invoke autogen.sh to produce a configure script.
# BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS ..."
-AC_ARG_ENABLE_BACKEND(qtcontacts,
+SE_ARG_ENABLE_BACKEND(qtcontacts,
qtcontacts,
- AS_HELP_STRING([--enable-qtcontacts],
- [enable support for QtMobility's QtContacts storage]),
- [enable_qtcontacts="$enableval"],
+ [AS_HELP_STRING([--enable-qtcontacts],
+ [enable support for QtMobility's QtContacts storage])],
+ [enable_qtcontacts="$enableval"],
[enable_qtcontacts="no"]
- )
+ )
if test "$enable_qtcontacts" = "yes"; then
AC_DEFINE(ENABLE_QTCONTACTS, 1, [QtContacts available])
diff --git a/src/backends/qtcontacts/qtcontacts.am b/src/backends/qtcontacts/qtcontacts.am
new file mode 100644
index 00000000..4fb71024
--- /dev/null
+++ b/src/backends/qtcontacts/qtcontacts.am
@@ -0,0 +1,22 @@
+dist_noinst_DATA += src/backends/qtcontacts/configure-sub.in
+
+src_backends_qtcontacts_lib = src/backends/qtcontacts/syncqtcontacts.la
+MOSTLYCLEANFILES += $(src_backends_qtcontacts_lib)
+if ENABLE_MODULES
+src_backends_qtcontacts_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_qtcontacts_backend_LTLIBRARIES = $(src_backends_qtcontacts_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_qtcontacts_lib)
+endif
+
+src_backends_qtcontacts_syncqtcontacts_la_SOURCES = \
+ src/backends/qtcontacts/QtContactsSource.h \
+ src/backends/qtcontacts/QtContactsSource.cpp
+src_backends_qtcontacts_syncqtcontacts_la_LIBADD = $(QT_CONTACTS_LIBS) $(QT_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_qtcontacts_syncqtcontacts_la_LDFLAGS = -module -avoid-version $(QT_LDFLAGS)
+src_backends_qtcontacts_syncqtcontacts_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS) $(QT_CPPFLAGS)
+src_backends_qtcontacts_syncqtcontacts_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
+# Allow Qt to set some compile flags, but not the ones normally set via configure.
+# In particular -W is not compatible with the SyncEvolution header files (we have
+# unused parameters in some inline functions).
+src_backends_qtcontacts_syncqtcontacts_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
diff --git a/src/backends/sqlite/Makefile.am b/src/backends/sqlite/Makefile.am
deleted file mode 100644
index a4b5b063..00000000
--- a/src/backends/sqlite/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncsqlite.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCSQLITE_SOURCES = \
- SQLiteUtil.h \
- SQLiteUtil.cpp \
- SQLiteContactSource.h \
- SQLiteContactSource.cpp
-
-syncsqlite_la_SOURCES = $(SYNCSQLITE_SOURCES)
-syncsqlite_la_LIBADD = $(SQLITE_LIBS) $(SYNCEVOLUTION_LIBS)
-syncsqlite_la_LDFLAGS = -module -avoid-version
-syncsqlite_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
-
-# SQLiteContactSource does not support all fields from Funambol vCard 2.1
-# test cases: filter them out before testing
-#../../testcases/sqlite_vcard21.vcf: $(FUNAMBOL_SUBDIR)/test/test/testcases/vcard21.vcf
-# mkdir -p ${@D}
-# perl -e '$$_ = join("", <>); s/^(ADR|TEL|EMAIL|PHOTO).*?(?=^\S)//msg; s/;X-EVOLUTION-UI-SLOT=\d+//g; print;' $< >$@
-# all: ../../testcases/sqlite_vcard21.vcf
diff --git a/src/backends/sqlite/configure-sub.in b/src/backends/sqlite/configure-sub.in
index e3cb22bd..24a3d832 100644
--- a/src/backends/sqlite/configure-sub.in
+++ b/src/backends/sqlite/configure-sub.in
@@ -7,9 +7,11 @@ AC_SUBST(SQLITE_CFLAGS)
AC_SUBST(SQLITE_LIBS)
BACKEND_CPPFLAGS="$BACKEND_CPPFLAGS $SQLITE_CFLAGS"
-AC_ARG_ENABLE_BACKEND(sqlite, sqlite,
- AS_HELP_STRING([--enable-sqlite], [enable access to PIM data stored in SQLite files (experimental, default off)]),
- [enable_sqlite="$enableval"], [enable_sqlite="no"])
+SE_ARG_ENABLE_BACKEND(sqlite, sqlite,
+ [AS_HELP_STRING([--enable-sqlite],
+ [enable access to PIM data stored in SQLite files (experimental, default off)])],
+ [enable_sqlite="$enableval"], [enable_sqlite="no"]
+ )
if test "$enable_sqlite" = "yes"; then
test "x${SQLITEFOUND}" = "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])
diff --git a/src/backends/sqlite/sqlite.am b/src/backends/sqlite/sqlite.am
new file mode 100644
index 00000000..041744cf
--- /dev/null
+++ b/src/backends/sqlite/sqlite.am
@@ -0,0 +1,32 @@
+dist_noinst_DATA += \
+ src/backends/sqlite/configure-sub.in \
+ src/backends/sqlite/README
+
+src_backends_sqlite_lib = src/backends/sqlite/syncsqlite.la
+MOSTLYCLEANFILES += $(src_backends_sqlite_lib)
+if ENABLE_MODULES
+src_backends_sqlite_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_sqlite_backend_LTLIBRARIES = $(src_backends_sqlite_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_sqlite_lib)
+endif
+
+src_backends_sqlite_src = \
+ src/backends/sqlite/SQLiteUtil.h \
+ src/backends/sqlite/SQLiteUtil.cpp \
+ src/backends/sqlite/SQLiteContactSource.h \
+ src/backends/sqlite/SQLiteContactSource.cpp
+
+src_backends_sqlite_syncsqlite_la_SOURCES = $(src_backends_sqlite_src)
+src_backends_sqlite_syncsqlite_la_LIBADD = $(SQLITE_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_sqlite_syncsqlite_la_LDFLAGS = -module -avoid-version
+src_backends_sqlite_syncsqlite_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_sqlite_syncsqlite_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS) -I$(top_srcdir)/src/backends/sqlite
+src_backends_sqlite_syncsqlite_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
+
+# SQLiteContactSource does not support all fields from Funambol vCard 2.1
+# test cases: filter them out before testing
+#../../testcases/sqlite_vcard21.vcf: $(FUNAMBOL_SUBDIR)/test/test/testcases/vcard21.vcf
+# mkdir -p ${@D}
+# perl -e '$$_ = join("", <>); s/^(ADR|TEL|EMAIL|PHOTO).*?(?=^\S)//msg; s/;X-EVOLUTION-UI-SLOT=\d+//g; print;' $< >$@
+# all: ../../testcases/sqlite_vcard21.vcf
diff --git a/src/backends/webdav/Makefile.am b/src/backends/webdav/Makefile.am
deleted file mode 100644
index 51c673aa..00000000
--- a/src/backends/webdav/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-# "test" only works when compiling as part of SyncEvolution
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in WebDAVSourceRegister.cpp
-CLEANFILES =
-bin_SCRIPTS =
-
-SYNCSOURCES = syncdav.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-EXTRA_DIST += syncevo-webdav-lookup.sh
-bin_SCRIPTS += syncevo-webdav-lookup
-CLEANFILES += syncevo-webdav-lookup
-
-syncevo-webdav-lookup: syncevo-webdav-lookup.sh
- rm -f $@
- ln -s $< $@
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCDAV_SOURCES = \
- CalDAVSource.h \
- CalDAVSource.cpp \
- CardDAVSource.h \
- CardDAVSource.cpp \
- WebDAVSource.h \
- WebDAVSource.cpp \
- NeonCXX.h \
- NeonCXX.cpp
-
-syncdav_la_SOURCES = $(SYNCDAV_SOURCES)
-syncdav_la_LIBADD = $(NEON_LIBS) $(SYNCEVOLUTION_LIBS)
-syncdav_la_LDFLAGS = -module -avoid-version
-syncdav_la_CXXFLAGS = $(NEON_CFLAGS)
diff --git a/src/backends/webdav/configure-sub.in b/src/backends/webdav/configure-sub.in
index e9e013c2..ab42b61a 100644
--- a/src/backends/webdav/configure-sub.in
+++ b/src/backends/webdav/configure-sub.in
@@ -1,13 +1,13 @@
dnl -*- mode: Autoconf; -*-
dnl Invoke autogen.sh to produce a configure script.
-AC_ARG_ENABLE_BACKEND(dav,
+SE_ARG_ENABLE_BACKEND(dav,
webdav,
- AS_HELP_STRING([--enable-dav],
- [enable WebDAV based backends (CalDAV) (default off)]),
- [enable_dav="$enableval"],
+ [AS_HELP_STRING([--enable-dav],
+ [enable WebDAV based backends (CalDAV) (default off)])],
+ [enable_dav="$enableval"],
[enable_dav="no"]
- )
+ )
if test "$enable_dav" = "yes"; then
PKG_CHECK_MODULES(LIBICAL, libical,
diff --git a/src/backends/webdav/webdav.am b/src/backends/webdav/webdav.am
new file mode 100644
index 00000000..bbde9348
--- /dev/null
+++ b/src/backends/webdav/webdav.am
@@ -0,0 +1,38 @@
+dist_noinst_DATA += \
+ src/backends/webdav/configure-sub.in \
+ src/backends/webdav/WebDAVSourceRegister.cpp \
+ src/backends/webdav/syncevo-webdav-lookup.sh \
+ src/backends/webdav/README
+
+src_backends_webdav_lib = src/backends/webdav/syncdav.la
+MOSTLYCLEANFILES += $(src_backends_webdav_lib)
+if ENABLE_MODULES
+src_backends_webdav_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_webdav_backend_LTLIBRARIES = $(src_backends_webdav_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_webdav_lib)
+endif
+
+bin_SCRIPTS += src/backends/webdav/syncevo-webdav-lookup
+CLEANFILES += src/backends/webdav/syncevo-webdav-lookup
+
+src/backends/webdav/syncevo-webdav-lookup: src/backends/webdav/syncevo-webdav-lookup.sh
+ $(AM_V_GEN)rm -f $@ ; \
+ ln -s $(notdir $<) $@
+
+src_backends_webdav_src = \
+ src/backends/webdav/CalDAVSource.h \
+ src/backends/webdav/CalDAVSource.cpp \
+ src/backends/webdav/CardDAVSource.h \
+ src/backends/webdav/CardDAVSource.cpp \
+ src/backends/webdav/WebDAVSource.h \
+ src/backends/webdav/WebDAVSource.cpp \
+ src/backends/webdav/NeonCXX.h \
+ src/backends/webdav/NeonCXX.cpp
+
+src_backends_webdav_syncdav_la_SOURCES = $(src_backends_webdav_src)
+src_backends_webdav_syncdav_la_LIBADD = $(NEON_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_webdav_syncdav_la_LDFLAGS = -module -avoid-version
+src_backends_webdav_syncdav_la_CXXFLAGS = $(NEON_CFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_webdav_syncdav_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_webdav_syncdav_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
diff --git a/src/backends/xmlrpc/Makefile.am b/src/backends/xmlrpc/Makefile.am
deleted file mode 100644
index 5d7e2484..00000000
--- a/src/backends/xmlrpc/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-SYNCSOURCES = syncxmlrpc.la
-MOSTLYCLEANFILES = $(SYNCSOURCES)
-if ENABLE_MODULES
-backend_LTLIBRARIES = $(SYNCSOURCES)
-else
-noinst_LTLIBRARIES = $(SYNCSOURCES)
-endif
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SYNCXMLRPC_SOURCES = \
- XMLRPCSyncSource.h \
- XMLRPCSyncSource.cpp
-
-syncxmlrpc_la_SOURCES = $(SYNCXMLRPC_SOURCES)
-syncxmlrpc_la_LIBADD = $(XMLRPC_LIBS) $(SYNCEVOLUTION_LIBS)
-syncxmlrpc_la_LDFLAGS = -module -avoid-version
-syncxmlrpc_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS)
-# If you need special test cases for your sync source, then
-# install them here. Here's how the sqlite backend does that:
-#
-#../../testcases/sqlite_vcard21.vcf: $(FUNAMBOL_SUBDIR)/test/test/testcases/vcard21.vcf
-# mkdir -p ${@D}
-# perl -e '$$_ = join("", <>); s/^(ADR|TEL|EMAIL|PHOTO).*?(?=^\S)//msg; s/;X-EVOLUTION-UI-SLOT=\d+//g; print;' $< >$@
-#all: ../../testcases/sqlite_vcard21.vcf
diff --git a/src/backends/xmlrpc/configure-sub.in b/src/backends/xmlrpc/configure-sub.in
index 7f6b8603..19fb1768 100644
--- a/src/backends/xmlrpc/configure-sub.in
+++ b/src/backends/xmlrpc/configure-sub.in
@@ -16,22 +16,24 @@ dnl name of the directory,
dnl help string,
dnl --enable/disable chosen explicitly
dnl default, may depend on availability of prerequisites in more complex backends
-AC_ARG_ENABLE_BACKEND(xmlrpc,
+SE_ARG_ENABLE_BACKEND(xmlrpc,
xmlrpc,
- AS_HELP_STRING([--enable-xmlrpc],
- [enable XMLRPC-based backend which stores items on a central web service (default off)]),
- [enable_xmlrpc="$enableval"],
+ [AS_HELP_STRING([--enable-xmlrpc],
+ [enable XMLRPC-based backend which stores items on a central web service (default off)])],
+ [enable_xmlrpc="$enableval"],
[enable_xmlrpc="no"]
- )
+ )
if test "$enable_xmlrpc" = "yes"; then
dnl It's good to check the prerequisites here, in case --enable-xmlrpc was used.
dnl test "x${SQLITEFOUND}" = "xyes" || AC_MSG_ERROR([--enable-sqlite requires pkg-config information for sqlite3, which was not found])
-
- test -e /usr/bin/xmlrpc-c-config || AC_MSG_ERROR([--enable-xmlrpc requires xmlrpc-c-config, which was not found])
-
- XMLRPC_CFLAGS=`/usr/bin/xmlrpc-c-config c++2 client --cflags`
- XMLRPC_LIBS=`/usr/bin/xmlrpc-c-config c++2 client --libs`
+
+ AC_PATH_PROG([XMLRPC_C_CONFIG], [xmlrpc-c-config], [no])
+
+ test "x$XMLRPC_C_CONFIG" != 'xno' || AC_MSG_ERROR([--enable-xmlrpc requires xmlrpc-c-config, which was not found])
+
+ XMLRPC_CFLAGS=`$XMLRPC_C_CONFIG c++2 client --cflags`
+ XMLRPC_LIBS=`$XMLRPC_C_CONFIG c++2 client --libs`
AC_SUBST(XMLRPC_CFLAGS)
AC_SUBST(XMLRPC_LIBS)
diff --git a/src/backends/xmlrpc/xmlrpc.am b/src/backends/xmlrpc/xmlrpc.am
new file mode 100644
index 00000000..58435a24
--- /dev/null
+++ b/src/backends/xmlrpc/xmlrpc.am
@@ -0,0 +1,30 @@
+dist_noinst_DATA += \
+ src/backends/xmlrpc/configure-sub.in \
+ src/backends/xmlrpc/README
+
+src_backends_xmlrpc_lib = src/backends/xmlrpc/syncxmlrpc.la
+MOSTLYCLEANFILES += $(src_backends_xmlrpc_lib)
+if ENABLE_MODULES
+src_backends_xmlrpc_backenddir = $(BACKENDS_DIRECTORY)
+src_backends_xmlrpc_backend_LTLIBRARIES = $(src_backends_xmlrpc_lib)
+else
+noinst_LTLIBRARIES += $(src_backends_xmlrpc_lib)
+endif
+
+src_backends_xmlrpc_src = \
+ src/backends/xmlrpc/XMLRPCSyncSource.h \
+ src/backends/xmlrpc/XMLRPCSyncSource.cpp
+
+src_backends_xmlrpc_syncxmlrpc_la_SOURCES = $(src_backends_xmlrpc_src)
+src_backends_xmlrpc_syncxmlrpc_la_LIBADD = $(XMLRPC_LIBS) $(SYNCEVOLUTION_LIBS)
+src_backends_xmlrpc_syncxmlrpc_la_LDFLAGS = -module -avoid-version
+src_backends_xmlrpc_syncxmlrpc_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_backends_xmlrpc_syncxmlrpc_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
+src_backends_xmlrpc_syncxmlrpc_la_DEPENDENCIES = $(SYNCEVOLUTION_LIBS)
+# If you need special test cases for your sync source, then
+# install them here. Here's how the sqlite backend does that:
+#
+#../../testcases/sqlite_vcard21.vcf: $(FUNAMBOL_SUBDIR)/test/test/testcases/vcard21.vcf
+# mkdir -p ${@D}
+# perl -e '$$_ = join("", <>); s/^(ADR|TEL|EMAIL|PHOTO).*?(?=^\S)//msg; s/;X-EVOLUTION-UI-SLOT=\d+//g; print;' $< >$@
+#all: ../../testcases/sqlite_vcard21.vcf
diff --git a/src/dbus/.gitignore b/src/dbus/.gitignore
deleted file mode 100644
index 57fee9fd..00000000
--- a/src/dbus/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/syncevo-dbus.pc
diff --git a/src/dbus/Makefile.am b/src/dbus/Makefile.am
deleted file mode 100644
index aefccec9..00000000
--- a/src/dbus/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = interfaces glib qt server
diff --git a/src/dbus/dbus.am b/src/dbus/dbus.am
new file mode 100644
index 00000000..3e5cdd3b
--- /dev/null
+++ b/src/dbus/dbus.am
@@ -0,0 +1,4 @@
+include $(top_srcdir)/src/dbus/interfaces/interfaces.am
+include $(top_srcdir)/src/dbus/glib/glib.am
+include $(top_srcdir)/src/dbus/qt/qt.am
+include $(top_srcdir)/src/dbus/server/server.am
diff --git a/src/dbus/glib/Makefile.am b/src/dbus/glib/Makefile.am
deleted file mode 100644
index 4112d954..00000000
--- a/src/dbus/glib/Makefile.am
+++ /dev/null
@@ -1,75 +0,0 @@
-lib_LTLIBRARIES = libsyncevo-dbus.la
-
-if COND_GUI
-AM_CPPFLAGS = -I$(top_srcdir) $(SYNTHESIS_CFLAGS)
-
-DISTCLEANFILES = syncevo-dbus.pc
-EXTRA_DIST = syncevo-dbus.pc.in syncevo-marshal.list
-pkgconfig_DATA = syncevo-dbus.pc
-pkgconfigdir = $(libdir)/pkgconfig
-
-noinst_PROGRAMS = test-syncevo-dbus
-
-test_syncevo_dbus_SOURCES = test.c
-test_syncevo_dbus_LDADD = $(DBUS_GLIB_LIBS) libsyncevo-dbus.la
-test_syncevo_dbus_CFLAGS = $(DBUS_GLIB_CFLAGS)
-
-nodist_libsyncevo_dbus_la_SOURCES = \
- syncevo-marshal.c
-
-BUILT_SOURCES = syncevo-marshal.c syncevo-marshal.h \
- syncevo-server-bindings.h syncevo-connection-bindings.h syncevo-session-bindings.h \
- syncevo-server-glue.h syncevo-connection-glue.h syncevo-session-glue.h \
- syncevo-server.xml syncevo-connection.xml syncevo-session.xml
-
-CLEANFILES = $(BUILT_SOURCES) stamp-syncevo-dbus-glue.h
-
-# D-Bus binding tool gets confused by doc comments, strip them first
-%.xml: $(srcdir)/../interfaces/spec-strip-docs.xsl $(srcdir)/../interfaces/%-full.xml
- $(XSLT) -o $@ $+
-
-%-bindings.h: stamp-%-bindings.h
- @true
-stamp-%-bindings.h: %.xml
- $(DBUS_BINDING_TOOL) --mode=glib-client --prefix=syncevo $< > xgen-$(@F) \
- && (cmp -s xgen-$(@F) $(@F:stamp-%=%) || cp xgen-$(@F) $(@F:stamp-%=%)) \
- && rm -f xgen-$(@F) \
- && echo timestamp > $(@F)
-
-syncevo-marshal.h: $(srcdir)/syncevo-marshal.list $(GLIB_GENMARSHAL)
- $(GLIB_GENMARSHAL) $< --header --prefix=syncevo_marshal > $@
-syncevo-marshal.c: $(srcdir)/syncevo-marshal.list syncevo-marshal.h $(GLIB_GENMARSHAL)
- echo "#include \"syncevo-marshal.h\"" > $@ \
- && $(GLIB_GENMARSHAL) --prefix=syncevo_marshal $(srcdir)/syncevo-marshal.list --body >> $@
-
-%-glue.h: stamp-%-glue.h
- @true
-stamp-%-glue.h: %.xml
- $(DBUS_BINDING_TOOL) --prefix=syncevo --mode=glib-server $< > xgen-$(@F) \
- && (cmp -s xgen-$(@F) $(@F:stamp-%=%) || cp xgen-$(@F) $(@F:stamp-%=%)) \
- && rm -f xgen-$(@F) \
- && echo timestamp > $(@F)
-
-libsyncevo_dbus_la_SOURCES = \
- $(syncevo_dbus_headers) \
- syncevo-dbus-types.c \
- syncevo-server.c \
- syncevo-session.c
-
-libsyncevo_dbus_la_CFLAGS = \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- $(DBUS_GLIB_CFLAGS)
-
-libsyncevo_dbus_la_LIBADD = \
- $(DBUS_GLIB_LIBS)
-
-syncevo_dbus_headers = \
- syncevo-dbus-types.h \
- syncevo-server.h \
- syncevo-session.h
-
-libsyncevo_dbus_includedir = $(includedir)/syncevo-dbus
-libsyncevo_dbus_include_HEADERS = \
- $(syncevo_dbus_headers)
-endif
diff --git a/src/dbus/glib/glib.am b/src/dbus/glib/glib.am
new file mode 100644
index 00000000..3335e42f
--- /dev/null
+++ b/src/dbus/glib/glib.am
@@ -0,0 +1,108 @@
+if COND_GUI
+
+src_dbus_glib_lib = src/dbus/glib/libsyncevo-dbus.la
+
+lib_LTLIBRARIES += $(src_dbus_glib_lib)
+
+src_dbus_glib_cppflags = \
+ -I$(top_srcdir) \
+ $(SYNTHESIS_CFLAGS) \
+ -I$(top_srcdir)/src/dbus/glib \
+ -I$(top_builddir)/src/dbus/glib
+
+DISTCLEANFILES += src/dbus/glib/syncevo-dbus.pc
+
+dist_noinst_DATA += \
+ src/dbus/glib/syncevo-dbus.pc.in \
+ src/dbus/glib/syncevo-marshal.list \
+ src/dbus/glib/README
+
+#pkgconfigdir is defined in $(top_srcdir)/setup-variables.am
+pkgconfig_DATA += src/dbus/glib/syncevo-dbus.pc
+
+noinst_PROGRAMS += src/dbus/glib/test-syncevo-dbus
+
+src_dbus_glib_test_syncevo_dbus_SOURCES = src/dbus/glib/test.c
+src_dbus_glib_test_syncevo_dbus_LDADD = $(DBUS_GLIB_LIBS) $(src_dbus_glib_lib)
+src_dbus_glib_test_syncevo_dbus_CFLAGS = $(DBUS_GLIB_CFLAGS) $(SYNCEVO_WFLAGS)
+src_dbus_glib_test_syncevo_dbus_CPPFLAGS = $(src_dbus_glib_cppflags)
+
+src_dbus_glib_built_sources = \
+ src/dbus/glib/syncevo-marshal.c \
+ src/dbus/glib/syncevo-marshal.h \
+ src/dbus/glib/syncevo-server-bindings.h \
+ src/dbus/glib/syncevo-connection-bindings.h \
+ src/dbus/glib/syncevo-session-bindings.h \
+ src/dbus/glib/syncevo-server-glue.h \
+ src/dbus/glib/syncevo-connection-glue.h \
+ src/dbus/glib/syncevo-session-glue.h \
+ src/dbus/glib/syncevo-server.xml \
+ src/dbus/glib/syncevo-connection.xml \
+ src/dbus/glib/syncevo-session.xml
+
+BUILT_SOURCES += $(src_dbus_glib_built_sources)
+
+CLEANFILES += $(src_dbus_glib_built_sources)
+
+# D-Bus binding tool gets confused by doc comments, strip them first
+src/dbus/glib/%.xml: $(top_srcdir)/src/dbus/interfaces/spec-strip-docs.xsl $(top_srcdir)/src/dbus/interfaces/%-full.xml
+ $(AM_V_GEN)$(XSLT) -o $@ $+
+
+src/dbus/glib/%-bindings.h: src/dbus/glib/stamp-%-bindings.h
+ $(AM_V_GEN)
+ @true
+src/dbus/glib/stamp-%-bindings.h: src/dbus/glib/%.xml
+ $(AM_V_at)XGENNAME='$(dir $@)xgen-$(notdir $@)' \
+ && BINDINGSNAME='$(dir $@)$(subst stamp-,,$(notdir $@))' \
+ && $(DBUS_BINDING_TOOL) --mode=glib-client --prefix=syncevo $< >"$$XGENNAME" \
+ && (cmp -s "$$XGENNAME" "$$BINDINGSNAME" || cp "$$XGENNAME" "$$BINDINGSNAME" )\
+ && rm -f "$$XGENNAME" \
+ && echo 'timestamp' >$@
+
+src/dbus/glib/syncevo-marshal.h: $(top_srcdir)/src/dbus/glib/syncevo-marshal.list $(GLIB_GENMARSHAL)
+ $(AM_V_GEN)$(GLIB_GENMARSHAL) $< --header --prefix=syncevo_marshal > $@
+src/dbus/glib/syncevo-marshal.c: $(top_srcdir)/src/dbus/glib/syncevo-marshal.list src/dbus/glib/syncevo-marshal.h $(GLIB_GENMARSHAL)
+ $(AM_V_GEN)echo "#include \"syncevo-marshal.h\"" > $@ \
+ && $(GLIB_GENMARSHAL) --prefix=syncevo_marshal $(top_srcdir)/src/dbus/glib/syncevo-marshal.list --body >> $@
+
+src/dbus/glib/%-glue.h: src/dbus/glib/stamp-%-glue.h
+ $(AM_V_GEN)
+ @true
+src/dbus/glib/stamp-%-glue.h: src/dbus/glib/%.xml
+ $(AM_V_at)XGENNAME='$(dir $@)xgen-$(notdir $@)' \
+ && GLUENAME='$(dir $@)$(subst stamp-,,$(notdir $@))' \
+ && $(DBUS_BINDING_TOOL) --prefix=syncevo --mode=glib-server $< >"$$XGENNAME" \
+ && (cmp -s "$$XGENNAME" "$$GLUENAME" || cp "$$XGENNAME" "$$GLUENAME") \
+ && rm -f "$$XGENNAME" \
+ && echo 'timestamp' >$@
+
+nodist_src_dbus_glib_libsyncevo_dbus_la_SOURCES = \
+ $(src_dbus_glib_built_sources)
+
+src_dbus_glib_libsyncevo_dbus_la_SOURCES = \
+ $(src_dbus_glib_syncevo_dbus_headers) \
+ src/dbus/glib/syncevo-dbus-types.c \
+ src/dbus/glib/syncevo-server.c \
+ src/dbus/glib/syncevo-session.c
+
+src_dbus_glib_libsyncevo_dbus_la_CFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(DBUS_GLIB_CFLAGS) \
+ $(SYNCEVO_WFLAGS)
+
+src_dbus_glib_libsyncevo_dbus_la_LIBADD = \
+ $(DBUS_GLIB_LIBS)
+
+src_dbus_glib_libsyncevo_dbus_la_CPPFLAGS = \
+ $(src_dbus_glib_cppflags)
+
+src_dbus_glib_syncevo_dbus_headers = \
+ src/dbus/glib/syncevo-dbus-types.h \
+ src/dbus/glib/syncevo-server.h \
+ src/dbus/glib/syncevo-session.h
+
+src_dbus_glib_libsyncevo_dbus_includedir = $(includedir)/syncevo-dbus
+src_dbus_glib_libsyncevo_dbus_include_HEADERS = \
+ $(src_dbus_glib_syncevo_dbus_headers)
+endif
diff --git a/src/dbus/interfaces/Makefile.am b/src/dbus/interfaces/Makefile.am
deleted file mode 100644
index 103d28b5..00000000
--- a/src/dbus/interfaces/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-doc_DATA =
-
-%.xml: %-full.xml
- $(XSLT) -o $@ $(srcdir)/spec-strip-docs.xsl $<
-
-if COND_DOC
-%-doc.xml: %-full.xml
- $(XSLT) -o $@ $(srcdir)/spec-to-docbook.xsl $<
-
-syncevo-dbus-api-doc.xml: syncevo-server-doc.xml syncevo-session-doc.xml syncevo-connection-doc.xml
- echo '<?xml version="1.0" encoding="UTF-8"?>' >$@
- echo '<reference><title>SyncEvolution D-Bus API $(VERSION)</title>' >>$@
- for xml in $+; do \
- tail -n +2 $$xml >>$@; \
- done
- echo '</reference>' >>$@
-
-syncevo-dbus-api-doc.html: syncevo-dbus-api-doc.xml
- $(XSLT) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
-
-doc_DATA += syncevo-dbus-api-doc.html
-
-endif
-
-BUILT_SOURCES =
-if COND_DOC
-BUILT_SOURCES += syncevo-server-doc.xml syncevo-connection-doc.xml syncevo-session-doc.xml \
- syncevo-dbus-api-doc.xml syncevo-dbus-api-doc.html
-endif
-
-CLEANFILES = $(BUILT_SOURCES)
-EXTRA_DIST = \
- spec-strip-docs.xsl \
- spec-to-docbook.xsl \
- syncevo-connection-full.xml \
- syncevo-server-full.xml \
- syncevo-session-full.xml
-
diff --git a/src/dbus/interfaces/interfaces.am b/src/dbus/interfaces/interfaces.am
new file mode 100644
index 00000000..34451557
--- /dev/null
+++ b/src/dbus/interfaces/interfaces.am
@@ -0,0 +1,45 @@
+src/dbus/interfaces/%.xml: src/dbus/interfaces/%-full.xml
+ $(AM_V_GEN)$(XSLT) -o $@ $(top_srcdir)/src/dbus/interfaces/spec-strip-docs.xsl $<
+
+if COND_DOC
+src/dbus/interfaces/%-doc.xml: src/dbus/interfaces/%-full.xml
+ $(AM_V_GEN)$(XSLT) -o $@ $(top_srcdir)/src/dbus/interfaces/spec-to-docbook.xsl $<
+
+src/dbus/interfaces/syncevo-dbus-api-doc.xml: src/dbus/interfaces/syncevo-server-doc.xml src/dbus/interfaces/syncevo-session-doc.xml src/dbus/interfaces/syncevo-connection-doc.xml
+ $(AM_V_GEN)echo '<?xml version="1.0" encoding="UTF-8"?>' >$@ \
+ && echo '<reference><title>SyncEvolution D-Bus API $(VERSION)</title>' >>$@ \
+ && for xml in $+; \
+ do \
+ tail -n +2 $$xml >>$@; \
+ done; \
+ echo '</reference>' >>$@
+
+src/dbus/interfaces/syncevo-dbus-api-doc.html: src/dbus/interfaces/syncevo-dbus-api-doc.xml
+ $(AM_V_GEN)$(XSLT) -o $@ http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $<
+
+doc_DATA += src/dbus/interfaces/syncevo-dbus-api-doc.html
+
+endif
+
+if COND_DOC
+src_dbus_interfaces_built_sources = \
+ src/dbus/interfaces/syncevo-server-doc.xml \
+ src/dbus/interfaces/syncevo-connection-doc.xml \
+ src/dbus/interfaces/syncevo-session-doc.xml \
+ src/dbus/interfaces/syncevo-dbus-api-doc.xml \
+ src/dbus/interfaces/syncevo-dbus-api-doc.html
+else
+src_dbus_interfaces_built_sources =
+endif
+
+BUILT_SOURCES += $(src_dbus_interfaces_built_sources)
+
+CLEANFILES += $(src_dbus_interfaces_built_sources)
+
+dist_noinst_DATA += \
+ src/dbus/interfaces/spec-strip-docs.xsl \
+ src/dbus/interfaces/spec-to-docbook.xsl \
+ src/dbus/interfaces/syncevo-connection-full.xml \
+ src/dbus/interfaces/syncevo-server-full.xml \
+ src/dbus/interfaces/syncevo-session-full.xml \
+ src/dbus/interfaces/README
diff --git a/src/dbus/qt/Makefile.am b/src/dbus/qt/Makefile.am
deleted file mode 100644
index cdfe1bb8..00000000
--- a/src/dbus/qt/Makefile.am
+++ /dev/null
@@ -1,74 +0,0 @@
-if ENABLE_QT_DBUS
-
-include $(top_srcdir)/m4-repo/autotroll.mk
-
-libsyncevolution_qt_dbus_includedir = $(includedir)/syncevolution-qt-dbus
-
-lib_LTLIBRARIES = libsyncevolution-qt-dbus.la
-
-libsyncevolution_qt_dbus_headers = dbustypes.h
-
-nodist_libsyncevolution_qt_dbus_include_HEADERS = \
- $(libsyncevolution_qt_dbus_headers) \
- $(built_headers) \
- $(NULL)
-
-dist_libsyncevolution_qt_dbus_la_SOURCES = \
- $(libsyncevolution_qt_dbus_headers) \
- dbustypes.cpp
-
-nodist_libsyncevolution_qt_dbus_la_SOURCES = \
- $(BUILT_SOURCES)
-
-AM_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS)
-
-EXTRA_DIST = configure-sub.in
-
-built_headers = \
- syncevo-server-full.h \
- syncevo-session-full.h \
- syncevo-connection-full.h \
- $(NULL)
-
-BUILT_SOURCES = \
- syncevo-server-full.cpp \
- syncevo-session-full.cpp \
- syncevo-connection-full.cpp \
- syncevo-server-full.moc.cpp \
- syncevo-session-full.moc.cpp \
- syncevo-connection-full.moc.cpp \
- $(built_headers) \
- $(NULL)
-
-MOSTLYCLEANFILES = $(lib_LTLIBRARIES)
-
-MAINTAINERCLEANFILES = Makefile.in
-
-CLEANFILES = $(BUILT_SOURCES) \
- stamp-server \
- stamp-session \
- stamp-connection
-
-DISTCLEANFILES += syncevolution-qt-dbus.pc
-EXTRA_DIST += syncevolution-qt-dbus.pc.in
-pkgconfig_DATA = syncevolution-qt-dbus.pc
-pkgconfigdir = $(libdir)/pkgconfig
-
-libsyncevolution_qt_dbus_la_LIBADD = $(QT_DBUS_LIBS) $(QT_LIBS)
-libsyncevolution_qt_dbus_la_CPPFLAGS = $(AM_CPPFLAGS) $(QT_CPPFLAGS)
-# Allow Qt to set some compile flags, but not the ones normally set via configure.
-# In particular -W is not compatible with the SyncEvolution header files (we have
-# unused parameters in some inline functions).
-libsyncevolution_qt_dbus_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS))
-
-syncevo-server-full.cpp syncevo-server-full.h: stamp-server
-syncevo-session-full.cpp syncevo-session-full.h: stamp-session
-syncevo-connection-full.cpp syncevo-connection-full.h: stamp-connection
-
-# work around #ifndef SYNCEVO-SERVER-FULL_H_1305547804 bug
-stamp-%: $(srcdir)/../interfaces/syncevo-%-full.xml
- qdbusxml2cpp -p syncevo-$*-full -i dbustypes.h $<
- perl -pi -e 's/SYNCEVO-(\w*)-FULL_H/SYNCEVO_$$1_FULL_H/' syncevo-$*-full.*
- touch $@
-
-endif # ENABLE_QT_DBUS
diff --git a/src/dbus/qt/configure-sub.in b/src/dbus/qt/configure-sub.in
deleted file mode 100644
index 707ed125..00000000
--- a/src/dbus/qt/configure-sub.in
+++ /dev/null
@@ -1,17 +0,0 @@
-dnl -*- mode: Autoconf; -*-
-dnl Invoke autogen.sh to produce a configure script.
-
-AC_ARG_ENABLE(qt-dbus,
- AS_HELP_STRING([--enable-qt-dbus],
- [build Qt bindings for D-Bus]),
- enable_qt_dbus="$enableval", enable_qt_dbus="no")
-
-if test "$enable_qt_dbus" = "yes"; then
- AC_DEFINE(ENABLE_QT_DBUS, 1, [Qt D-Bus bindings available])
- need_qt_modules="$need_qt_modules +dbus"
-fi
-
-AM_CONDITIONAL([ENABLE_QT_DBUS], [test "$enable_qt_dbus" = "yes"])
-
-AC_SUBST(QT_DBUS_LIBS)
-AC_CONFIG_FILES(src/dbus/qt/syncevolution-qt-dbus.pc)
diff --git a/src/dbus/qt/qt.am b/src/dbus/qt/qt.am
new file mode 100644
index 00000000..13594dcf
--- /dev/null
+++ b/src/dbus/qt/qt.am
@@ -0,0 +1,76 @@
+if ENABLE_QT_DBUS
+
+src_dbus_qt_libsyncevolution_qt_dbus_libraries = \
+ src/dbus/qt/libsyncevolution-qt-dbus.la
+
+lib_LTLIBRARIES += $(src_dbus_qt_libsyncevolution_qt_dbus_libraries)
+
+src_dbus_qt_libsyncevolution_qt_dbus_headers = src/dbus/qt/dbustypes.h
+
+
+src_dbus_qt_libsyncevolution_qt_dbus_includedir = $(includedir)/syncevolution-qt-dbus
+nodist_src_dbus_qt_libsyncevolution_qt_dbus_include_HEADERS = \
+ $(src_dbus_qt_libsyncevolution_qt_dbus_headers) \
+ $(built_headers)
+
+dist_src_dbus_qt_libsyncevolution_qt_dbus_la_SOURCES = \
+ $(src_dbus_qt_libsyncevolution_qt_dbus_headers) \
+ src/dbus/qt/dbustypes.cpp
+
+nodist_src_dbus_qt_libsyncevolution_qt_dbus_la_SOURCES = \
+ $(src_dbus_qt_built_sources)
+
+src_dbus_qt_cppflags = \
+ $(SYNCEVOLUTION_CFLAGS) \
+ -I$(top_srcdir)/test \
+ $(BACKEND_CPPFLAGS)
+
+built_headers = \
+ src/dbus/qt/syncevo-server-full.h \
+ src/dbus/qt/syncevo-session-full.h \
+ src/dbus/qt/syncevo-connection-full.h
+
+src_dbus_qt_built_sources = \
+ src/dbus/qt/syncevo-server-full.cpp \
+ src/dbus/qt/syncevo-session-full.cpp \
+ src/dbus/qt/syncevo-connection-full.cpp \
+ src/dbus/qt/syncevo-server-full.moc.cpp \
+ src/dbus/qt/syncevo-session-full.moc.cpp \
+ src/dbus/qt/syncevo-connection-full.moc.cpp \
+ $(built_headers)
+
+BUILT_SOURCES += $(src_dbus_qt_built_sources)
+
+MOSTLYCLEANFILES += $(src_dbus_qt_libsyncevolution_qt_dbus_libraries)
+
+MAINTAINERCLEANFILES += src/dbus/qt/Makefile.in
+
+CLEANFILES += $(src_dbus_qt_built_sources) \
+ src/dbus/qt/stamp-server \
+ src/dbus/qt/stamp-session \
+ src/dbus/qt/stamp-connection
+
+DISTCLEANFILES += src/dbus/qt/syncevolution-qt-dbus.pc
+dist_noinst_DATA += \
+ src/dbus/qt/syncevolution-qt-dbus.pc.in
+#pkgconfigdir is defined in $(top_srcdir)/setup-variables.am
+pkgconfig_DATA += src/dbus/qt/syncevolution-qt-dbus.pc
+
+src_dbus_qt_libsyncevolution_qt_dbus_la_LIBADD = $(QT_DBUS_LIBS) $(QT_LIBS)
+src_dbus_qt_libsyncevolution_qt_dbus_la_CPPFLAGS = $(src_dbus_qt_cppflags) $(QT_CPPFLAGS)
+# Allow Qt to set some compile flags, but not the ones normally set via configure.
+# In particular -W is not compatible with the SyncEvolution header files (we have
+# unused parameters in some inline functions).
+src_dbus_qt_libsyncevolution_qt_dbus_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
+
+src/dbus/qt/syncevo-%-full.cpp src/dbus/qt/syncevo-%-full.h: src/dbus/qt/stamp-%
+ $(AM_V_GEN)
+ @true
+
+# work around #ifndef SYNCEVO-SERVER-FULL_H_1305547804 bug
+src/dbus/qt/stamp-%: $(top_srcdir)/src/dbus/interfaces/syncevo-%-full.xml
+ $(AM_V_at)@QDBUSXML_TO_CPP@ -p src/dbus/qt/syncevo-$*-full -i src/dbus/qt/dbustypes.h $< \
+ && perl -pi -e 's/SYNCEVO-(\w*)-FULL_H/SYNCEVO_$$1_FULL_H/' src/dbus/qt/syncevo-$*-full.* \
+ && echo 'timestamp' >$@
+
+endif # ENABLE_QT_DBUS
diff --git a/src/dbus/server/.gitignore b/src/dbus/server/.gitignore
deleted file mode 100644
index 4a4712ce..00000000
--- a/src/dbus/server/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/org.syncevolution.service
-/syncevo-dbus-server-startup.sh
-/syncevo-dbus-server.desktop
diff --git a/src/dbus/server/Makefile.am b/src/dbus/server/Makefile.am
deleted file mode 100644
index 2cbf8a9f..00000000
--- a/src/dbus/server/Makefile.am
+++ /dev/null
@@ -1,101 +0,0 @@
-if COND_DBUS
-
-noinst_LTLIBRARIES = libsyncevodbusserver.la
-
-server_cpp_files = \
- NotificationBackendNoop.cpp \
- NotificationBackendLibnotify.cpp \
- NotificationBackendMLite.cpp \
- NotificationManagerFactory.cpp \
- auto-sync-manager.cpp \
- bluez-manager.cpp \
- client.cpp \
- connection.cpp \
- connman-client.cpp \
- dbus-sync.cpp \
- dbus-transport-agent.cpp \
- dbus-user-interface.cpp \
- exceptions.cpp \
- info-req.cpp \
- network-manager-client.cpp \
- presence-status.cpp \
- progress-data.cpp \
- read-operations.cpp \
- server.cpp \
- session.cpp
-
-server_h_files = \
- $(server_cpp_files:%.cpp=%.h) \
- NotificationBackendBase.h \
- NotificationBackendLibnotify.h \
- NotificationBackendMLite.h \
- NotificationBackendNoop.h \
- NotificationManager.h \
- NotificationManagerBase.h \
- NotificationManagerFactory.h \
- auto-sync-manager.h \
- auto-term.h \
- bluez-manager.h \
- client.h \
- cmdline-wrapper.h \
- connection.h \
- connman-client.h \
- dbus-sync.h \
- dbus-transport-agent.h \
- dbus-user-interface.h \
- exceptions.h \
- info-req.h \
- network-manager-client.h \
- presence-status.h \
- progress-data.h \
- read-operations.h \
- resource.h \
- restart.h \
- session.h \
- session-listener.h \
- source-progress.h \
- source-status.h \
- timeout.h \
- timer.h
-
-libsyncevodbusserver_la_SOURCES = \
- $(server_h_files) \
- $(server_cpp_files) \
- main.cpp
-
-dist_pkgdata_DATA = bluetooth_products.ini
-
-libsyncevodbusserver_la_LIBADD = $(KEYRING_LIBS) $(LIBNOTIFY_LIBS) $(MLITE_LIBS) $(KDE_KWALLET_LIBS) $(DBUS_LIBS) $(LIBSOUP_LIBS)
-libsyncevodbusserver_la_CPPFLAGS = -DHAVE_CONFIG_H -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\" -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir) $(BACKEND_CPPFLAGS)
-libsyncevodbusserver_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(SYNTHESIS_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(KEYRING_CFLAGS) $(LIBNOTIFY_CFLAGS) $(MLITE_CFLAGS) $(KDE_KWALLET_CFLAGS)
-
-# Deal with .service, .desktop and startup script files.
-CLEANFILES = org.syncevolution.service \
- $(SYNCEVO_DBUS_SERVER_DESKTOP) \
- $(SYNCEVO_DBUS_SERVER_SCRIPT)
-
-SYNCEVO_DBUS_SERVER_SCRIPT = syncevo-dbus-server-startup.sh
-SYNCEVO_DBUS_SERVER_SCRIPT_IN = $(SYNCEVO_DBUS_SERVER_SCRIPT).in
-
-autostartdir = $(sysconfdir)/xdg/autostart
-SYNCEVO_DBUS_SERVER_DESKTOP = syncevo-dbus-server.desktop
-SYNCEVO_DBUS_SERVER_DESKTOP_IN = $(SYNCEVO_DBUS_SERVER_DESKTOP).in
-
-libexec_SCRIPTS = $(SYNCEVO_DBUS_SERVER_SCRIPT)
-$(libexec_SCRIPTS): $(SYNCEVO_DBUS_SERVER_SCRIPT_IN) Makefile
- @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-autostart_DATA = $(SYNCEVO_DBUS_SERVER_DESKTOP)
-$(autostart_DATA): $(SYNCEVO_DBUS_SERVER_DESKTOP_IN) Makefile
- @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-
-service_in_files = org.syncevolution.service.in
-servicedir = $(DBUS_SERVICES_DIR)
-service_DATA = $(service_in_files:.service.in=.service)
-$(service_DATA): $(service_in_files) Makefile
- @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-
-EXTRA_DIST = $(service_in_files) \
- $(SYNCEVO_DBUS_SERVER_SCRIPT_IN) \
- $(SYNCEVO_DBUS_SERVER_DESKTOP_IN)
-
-endif
diff --git a/src/dbus/server/server.am b/src/dbus/server/server.am
new file mode 100644
index 00000000..90f36150
--- /dev/null
+++ b/src/dbus/server/server.am
@@ -0,0 +1,84 @@
+if COND_DBUS
+
+noinst_LTLIBRARIES += src/dbus/server/libsyncevodbusserver.la
+
+src_dbus_server_server_cpp_files = \
+ src/dbus/server/NotificationBackendNoop.cpp \
+ src/dbus/server/NotificationBackendLibnotify.cpp \
+ src/dbus/server/NotificationBackendMLite.cpp \
+ src/dbus/server/NotificationManagerFactory.cpp \
+ src/dbus/server/auto-sync-manager.cpp \
+ src/dbus/server/bluez-manager.cpp \
+ src/dbus/server/client.cpp \
+ src/dbus/server/connection.cpp \
+ src/dbus/server/connman-client.cpp \
+ src/dbus/server/dbus-sync.cpp \
+ src/dbus/server/dbus-transport-agent.cpp \
+ src/dbus/server/dbus-user-interface.cpp \
+ src/dbus/server/exceptions.cpp \
+ src/dbus/server/info-req.cpp \
+ src/dbus/server/network-manager-client.cpp \
+ src/dbus/server/presence-status.cpp \
+ src/dbus/server/progress-data.cpp \
+ src/dbus/server/read-operations.cpp \
+ src/dbus/server/server.cpp \
+ src/dbus/server/session.cpp
+
+src_dbus_server_server_h_files = \
+ $(src_dbus_server_server_cpp_files:.cpp=.h) \
+ src/dbus/server/NotificationBackendBase.h \
+ src/dbus/server/NotificationManager.h \
+ src/dbus/server/NotificationManagerBase.h \
+ src/dbus/server/auto-term.h \
+ src/dbus/server/cmdline-wrapper.h \
+ src/dbus/server/resource.h \
+ src/dbus/server/restart.h \
+ src/dbus/server/session-listener.h \
+ src/dbus/server/source-progress.h \
+ src/dbus/server/source-status.h \
+ src/dbus/server/timeout.h \
+ src/dbus/server/timer.h
+
+src_dbus_server_libsyncevodbusserver_la_SOURCES = \
+ $(src_dbus_server_server_h_files) \
+ $(src_dbus_server_server_cpp_files) \
+ src/dbus/server/main.cpp
+
+dist_pkgdata_DATA += src/dbus/server/bluetooth_products.ini
+
+src_dbus_server_libsyncevodbusserver_la_LIBADD = $(KEYRING_LIBS) $(LIBNOTIFY_LIBS) $(MLITE_LIBS) $(KDE_KWALLET_LIBS) $(DBUS_LIBS) $(LIBSOUP_LIBS)
+src_dbus_server_libsyncevodbusserver_la_CPPFLAGS = -DHAVE_CONFIG_H -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\" -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir) $(BACKEND_CPPFLAGS)
+src_dbus_server_libsyncevodbusserver_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(SYNTHESIS_CFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(KEYRING_CFLAGS) $(LIBNOTIFY_CFLAGS) $(MLITE_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
+
+# Deal with .service, .desktop and startup script files.
+CLEANFILES += \
+ $(src_dbus_server_service_files) \
+ $(src_dbus_server_desktop) \
+ $(src_dbus_server_script)
+
+src_dbus_server_script_in = src/dbus/server/syncevo-dbus-server-startup.sh.in
+src_dbus_server_script = $(src_dbus_server_script_in:.sh.in=.sh)
+src_dbus_server_desktop_in = src/dbus/server/syncevo-dbus-server.desktop.in
+src_dbus_server_desktop = $(src_dbus_server_desktop_in:.desktop.in=.desktop)
+src_dbus_server_autostartdir = $(sysconfdir)/xdg/autostart
+src_dbus_server_autostart_DATA = $(src_dbus_server_desktop)
+
+libexec_SCRIPTS += $(src_dbus_server_script)
+$(src_dbus_server_script): $(src_dbus_server_script_in)
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< >$@
+$(src_dbus_server_desktop): $(src_dbus_server_desktop_in)
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< >$@
+
+src_dbus_server_service_files_in = src/dbus/server/org.syncevolution.service.in
+src_dbus_server_service_files = $(src_dbus_server_service_files_in:.service.in=.service)
+src_dbus_server_servicedir = $(DBUS_SERVICES_DIR)
+src_dbus_server_service_DATA = $(src_dbus_server_service_files)
+$(src_dbus_server_service_files): $(src_dbus_server_service_files_in)
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< >$@
+
+dist_noinst_DATA += \
+ $(src_dbus_server_service_files_in) \
+ $(src_dbus_server_script_in) \
+ $(src_dbus_server_desktop_in)
+
+endif
diff --git a/src/gdbus/.gitignore b/src/gdbus/.gitignore
deleted file mode 100644
index 6f30a3ab..00000000
--- a/src/gdbus/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/example
diff --git a/src/gdbus/Makefile.am b/src/gdbus/Makefile.am
deleted file mode 100644
index bb610f6c..00000000
--- a/src/gdbus/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-# include_HEADERS = gdbus.h
-
-if ENABLE_MODULES
-pkglib_LTLIBRARIES = libgdbussyncevo.la
-else
-noinst_LTLIBRARIES = libgdbussyncevo.la
-endif
-
-libgdbussyncevo_la_SOURCES = debug.h debug.c mainloop.c object.c watch.c \
- gdbus.h gdbus-cxx-bridge.h gdbus-cxx-bridge.cpp gdbus-cxx.h
-libgdbussyncevo_la_LDFLAGS = -version-info 0:0:0 -export-symbols-regex b_dbus_.*
-
-libgdbussyncevo_la_LIBADD = @GLIB_LIBS@ @DBUS_LIBS@
-
-AM_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@
-AM_CXXFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@
-
-MAINTAINERCLEANFILES = Makefile.in
-
-# include_HEADERS = gdbus-cxx-bridge.h gdbus-cxx.h
-noinst_PROGRAMS = example
-example_SOURCES = test/example.cpp
-example_CXXFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@
-example_LDADD = libgdbussyncevo.la @GLIB_LIBS@ @DBUS_LIBS@
diff --git a/src/gdbus/gdbus.am b/src/gdbus/gdbus.am
new file mode 100644
index 00000000..11cc0366
--- /dev/null
+++ b/src/gdbus/gdbus.am
@@ -0,0 +1,35 @@
+# include_HEADERS = src/gdbus/gdbus.h
+
+dist_noinst_DATA += \
+ src/gdbus/README
+
+if ENABLE_MODULES
+# pkglibdir is defined to $(libdir)/$(PACKAGE). see:
+# http://www.gnu.org/software/automake/manual/automake.html#Uniform
+pkglib_LTLIBRARIES = src/gdbus/libgdbussyncevo.la
+src_gdbus_version_info = -version-info 0:0:0
+else
+noinst_LTLIBRARIES += src/gdbus/libgdbussyncevo.la
+endif
+
+src_gdbus_libgdbussyncevo_la_SOURCES = \
+ src/gdbus/debug.h \
+ src/gdbus/debug.c \
+ src/gdbus/mainloop.c \
+ src/gdbus/object.c \
+ src/gdbus/watch.c \
+ src/gdbus/gdbus.h \
+ src/gdbus/gdbus-cxx-bridge.h \
+ src/gdbus/gdbus-cxx-bridge.cpp \
+ src/gdbus/gdbus-cxx.h
+src_gdbus_libgdbussyncevo_la_LDFLAGS = $(src_gdbus_version_info) -export-symbols-regex b_dbus_.*
+src_gdbus_libgdbussyncevo_la_LIBADD = @GLIB_LIBS@ @DBUS_LIBS@
+src_gdbus_libgdbussyncevo_la_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ $(SYNCEVO_WFLAGS)
+src_gdbus_libgdbussyncevo_la_CXXFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ $(SYNCEVO_WFLAGS)
+
+# include_HEADERS = src/gdbus/gdbus-cxx-bridge.h src/gdbus/gdbus-cxx.h
+noinst_PROGRAMS += src/gdbus/example
+src_gdbus_example_SOURCES = src/gdbus/test/example.cpp
+src_gdbus_example_CXXFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ $(SYNCEVO_WFLAGS)
+src_gdbus_example_LDADD = src/gdbus/libgdbussyncevo.la @GLIB_LIBS@ @DBUS_LIBS@
+src_gdbus_example_CPPFLAGS = -I$(top_srcdir)/src/gdbus
diff --git a/src/gnome-bluetooth/Makefile.am b/src/gnome-bluetooth/Makefile.am
deleted file mode 100644
index 7229d9c0..00000000
--- a/src/gnome-bluetooth/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-plugindir = $(GNOMEBLUETOOTH_DIR)/plugins/
-
-INCLUDES = $(GNOMEBLUETOOTH_CFLAGS) \
- -DLOCALEDIR=\"$(SYNCEVOLUTION_LOCALEDIR)\"
-
-plugin_LTLIBRARIES = libgbtsyncevolution.la
-libgbtsyncevolution_la_SOURCES = syncevolution.c
-libgbtsyncevolution_la_LDFLAGS = -module -avoid-version
-
diff --git a/src/gnome-bluetooth/gnome-bluetooth.am b/src/gnome-bluetooth/gnome-bluetooth.am
new file mode 100644
index 00000000..a6084302
--- /dev/null
+++ b/src/gnome-bluetooth/gnome-bluetooth.am
@@ -0,0 +1,10 @@
+src_gnome_bluetoothdir = $(GNOMEBLUETOOTH_DIR)/plugins/
+
+src_gnome_bluetooth_LTLIBRARIES = src/gnome-bluetooth/libgbtsyncevolution.la
+
+src_gnome_bluetooth_libgbtsyncevolution_la_SOURCES = src/gnome-bluetooth/syncevolution.c
+src_gnome_bluetooth_libgbtsyncevolution_la_LDFLAGS = -module -avoid-version
+src_gnome_bluetooth_libgbtsyncevolution_la_CPPFLAGS = \
+ $(GNOMEBLUETOOTH_CFLAGS) \
+ -DLOCALEDIR=\"$(SYNCEVOLUTION_LOCALEDIR)\"
+src_gnome_bluetooth_libgbtsyncevolution_la_CFLAGS = $(SYNCEVO_WFLAGS)
diff --git a/src/gtk-ui/Makefile.am b/src/gtk-ui/Makefile.am
deleted file mode 100644
index 5f56fb29..00000000
--- a/src/gtk-ui/Makefile.am
+++ /dev/null
@@ -1,81 +0,0 @@
-applicationsdir = $(datadir)/applications
-applications_in_files = sync.desktop.in sync-gtk.desktop.in
-applications_generated = $(applications_in_files:.desktop.in=.desktop)
-applications_DATA = $(GUI_DESKTOP_FILES)
-@INTLTOOL_DESKTOP_RULE@
-
-# When installing both the plain GTK and the Moblin-themed version,
-# the Moblin version uses the normal "Sync - Up to date" name/comment
-# and the GTK version uses "Sync (GTK)" as name with the same
-# comment. This is a somewhat arbitrary choice, with the rationale
-# being that a Moblin user is less likely to care about the
-# distinction while a GTK user might understand what "(GTK)" means.
-sync-moblin.desktop: sync.desktop
- cp $< $@
-
-gladedir = $(datadir)/syncevolution/
-glade_DATA = \
- ui.xml
-
-icondir = $(datadir)/icons/hicolor/48x48/apps
-dist_icon_DATA = sync.png
-
-themercdir = $(datadir)/syncevolution/
-themerc_DATA = \
- sync-generic.png \
- sync-spinner.gif \
- sync-ui.rc
-
-desktopdir = $(datadir)/applications
-
-EXTRA_DIST = \
- ui.glade \
- $(themerc_DATA) \
- $(applications_in_files) \
- $(noinst_DATA)
-
-ui.xml: ui.glade
- $(GTK_BUILDER_CONV) $< $(@F)
-
-# sync-ui: default GUI, could be plain GTK or Moblin UX
-# sync-ui-gtk: GTK GUI
-# sync-ui-moblin: Moblin UX
-#
-# The later two are built when --enable-gui=all was used.
-EXTRA_PROGRAMS = \
- sync-ui \
- sync-ui-gtk \
- sync-ui-moblin
-bin_PROGRAMS = $(GUI_PROGRAMS)
-
-sync_ui_SOURCES = \
- main.c sync-ui.c sync-ui.h sync-ui-config.c sync-ui-config.h \
- mux-frame.c mux-frame.h \
- sync-config-widget.c sync-config-widget.h \
- gtkinfobar.c gtkinfobar.h
-
-sync_ui_LDADD = $(GUI_LIBS) $(DBUS_GLIB_LIBS) $(top_builddir)/src/dbus/glib/libsyncevo-dbus.la
-sync_ui_CFLAGS = $(GUI_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
- -DGLADEDIR=\""$(gladedir)"\" \
- -DTHEMEDIR=\""$(themercdir)"\" \
- -DLIBEXECDIR=\"@libexecdir@\" \
- -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\"
-sync_ui_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/src/dbus/glib -I$(top_srcdir)/src/dbus/glib $(SYNTHESIS_CFLAGS)
-
-sync_ui_gtk_SOURCES = $(sync_ui_SOURCES)
-nodist_sync_ui_gtk_SOURCES = $(nodist_sync_ui_SOURCES)
-sync_ui_gtk_LDADD = $(sync_ui_LDADD)
-sync_ui_gtk_CFLAGS = $(sync_ui_CFLAGS)
-sync_ui_gtk_CPPFLAGS = $(sync_ui_CPPFLAGS)
-
-sync_ui_moblin_SOURCES = $(sync_ui_SOURCES)
-nodist_sync_ui_moblin_SOURCES = $(nodist_sync_ui_SOURCES)
-sync_ui_moblin_LDADD = $(sync_ui_LDADD)
-sync_ui_moblin_CFLAGS = $(sync_ui_CFLAGS)
-sync_ui_moblin_CPPFLAGS = $(sync_ui_CPPFLAGS) -DUSE_MOBLIN_UX
-
-CLEANFILES = $(BUILT_SOURCES) \
- ui.xml \
- sync-moblin.desktop \
- $(applications_generated)
diff --git a/src/gtk-ui/gtk-ui.am b/src/gtk-ui/gtk-ui.am
new file mode 100644
index 00000000..c1438325
--- /dev/null
+++ b/src/gtk-ui/gtk-ui.am
@@ -0,0 +1,104 @@
+dist_noinst_DATA += \
+ src/gtk-ui/README
+
+src_gtk_ui_applicationsdir = $(datadir)/applications
+src_gtk_ui_applications_in_files = \
+ src/gtk-ui/sync.desktop.in \
+ src/gtk-ui/sync-gtk.desktop.in
+src_gtk_ui_applications_generated = $(src_gtk_ui_applications_in_files:.desktop.in=.desktop)
+src_gtk_ui_applications_DATA = @GUI_DESKTOP_FILES@
+
+# if this will pose a problem then see the link below, probably the solution
+# here will need to be used.
+# http://mail.gnome.org/archives/commits-list/2010-October/msg05148.html
+@INTLTOOL_DESKTOP_RULE@
+
+# When installing both the plain GTK and the Moblin-themed version,
+# the Moblin version uses the normal "Sync - Up to date" name/comment
+# and the GTK version uses "Sync (GTK)" as name with the same
+# comment. This is a somewhat arbitrary choice, with the rationale
+# being that a Moblin user is less likely to care about the
+# distinction while a GTK user might understand what "(GTK)" means.
+src/gtk-ui/sync-moblin.desktop: src/gtk-ui/sync.desktop
+ $(AM_V_GEN)cp $< $@
+
+src_gtk_ui_gladedir = $(datadir)/syncevolution/
+src_gtk_ui_glade_DATA = src/gtk-ui/ui.xml
+
+src_gtk_ui_icondir = $(datadir)/icons/hicolor/48x48/apps
+dist_src_gtk_ui_icon_DATA = src/gtk-ui/sync.png
+
+src_gtk_ui_themercfiles = \
+ src/gtk-ui/sync-generic.png \
+ src/gtk-ui/sync-spinner.gif \
+ src/gtk-ui/sync-ui.rc
+
+src_gtk_ui_themercdir = $(datadir)/syncevolution/
+dist_src_gtk_ui_themerc_DATA = $(src_gtk_ui_themercfiles)
+
+src_gtk_ui_desktopdir = $(datadir)/applications
+
+dist_noinst_DATA += \
+ src/gtk-ui/ui.glade \
+ $(src_gtk_ui_applications_in_files)
+
+src/gtk-ui/ui.xml: src/gtk-ui/ui.glade
+ $(AM_V_GEN)$(GTK_BUILDER_CONV) $< $@
+
+# sync-ui: default GUI, could be plain GTK or Moblin UX
+# sync-ui-gtk: GTK GUI
+# sync-ui-moblin: Moblin UX
+#
+# The later two are built when --enable-gui=all was used.
+EXTRA_PROGRAMS += \
+ src/gtk-ui/sync-ui \
+ src/gtk-ui/sync-ui-gtk \
+ src/gtk-ui/sync-ui-moblin
+bin_PROGRAMS += @GUI_PROGRAMS@
+
+src_gtk_ui_sync_ui_SOURCES = \
+ src/gtk-ui/main.c \
+ src/gtk-ui/sync-ui.c \
+ src/gtk-ui/sync-ui.h \
+ src/gtk-ui/sync-ui-config.c \
+ src/gtk-ui/sync-ui-config.h \
+ src/gtk-ui/mux-frame.c \
+ src/gtk-ui/mux-frame.h \
+ src/gtk-ui/sync-config-widget.c \
+ src/gtk-ui/sync-config-widget.h \
+ src/gtk-ui/gtkinfobar.c \
+ src/gtk-ui/gtkinfobar.h
+
+src_gtk_ui_sync_ui_LDADD = \
+ $(GUI_LIBS) \
+ $(DBUS_GLIB_LIBS) \
+ $(top_builddir)/src/dbus/glib/libsyncevo-dbus.la
+src_gtk_ui_sync_ui_CFLAGS = \
+ $(GUI_CFLAGS) \
+ $(DBUS_GLIB_CFLAGS) \
+ -DGLADEDIR=\""$(src_gtk_ui_gladedir)"\" \
+ -DTHEMEDIR=\""$(src_gtk_ui_themercdir)"\" \
+ -DLIBEXECDIR=\"@libexecdir@\" \
+ -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\" \
+ $(SYNCEVO_WFLAGS)
+src_gtk_ui_sync_ui_CPPFLAGS = \
+ -I$(top_builddir) \
+ -I$(top_srcdir) \
+ -I$(top_builddir)/src/dbus/glib \
+ -I$(top_srcdir)/src/dbus/glib \
+ $(SYNTHESIS_CFLAGS)
+
+src_gtk_ui_sync_ui_gtk_SOURCES = $(src_gtk_ui_sync_ui_SOURCES)
+src_gtk_ui_sync_ui_gtk_LDADD = $(src_gtk_ui_sync_ui_LDADD)
+src_gtk_ui_sync_ui_gtk_CFLAGS = $(src_gtk_ui_sync_ui_CFLAGS)
+src_gtk_ui_sync_ui_gtk_CPPFLAGS = $(src_gtk_ui_sync_ui_CPPFLAGS)
+
+src_gtk_ui_sync_ui_moblin_SOURCES = $(src_gtk_ui_sync_ui_SOURCES)
+src_gtk_ui_sync_ui_moblin_LDADD = $(src_gtk_ui_sync_ui_LDADD)
+src_gtk_ui_sync_ui_moblin_CFLAGS = $(src_gtk_ui_sync_ui_CFLAGS)
+src_gtk_ui_sync_ui_moblin_CPPFLAGS = $(src_gtk_ui_sync_ui_CPPFLAGS) -DUSE_MOBLIN_UX
+
+CLEANFILES += \
+ src/gtk-ui/ui.xml \
+ src/gtk-ui/sync-moblin.desktop \
+ $(src_gtk_ui_applications_generated)
diff --git a/src/src.am b/src/src.am
new file mode 100644
index 00000000..590c386b
--- /dev/null
+++ b/src/src.am
@@ -0,0 +1,351 @@
+src_cppflags = -I$(top_srcdir)/src
+
+if ENABLE_GNOME_BLUETOOTH_PANEL
+include $(top_srcdir)/src/gnome-bluetooth/gnome-bluetooth.am
+src_cppflags += -I$(top_srcdir)/src/gnome-bluetooth
+endif
+
+
+if COND_CORE
+include $(top_srcdir)/src/syncevo/syncevo.am
+src_cppflags += -I$(top_srcdir)/src/syncevo
+include $(top_srcdir)/src/backends/backends.am
+src_cppflags += $(addprefix -I$(top_srcdir)/,$(BACKENDS)) -I$(SYNTHESIS_SUBDIR)
+bin_PROGRAMS += src/syncevolution
+bin_SCRIPTS += src/synccompare
+include $(top_srcdir)/src/templates/templates.am
+else
+src_cppflags += -I$(top_srcdir)/$(SYNTHESIS_SUBDIR_INCLUDES)
+endif
+
+if COND_DBUS
+include $(top_srcdir)/src/gdbus/gdbus.am
+src_cppflags += -I$(top_srcdir)/src/gdbus
+endif
+include $(top_srcdir)/src/dbus/dbus.am
+src_cppflags += -I$(top_srcdir)/src/dbus
+if COND_GUI
+include $(top_srcdir)/src/gtk-ui/gtk-ui.am
+src_cppflags += -I$(top_srcdir)/src/gtk-ui
+endif
+
+src_cppflags += -I$(top_srcdir)/test -I$(top_srcdir) $(BACKEND_CPPFLAGS)
+
+DISTCLEANFILES += src/synccompare
+CLEANFILES += src/libstdc++.a src/client-test $(CLIENT_LIB_TEST_FILES)
+
+if COND_DBUS
+nodist_bin_SCRIPTS += src/syncevo-http-server
+endif
+src/syncevo-http-server: $(top_srcdir)/test/syncevo-http-server.py
+ $(AM_V_GEN)cp $< $@
+CLEANFILES += src/syncevo-http-server
+
+nodist_bin_SCRIPTS += src/syncevo-phone-config
+src/syncevo-phone-config: $(top_srcdir)/test/syncevo-phone-config.py
+ $(AM_V_GEN)cp $< $@
+CLEANFILES += src/syncevo-phone-config
+
+SYNCEVOLUTION_DEP =
+if !ENABLE_MODULES
+# SYNCEVOLUTION_LDADD is defined in configure script.
+SYNCEVOLUTION_LDADD += @SYNCSOURCES@
+SYNCEVOLUTION_DEP += @SYNCSOURCES@
+endif
+dist_noinst_DATA += \
+ src/shlibs.local \
+ src/synthesis-includes/Makefile.am \
+ src/synthesis-includes/Makefile.in
+
+DISTCLEANFILES += src/synthesis-includes/Makefile
+
+# synccompare is created by replacing its 'import Algorithm::Diff;'
+# with a simplified copy of Diff.pm.
+src/synccompare : $(top_srcdir)/test/Algorithm/Diff.pm $(top_srcdir)/test/synccompare.pl
+ $(AM_V_GEN)perl -e '$$diff = shift; open(DIFF, "<$$diff"); ($$_) = split(/__END__/, join("", <DIFF>)); s/\*import.*//m; s/require +Exporter;//; s/^#.*\n//mg; s/ +#.*\n//mg; $$diff = $$_;' -e 'while(<>) {' @MODIFY_SYNCCOMPARE@ -e 's/use +Algorithm::Diff;/"# embedded version of Algorithm::Diff follows, copyright by the original authors\n" . $$diff . "# end of embedded Algorithm::Diff\n"/e; print;}' $+ >$@ \
+ &&chmod u+x $@
+
+CORE_SOURCES =
+
+# The files which register backends have to be compiled into
+# "client-test" and "syncevolution" in order to pull in the
+# code from the libs which implement the backends.
+#
+# Unit testing also goes there.
+#
+# When using modules the registration is done inside the
+# module and the register file is unnecessary. However, they
+# still need to be included in "make dist".
+if ENABLE_MODULES
+dist_noinst_DATA += $(BACKEND_REGISTRIES)
+else
+CORE_SOURCES += $(BACKEND_REGISTRIES)
+endif
+
+CORE_CXXFLAGS = $(SYNTHESIS_CFLAGS)
+CORE_LDADD = $(SYNCEVOLUTION_LDADD) src/syncevo/libsyncevolution.la $(GLIB_LIBS) $(GTHREAD_LIBS) $(GOBJECT_LIBS) $(LIBS)
+CORE_DEP = $(SYNCEVOLUTION_DEP) src/syncevo/libsyncevolution.la $(SYNTHESIS_DEP)
+CORE_LD_FLAGS = -Wl,-uSyncEvolution_Module_Version -Wl,--export-dynamic
+
+# put link to static c++ library into current directory, needed if compiling with --enable-static-c++
+src/libstdc++.a :
+ $(AM_V_GEN)path=`$(CXX) $(CORE_LDADD) $(LD_FLAGS) -print-file-name=src/libstdc++.a` && ln -s $$path .
+
+src_syncevolution_SOURCES = \
+ src/syncevolution.cpp \
+ src/CmdlineSyncClient.h \
+ src/CmdlineSyncClient.cpp \
+ $(CORE_SOURCES)
+
+if ENABLE_UNIT_TESTS
+nodist_src_syncevolution_SOURCES = test/test.cpp
+endif
+
+# SYNCEVOLUTION_LDADD will be replaced with libsyncebook.la/libsyncecal.la/libsyncsqlite.la
+# if linking statically against them, empty otherwise;
+# either way this does not lead to a dependency on those libs - done explicitly
+src_syncevolution_LDADD = $(CORE_LDADD) $(KEYRING_LIBS) $(KDE_KWALLET_LIBS)
+if COND_DBUS
+src_syncevolution_LDADD += src/gdbus/libgdbussyncevo.la
+endif
+src_syncevolution_LDFLAGS = $(CORE_LD_FLAGS) $(DBUS_LIBS)
+src_syncevolution_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) -I$(top_srcdir)/src/gdbus $(DBUS_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
+src_syncevolution_DEPENDENCIES = $(EXTRA_LTLIBRARIES) $(CORE_DEP)
+src_syncevolution_CPPFLAGS = $(src_cppflags)
+
+# rule which is only relevant when compiling Synthesis in subdirectory
+#$(SYNTHESIS_LIB) : $(SYNTHESIS_SUBDIR)/all
+#$(SYNTHESIS_SUBDIR)/% :
+# [ ! "$(SYNTHESIS_SUBDIR)" ] || ( cd ${dir $@} && $(MAKE) ${notdir $@} )
+
+# include Synthesis in distribution: package only files in git if using a git checkout
+all_dist_hooks += src_dist_hook
+src_dist_hook:
+ @set -x; [ ! '$(SYNTHESIS_SUBDIR)' ] || \
+ mkdir -p $(distdir)/synthesis && \
+ if test -d '$(SYNTHESIS_SRC)/.git'; \
+ then \
+ ( ( cd '$(SYNTHESIS_SRC)' && git archive HEAD ) | ( cd '$(distdir)/synthesis' && tar xf - && $$SHELL autogen.sh && rm -rf autom4te.cache ) ) && \
+ ( printf '%s' 'Creating ChangeLog...' && \
+ ( ( cd '$(SYNTHESIS_SRC)' && \
+ echo '# Generated by configure. Do not edit.' && \
+ githash=`git show-ref --head --hash | head -1` && \
+ echo "# git revision $$githash" && \
+ echo "# git tag `git describe --tags $$githash`" && \
+ echo && \
+ '$(top_srcdir)/missing' --run perl '$(top_srcdir)/build/gen-changelog.pl' ) >ChangeLog.tmp ) && \
+ ( mv -f ChangeLog.tmp '$(distdir)/synthesis/ChangeLog' && \
+ printf '%s\n' ' done.' ) || \
+ ( rm -f ChangeLog.tmp ; \
+ printf '%s\n' ' failed.'; \
+ echo 'Failed to generate ChangeLog.' >&2 ) \
+ ); \
+ elif test '$(SYNTHESIS_SRC)' != 'no-synthesis-source'; \
+ then \
+ cp -a '$(SYNTHESIS_SRC)/'* '$(distdir)/synthesis' && \
+ for i in _build autom4te.cache; do [ ! -d "$(SYNTHESIS_SRC)/$$i" ] || chmod -R u+rwx "$(SYNTHESIS_SRC)/$$i"; done && \
+ find '$(distdir)' -name '.libs' -o -name '*~' -o -name '.*' -o -name '*.o' -o -name '*.lo' -o -name 'CVS' -o -name '.svn' -o -name '.git' -o -name 'autom4te.cache' -print0 | xargs -0 rm -rf; \
+ fi
+
+clean-local: testclean
+ rm -rf src/testcases
+ [ ! -L src/templates ] || rm src/templates
+
+# files created during testing
+testclean:
+ rm -rf src/*.test.vcf src/*.log src/*.tests src/*.diff src/*.dat src/*Client_Sync_*client.*
+
+distclean-local:
+ rm -rf $(SYNTHESIS_SUBDIR)
+ rm -rf $(CLEAN_CLIENT_SRC)
+
+# Do the linking here, as with all SyncEvolution executables.
+# Sources are compiled in dbus/server.
+if COND_DBUS
+libexec_PROGRAMS += src/syncevo-dbus-server
+
+src_syncevo_dbus_server_SOURCES = \
+ $(CORE_SOURCES)
+if ENABLE_UNIT_TESTS
+nodist_src_syncevo_dbus_server_SOURCES = test/test.cpp
+endif
+
+src_syncevo_dbus_server_LDADD = src/dbus/server/libsyncevodbusserver.la src/gdbus/libgdbussyncevo.la $(CORE_LDADD) $(KEYRING_LIBS) $(LIBNOTIFY_LIBS) $(MLITE_LIBS) $(KDE_KWALLET_LIBS) $(DBUS_LIBS)
+src_syncevo_dbus_server_CPPFLAGS = -DHAVE_CONFIG_H -I$(top_srcdir)/src/gdbus $(src_cppflags) -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\"
+src_syncevo_dbus_server_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(KEYRING_CFLAGS) $(LIBNOTIFY_CFLAGS) $(MLITE_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
+src_syncevo_dbus_server_LDFLAGS = $(CORE_LD_FLAGS) $(LIBSOUP_LIBS)
+src_syncevo_dbus_server_DEPENDENCIES = src/dbus/server/libsyncevodbusserver.la src/gdbus/libgdbussyncevo.la $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(SYNTHESIS_DEP)
+endif
+
+# With --disable-shared autotools links against libfunambol.a which does not
+# pull any of the test suites into the test binary, so they would not be
+# executed. The workaround is to explicitly set them as undefined on the
+# link line.
+src_client_test_SOURCES = \
+ src/client-test-app.cpp \
+ src/CmdlineSyncClient.cpp \
+ test/ClientTest.cpp \
+ test/ClientTest.h \
+ test/client-test-main.cpp \
+ $(CORE_SOURCES)
+nodist_src_client_test_SOURCES = test/test.cpp
+
+if ENABLE_BUTEO_TESTS
+src_client_test_buteo_moc_files = src/client-test-buteo.moc.cpp
+src_client_test_SOURCES += \
+ src/client-test-buteo.h \
+ src/client-test-buteo.cpp
+nodist_src_client_test_SOURCES += $(src_client_test_buteo_moc_files)
+BUILT_SOURCES += $(src_client_test_buteo_moc_files)
+endif
+
+# list of test file base files
+#
+# Generated files (testcases/eds_event.ics.funambol.tem) are derived from
+# the original base file ($(srcdir)/test/testcases/eds_event.ics) by
+# applying a patch ($(srcdir)/test/testcases/eds_event.ics.funambol.tem.patch).
+CLIENT_LIB_TEST_FILES = \
+ src/testcases/lcs/file1.txt \
+ src/testcases/lcs/file2.txt \
+ src/testcases/local.png \
+ src/testcases/templates/clients/SyncEvolution.ini \
+ src/testcases/templates/clients/phone/nokia/S40/7210c.ini \
+ src/testcases/google_event.ics \
+ src/testcases/yahoo_contact.vcf \
+ src/testcases/eds_contact.vcf \
+ src/testcases/eds_event.ics \
+ src/testcases/eds_event.ics.local \
+ src/testcases/eds_memo.ics \
+ src/testcases/eds_task.ics
+
+# all patch files
+TEST_FILES_PATCHES = $(wildcard $(top_srcdir)/test/testcases/*.patch)
+# generated local files
+# converts from
+# $(top_srcdir)/test/testcases/eds_contact.vcf.apple.tem.patch
+# to
+# src/testcases/eds_contact.vcf.apple.tem
+TEST_FILES_GENERATED = $(subst .patch,,$(subst $(top_srcdir)/test/,src/,$(TEST_FILES_PATCHES)))
+# all patched files, regardless whether the patch already exists
+TEST_FILES_PATCHED = $(wildcard src/testcases/*.tem)
+# add files created via patches
+CLIENT_LIB_TEST_FILES += $(TEST_FILES_GENERATED)
+
+src_client_test_CPPFLAGS = -DHAVE_CONFIG_H -DENABLE_INTEGRATION_TESTS -DENABLE_UNIT_TESTS $(src_cppflags) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(QT_CPPFLAGS)
+src_client_test_CXXFLAGS = @CPPUNIT_CXXFLAGS@ $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
+src_client_test_LDFLAGS = @CPPUNIT_LDFLAGS@ `nm src/syncevo/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-Wl,-u/'` $(CORE_LD_FLAGS) $(KEYRING_LIBS) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LDFLAGS)
+src_client_test_LDADD = $(CORE_LDADD) $(SYNTHESIS_ENGINE) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LIBS)
+# These dependencies are intentionally a bit too broad:
+# they ensure that all files are in place to *run* client-test.
+
+# rule to generate patched files from patches:
+# make cannot compute the dependencies completely, so run the commands
+# on each make invocation and do the time stamp test ourselves
+#
+# If we create the patched file anew, then set its time to the more
+# recent of the two input files. That way it won't be re-generated
+# (because it is not older), and it won't be used to refresh the patch
+# either in testcase2patch (because it is not newer either).
+# That is useful on platforms where diff produces different results
+# than the one in the source (possible because the "find shortest
+# patch" problem may have multiple solutions).
+all_phonies += $(TEST_FILES_GENERATED)
+$(TEST_FILES_GENERATED):
+ @ set -e \
+ && mkdir -p 'src/testcases' \
+ && echo 'checking whether server specific test case $@ is up-to-date'; \
+ patchfile='$(top_srcdir)/test/$(subst src/,,$@).patch'; \
+ basefile='$(top_srcdir)/test/$(subst src/,,$(basename $(basename $@)))'; \
+ ( [ -e '$@' ] && [ ! '$@' -ot "$$patchfile" ] && [ ! $@ -ot "$$basefile" ] && echo ' $@ up-to-date' ) || \
+ ( [ ! -s "$$patchfile" ] && echo " copy $$basefile to $@ because patch file is empty" && cp "$$basefile" '$@' ) || \
+ ( echo " generating $@ by applying $$patchfile to $$basefile" && \
+ (echo '*** foo'; echo '--- bar'; cat "$$patchfile") | patch -s -o '$@' "$$basefile" && \
+ ( if [ "$$basefile" -ot "$$patchfile" ]; then \
+ touch -r "$$patchfile" '$@'; else \
+ touch -r "$$basefile" '$@'; fi ) \
+ )
+
+
+# rule to regenerate patches:
+# like generating the patched files, this is run every time.
+# It must avoid making the patch file more recent than the
+# patched file, otherwise the rule above would needlessly recreate
+# it (not nice when having the file open in an editor).
+#
+# To avoid needlessly updating the content of the patch file,
+# the first two lines with changing information (paths, file dates)
+# are stripped from it.
+all_phonies += testcase2patch
+testcase2patch: $(TEST_FILES_GENERATED)
+ @ set -e \
+ && echo 'checking whether test case patch files are up-to-date'; \
+ for i in src/testcases/*.tem; do \
+ temfile=`echo "$$i" | cut -d / -f 2-` \
+ patchfile="$(top_srcdir)/test/$$temfile.patch"; \
+ basefile="$(top_srcdir)/test/`echo $$temfile | cut -d . -f -2`"; \
+ if [ "$$patchfile" -ot "$$i" ] || [ "$$patchfile" -ot "$$basefile" ]; \
+ then \
+ diff -u "$$basefile" "$$i" | tail -n +3 > "$$patchfile" || true; \
+ touch -r "$$i" "$$patchfile"; \
+ echo " updated $$patchfile"; \
+ else \
+ echo " $$patchfile up-to-date"; \
+ fi; \
+ done
+
+# copy base test files
+$(filter-out %.tem, $(filter src/testcases/%, $(subst $(top_srcdir)/test/,src/,$(CLIENT_LIB_TEST_FILES)))) : src/% : $(top_srcdir)/test/%
+ $(AM_V_at)mkdir -p '$(dir $@)'; \
+ cp '$<' '$@'
+
+# The binary does not really depend on the test cases, only running it does.
+# Listing the dependencies here is done to ensure that one doesn't accidentally
+# runs the binary with out-dated auxiliary files.
+src_client_test_DEPENDENCIES = $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(CLIENT_LIB_TEST_FILES) testcase2patch src/synccompare src/templates
+
+CLEANFILES += $(src_client_test_buteo_moc_files)
+
+# copy template directory into current working directory, if not there
+# yet
+all_phonies += src/templates
+src/templates:
+ $(AM_V_at)if test '$(top_srcdir)/src/templates' != 'src/templates' && test '$(top_srcdir)' != '.'; \
+ then \
+ rm -rf src/templates; \
+ ln -s '$(top_srcdir)/src/templates' 'src/templates'; \
+ fi
+
+# distribute test system?
+if ENABLE_TESTING
+# yes: install client-test in bindir, test files in datadir
+TESTS += test/run_src_client_test.sh
+bin_PROGRAMS += src/client-test
+include $(top_srcdir)/src/testcases.am
+else
+# The "all" dependency causes a rebuild even if the actual input files
+# haven't changed. If client-test is part of the regular targets built
+# by "all", then it must not depend on all!
+EXTRA_PROGRAMS += src/client-test
+nodist_src_client_test_SOURCES += $(CLIENT_LIB_TEST_FILES)
+src_client_test_DEPENDENCIES += all
+endif
+
+# test program for output redirection, has to be built
+# and run manually
+EXTRA_PROGRAMS += src/abort-redirect
+CLEANFILES += src/abort-redirect.log
+src_abort_redirect_SOURCES = test/abort-redirect.cpp
+src_abort_redirect_CPPFLAGS = -DHAVE_CONFIG_H $(src_cppflags)
+src_abort_redirect_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(SYNCEVO_WFLAGS)
+src_abort_redirect_LDFLAGS = $(CORE_LD_FLAGS)
+src_abort_redirect_LDADD = $(CORE_LDADD)
+src_abort_redirect_DEPENDENCIES = all
+
+
+# special target for testing with valgrind
+valgrind : src/test
+ valgrind --leak-check=yes --suppressions=valgrind.supp src/client-test
+
+# old-style name for test program(s)
+all_phonies += test valgrind
+src/test: src/client-test
diff --git a/src/syncevo/.gitignore b/src/syncevo/.gitignore
deleted file mode 100644
index 86e90402..00000000
--- a/src/syncevo/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/CmdlineHelp.c
-/SyncEvolutionXML.c
-/syncevolution.pc
diff --git a/src/syncevo/Makefile.am b/src/syncevo/Makefile.am
deleted file mode 100644
index 4495a88e..00000000
--- a/src/syncevo/Makefile.am
+++ /dev/null
@@ -1,220 +0,0 @@
-AM_CPPFLAGS = @BACKEND_CPPFLAGS@ @GLIB_CFLAGS@ -I$(top_srcdir)/test -I$(top_srcdir)/src -DSYNCEVO_BACKEND=\"$(backendsearchdir)\"
-
-SUBDIRS = configs
-BUILT_SOURCES =
-
-# applies to sources in SyncEvolution repository, but not
-# the Funambol C++ client library
-SYNCEVOLUTION_CXXFLAGS = @SYNCEVOLUTION_CXXFLAGS@
-
-SYNCEVOLUTION_LDADD = @SYNCEVOLUTION_LDADD@
-MAINTAINERCLEANFILES = Makefile.in
-
-if ENABLE_UNIT_TESTS
-SYNCEVOLUTION_CXXFLAGS += $(CPPUNIT_CXXFLAGS)
-SYNCEVOLUTION_LDADD += $(CPPUNIT_LDFLAGS)
-endif
-
-lib_LTLIBRARIES = libsyncevolution.la
-
-SYNCEVOLUTION_SOURCES = \
- ConfigTree.h \
- ConfigFilter.h \
- ConfigFilter.cpp \
- ConfigNode.h \
- ConfigNode.cpp \
- HashConfigNode.h \
- VolatileConfigNode.h \
- VolatileConfigTree.h \
- SmartPtr.h \
- eds_abi_wrapper.h \
- eds_abi_wrapper.cpp \
- GLibSupport.h \
- GLibSupport.cpp \
- \
- SyncML.h \
- SyncML.cpp \
- \
- SynthesisEngine.h \
- SynthesisEngine.cpp \
- \
- Logging.h \
- Logging.cpp \
- LogStdout.h \
- LogStdout.cpp \
- LogRedirect.h \
- LogRedirect.cpp \
- \
- TransportAgent.h \
- TransportAgent.cpp \
- CurlTransportAgent.h \
- CurlTransportAgent.cpp \
- \
- SoupTransportAgent.h \
- SoupTransportAgent.cpp \
- \
- LocalTransportAgent.h \
- LocalTransportAgent.cpp \
- \
- util.cpp \
- util.h \
- \
- lcs.h \
- lcs.cpp \
- \
- Cmdline.cpp \
- Cmdline.h \
- \
- SyncSource.h \
- SyncSource.cpp \
- \
- SynthesisDBPlugin.cpp \
- \
- SyncContext.h \
- SyncContext.cpp \
- \
- SyncConfig.h \
- SyncConfig.cpp \
- \
- DevNullConfigNode.h \
- MultiplexConfigNode.h \
- MultiplexConfigNode.cpp \
- \
- FilterConfigNode.h \
- FilterConfigNode.cpp \
- \
- SafeConfigNode.h \
- SafeConfigNode.cpp \
- \
- PrefixConfigNode.h \
- PrefixConfigNode.cpp \
- \
- FileConfigNode.h \
- FileConfigNode.cpp \
- \
- IniConfigNode.h \
- IniConfigNode.cpp \
- SingleFileConfigTree.h \
- SingleFileConfigTree.cpp \
- \
- DataBlob.h \
- FileDataBlob.h \
- FileDataBlob.cpp \
- StringDataBlob.h \
- StringDataBlob.cpp \
- \
- SafeOstream.h \
- SafeOstream.cpp \
- \
- FileConfigTree.h \
- FileConfigTree.cpp \
- \
- MapSyncSource.h \
- MapSyncSource.cpp \
- \
- TrackingSyncSource.h \
- TrackingSyncSource.cpp
-
-if ENABLE_ICAL
-SYNCEVOLUTION_SOURCES += \
- icalstrdup.c \
- icalstrdup.h
-endif
-
-
-libsyncevolution_includedir= $(includedir)/syncevo
-libsyncevolution_include_HEADERS = \
- declarations.h \
- Cmdline.h \
- ConfigFilter.h \
- GLibSupport.h \
- TrackingSyncSource.h \
- MapSyncSource.h \
- LogRedirect.h \
- LogStdout.h \
- FileConfigNode.h \
- FilterConfigNode.h \
- PrefixConfigNode.h \
- SafeConfigNode.h \
- SyncConfig.h \
- SyncSource.h \
- util.h \
- SyncContext.h \
- SynthesisEngine.h \
- Logging.h \
- SyncML.h \
- eds_abi_wrapper.h \
- icalstrdup.h \
- SmartPtr.h \
- ConfigNode.h
-
-
-if ENABLE_OBEX
-SYNCEVOLUTION_SOURCES += ObexTransportAgent.h ObexTransportAgent.cpp
-SYNCEVOLUTION_LDADD += $(LIBOPENOBEX_LIBS)
-SYNCEVOLUTION_CXXFLAGS += $(LIBOPENOBEX_CFLAGS)
-if ENABLE_BLUETOOTH
-SYNCEVOLUTION_LDADD += $(BLUEZ_LIBS)
-SYNCEVOLUTION_CXXFLAGS += $(BLUEZ_CFLAGS)
-endif
-endif
-
-pkgconfigdir=$(libdir)/pkgconfig
-pkgconfig_DATA=syncevolution.pc
-DISTCLEANFILES =syncevolution.pc
-EXTRA_DIST =syncevolution.pc.in
-
-libsyncevolution_la_SOURCES = $(SYNCEVOLUTION_SOURCES)
-nodist_libsyncevolution_la_SOURCES = SyncEvolutionXML.c
-CLEANFILES = SyncEvolutionXML.c
-libsyncevolution_la_LIBADD = @EPACKAGE_LIBS@ @GIO_LIBS@ @GTHREAD_LIBS@ @GLIB_LIBS@ $(SYNTHESIS_LIBS) $(TRANSPORT_LIBS) @LIBS@ $(SYNCEVOLUTION_LDADD) $(NSS_LIBS)
-libsyncevolution_la_CXXFLAGS = $(TRANSPORT_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(SYNTHESIS_CFLAGS) $(NSS_CFLAGS)
-libsyncevolution_la_CPPFLAGS = $(AM_CPPFLAGS) \
- -DDATA_DIR=\""$(pkgdatadir)"\" \
- -DXML_CONFIG_DIR=\""$(datadir)/syncevolution/xml"\" \
- -DTEMPLATE_DIR=\""$(datadir)/syncevolution/templates"\" \
- -DLIBDIR=\""$(libdir)"\"
-libsyncevolution_la_DEPENDENCIES = $(SYNTHESIS_DEP)
-
-if ENABLE_MODULES
-libsyncevolution_la_LDFLAGS =
-else
-libsyncevolution_la_LDFLAGS = -static
-endif
-
-# command which embeds its input lines into a C-style string that runs across multiple lines
-TO_C_STRING = sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/'
-
-# Don't depend on specific XML files. Instead recreate
-# SyncEvolutionXML.c each time make is invoked (allows including new
-# fragments in the binary without rerunning configure).
-SyncEvolutionXML.c: GenSyncEvolutionXML
-.PHONY: GenSyncEvolutionXML
-GenSyncEvolutionXML:
- echo "const char *SyncEvolutionXMLClient =" > SyncEvolutionXML.c.new
- (cd $(srcdir)/configs && perl update-samples.pl syncevolution.xml client ) | \
- perl -p -e 's;</datatypes>; <fieldlists/>\n <profiles/>\n <datatypedefs/>\n </datatypes>;' | \
- $(TO_C_STRING) >>SyncEvolutionXML.c.new
- echo ";" >>SyncEvolutionXML.c.new
- echo "const char *SyncEvolutionXMLClientRules =" >> SyncEvolutionXML.c.new
- (cd $(srcdir)/configs && cat remoterules/*.xml remoterules/client/*.xml) | $(TO_C_STRING) >>SyncEvolutionXML.c.new
- echo ";" >>SyncEvolutionXML.c.new
- if cmp SyncEvolutionXML.c SyncEvolutionXML.c.new >/dev/null; then rm SyncEvolutionXML.c.new; else mv SyncEvolutionXML.c.new SyncEvolutionXML.c; fi
-
-# turn README.rst into a file with plain text strings for
-# "Synopsis" and "Usage"
-CLEANFILES += CmdlineHelp.c
-BUILT_SOURCES += CmdlineHelp.c
-EXTRA_DIST += readme2c.pl
-CmdlineHelp.c: readme2c.pl $(top_srcdir)/README.rst
- perl $+ >$@
-
-# include boost in distribution
-#dist-hook:
-# cp -r $(srcdir)/boost $(distdir)
-# find $(distdir) -name .libs -o -name "*~" -o -name ".*" -o -name "*.o" -o -name "*.lo" -o -name CVS -o -name autom4te.cache | xargs rm -rf
-
-# make sure that the installed development files are usable
-installcheck-local: $(srcdir)/installcheck-local.sh
- env PKG_CONFIG_PATH=$(DESTDIR)/$(pkgconfigdir):$$PKG_CONFIG_PATH $< "$(DESTDIR)/$(libsyncevolution_includedir)" "$(DESTDIR)/$(includedir)" "$(DESTDIR)/$(libdir)"
-EXTRA_DIST += installcheck-local.sh
diff --git a/src/syncevo/SingleFileConfigTree.h b/src/syncevo/SingleFileConfigTree.h
index adf31188..601a4c43 100644
--- a/src/syncevo/SingleFileConfigTree.h
+++ b/src/syncevo/SingleFileConfigTree.h
@@ -20,9 +20,9 @@
#ifndef INCL_EVOLUTION_SINGLE_FILE_CONFIG_TREE
# define INCL_EVOLUTION_SINGLE_FILE_CONFIG_TREE
-#include <ConfigTree.h>
-#include <DataBlob.h>
-#include <util.h>
+#include <syncevo/ConfigTree.h>
+#include <syncevo/DataBlob.h>
+#include <syncevo/util.h>
#include <string>
#include <map>
diff --git a/src/syncevo/SoupTransportAgent.cpp b/src/syncevo/SoupTransportAgent.cpp
index 3cd56bc3..ba38cd7b 100644
--- a/src/syncevo/SoupTransportAgent.cpp
+++ b/src/syncevo/SoupTransportAgent.cpp
@@ -24,7 +24,7 @@
#include <algorithm>
#include <libsoup/soup-status.h>
-#include <Logging.h>
+#include <syncevo/Logging.h>
#ifdef HAVE_LIBSOUP_SOUP_GNOME_FEATURES_H
#include <libsoup/soup-gnome-features.h>
diff --git a/src/syncevo/configs/Makefile.am b/src/syncevo/configs/Makefile.am
deleted file mode 100644
index fc449bf4..00000000
--- a/src/syncevo/configs/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-xmldir = $(datadir)/syncevolution/xml
-nobase_dist_xml_DATA = $(shell cd $(srcdir) && find * -name '*.xml') update-samples.pl
diff --git a/src/syncevo/configs/configs.am b/src/syncevo/configs/configs.am
new file mode 100644
index 00000000..44ced442
--- /dev/null
+++ b/src/syncevo/configs/configs.am
@@ -0,0 +1,7 @@
+src_syncevo_configs_xmldir = $(datadir)/syncevolution/xml
+dist_src_syncevo_configs_xml_SCRIPTS = src/syncevo/configs/update-samples.pl
+
+dist_noinst_DATA += \
+ src/syncevo/configs/README
+
+include $(top_srcdir)/src/syncevo/configs/configs_xml.am
diff --git a/src/syncevo/configs/configs_xml.am b/src/syncevo/configs/configs_xml.am
new file mode 100644
index 00000000..d878b37e
--- /dev/null
+++ b/src/syncevo/configs/configs_xml.am
@@ -0,0 +1,31 @@
+# TODO: preferably generate this list instead
+#./*.xml
+src_syncevo_configsdir = $(datadir)/syncevolution/xml
+dist_src_syncevo_configs_DATA = $(wildcard src/syncevo/configs/*.xml)
+# ./datatypes/*.xml
+src_syncevo_configs_datatypesdir = $(datadir)/syncevolution/xml/datatypes
+dist_src_syncevo_configs_datatypes_DATA = $(wildcard src/syncevo/configs/datatypes/*.xml)
+# ./datatypes/server/*.xml
+src_syncevo_configs_datatypes_serverdir = $(datadir)/syncevolution/xml/datatypes/server
+dist_src_syncevo_configs_datatypes_server_DATA = $(wildcard src/syncevo/configs/datatypes/server/*.xml)
+# ./debug/*.xml
+src_syncevo_configs_debugdir = $(datadir)/syncevolution/xml/debug
+dist_src_syncevo_configs_debug_DATA = $(wildcard src/syncevo/configs/debug/*.xml)
+# ./remoterules/*.xml
+src_syncevo_configs_remoterulesdir = $(datadir)/syncevolution/xml/remoterules
+dist_src_syncevo_configs_remoterules_DATA = $(wildcard src/syncevo/configs/remoterules/*.xml)
+# ./remoterules/client/*.xml
+src_syncevo_configs_remoterules_clientdir = $(datadir)/syncevolution/xml/remoterules/client
+dist_src_syncevo_configs_remoterules_client_DATA = $(wildcard src/syncevo/configs/remoterules/client/*.xml)
+# ./remoterules/server/*.xml
+src_syncevo_configs_remoterules_serverdir = $(datadir)/syncevolution/xml/remoterules/server
+dist_src_syncevo_configs_remoterules_server_DATA = $(wildcard src/syncevo/configs/remoterules/server/*.xml)
+# ./scripting/*.xml
+src_syncevo_configs_scriptingdir = $(datadir)/syncevolution/xml/scripting
+dist_src_syncevo_configs_scripting_DATA = $(wildcard src/syncevo/configs/scripting/*.xml)
+# ./scripting/client/*.xml
+src_syncevo_configs_scripting_clientdir = $(datadir)/syncevolution/xml/scripting/client
+dist_src_syncevo_configs_scripting_client_DATA = $(wildcard src/syncevo/configs/scripting/client/*.xml)
+# ./scripting/server/*.xml
+src_syncevo_configs_scripting_serverdir = $(datadir)/syncevolution/xml/scripting/server
+dist_src_syncevo_configs_scripting_server_DATA = $(wildcard src/syncevo/configs/scripting/server/*.xml)
diff --git a/src/syncevo/syncevo.am b/src/syncevo/syncevo.am
new file mode 100644
index 00000000..2521eaca
--- /dev/null
+++ b/src/syncevo/syncevo.am
@@ -0,0 +1,246 @@
+include $(top_srcdir)/src/syncevo/configs/configs.am
+
+# applies to sources in SyncEvolution repository, but not
+# the Funambol C++ client library
+src_syncevo_cxxflags = @SYNCEVOLUTION_CXXFLAGS@
+src_syncevo_cppflags = @BACKEND_CPPFLAGS@ @GLIB_CFLAGS@ -I$(top_srcdir)/test -I$(top_builddir)/src/syncevo -I$(top_srcdir)/src -DSYNCEVO_BACKEND=\"$(BACKENDS_SEARCH_DIRECTORY)\"
+src_syncevo_ldadd = @SYNCEVOLUTION_LDADD@
+
+if ENABLE_UNIT_TESTS
+src_syncevo_cxxflags += $(CPPUNIT_CXXFLAGS)
+src_syncevo_ldadd += $(CPPUNIT_LDFLAGS)
+endif
+
+lib_LTLIBRARIES += src/syncevo/libsyncevolution.la
+
+src_syncevo_sources = \
+ src/syncevo/ConfigTree.h \
+ src/syncevo/ConfigFilter.h \
+ src/syncevo/ConfigFilter.cpp \
+ src/syncevo/ConfigNode.h \
+ src/syncevo/ConfigNode.cpp \
+ src/syncevo/HashConfigNode.h \
+ src/syncevo/VolatileConfigNode.h \
+ src/syncevo/VolatileConfigTree.h \
+ src/syncevo/SmartPtr.h \
+ src/syncevo/eds_abi_wrapper.h \
+ src/syncevo/eds_abi_wrapper.cpp \
+ src/syncevo/GLibSupport.h \
+ src/syncevo/GLibSupport.cpp \
+ \
+ src/syncevo/SyncML.h \
+ src/syncevo/SyncML.cpp \
+ \
+ src/syncevo/SynthesisEngine.h \
+ src/syncevo/SynthesisEngine.cpp \
+ \
+ src/syncevo/Logging.h \
+ src/syncevo/Logging.cpp \
+ src/syncevo/LogStdout.h \
+ src/syncevo/LogStdout.cpp \
+ src/syncevo/LogRedirect.h \
+ src/syncevo/LogRedirect.cpp \
+ \
+ src/syncevo/TransportAgent.h \
+ src/syncevo/TransportAgent.cpp \
+ src/syncevo/CurlTransportAgent.h \
+ src/syncevo/CurlTransportAgent.cpp \
+ \
+ src/syncevo/SoupTransportAgent.h \
+ src/syncevo/SoupTransportAgent.cpp \
+ \
+ src/syncevo/LocalTransportAgent.h \
+ src/syncevo/LocalTransportAgent.cpp \
+ \
+ src/syncevo/util.cpp \
+ src/syncevo/util.h \
+ \
+ src/syncevo/lcs.h \
+ src/syncevo/lcs.cpp \
+ \
+ src/syncevo/Cmdline.cpp \
+ src/syncevo/Cmdline.h \
+ \
+ src/syncevo/SyncSource.h \
+ src/syncevo/SyncSource.cpp \
+ \
+ src/syncevo/SynthesisDBPlugin.cpp \
+ \
+ src/syncevo/SyncContext.h \
+ src/syncevo/SyncContext.cpp \
+ \
+ src/syncevo/SyncConfig.h \
+ src/syncevo/SyncConfig.cpp \
+ \
+ src/syncevo/DevNullConfigNode.h \
+ src/syncevo/MultiplexConfigNode.h \
+ src/syncevo/MultiplexConfigNode.cpp \
+ \
+ src/syncevo/FilterConfigNode.h \
+ src/syncevo/FilterConfigNode.cpp \
+ \
+ src/syncevo/SafeConfigNode.h \
+ src/syncevo/SafeConfigNode.cpp \
+ \
+ src/syncevo/PrefixConfigNode.h \
+ src/syncevo/PrefixConfigNode.cpp \
+ \
+ src/syncevo/FileConfigNode.h \
+ src/syncevo/FileConfigNode.cpp \
+ \
+ src/syncevo/IniConfigNode.h \
+ src/syncevo/IniConfigNode.cpp \
+ src/syncevo/SingleFileConfigTree.h \
+ src/syncevo/SingleFileConfigTree.cpp \
+ \
+ src/syncevo/DataBlob.h \
+ src/syncevo/FileDataBlob.h \
+ src/syncevo/FileDataBlob.cpp \
+ src/syncevo/StringDataBlob.h \
+ src/syncevo/StringDataBlob.cpp \
+ \
+ src/syncevo/SafeOstream.h \
+ src/syncevo/SafeOstream.cpp \
+ \
+ src/syncevo/FileConfigTree.h \
+ src/syncevo/FileConfigTree.cpp \
+ \
+ src/syncevo/MapSyncSource.h \
+ src/syncevo/MapSyncSource.cpp \
+ \
+ src/syncevo/TrackingSyncSource.h \
+ src/syncevo/TrackingSyncSource.cpp
+
+if ENABLE_ICAL
+src_syncevo_sources += \
+ src/syncevo/icalstrdup.c \
+ src/syncevo/icalstrdup.h
+endif
+
+
+src_syncevo_libsyncevolution_includedir= $(includedir)/syncevo
+src_syncevo_libsyncevolution_include_HEADERS = \
+ src/syncevo/declarations.h \
+ src/syncevo/Cmdline.h \
+ src/syncevo/ConfigFilter.h \
+ src/syncevo/GLibSupport.h \
+ src/syncevo/TrackingSyncSource.h \
+ src/syncevo/MapSyncSource.h \
+ src/syncevo/LogRedirect.h \
+ src/syncevo/LogStdout.h \
+ src/syncevo/FileConfigNode.h \
+ \
+ src/syncevo/FilterConfigNode.h \
+ src/syncevo/PrefixConfigNode.h \
+ src/syncevo/SafeConfigNode.h \
+ src/syncevo/SyncConfig.h \
+ src/syncevo/SyncSource.h \
+ src/syncevo/util.h \
+ src/syncevo/SyncContext.h \
+ src/syncevo/SynthesisEngine.h \
+ src/syncevo/Logging.h \
+ src/syncevo/SyncML.h \
+ src/syncevo/eds_abi_wrapper.h \
+ src/syncevo/icalstrdup.h \
+ src/syncevo/SmartPtr.h \
+ src/syncevo/ConfigNode.h
+
+
+if ENABLE_OBEX
+src_syncevo_sources += \
+ src/syncevo/ObexTransportAgent.h \
+ src/syncevo/ObexTransportAgent.cpp
+
+src_syncevo_ldadd += $(LIBOPENOBEX_LIBS)
+src_syncevo_cxxflags += $(LIBOPENOBEX_CFLAGS)
+if ENABLE_BLUETOOTH
+src_syncevo_ldadd += $(BLUEZ_LIBS)
+src_syncevo_cxxflags += $(BLUEZ_CFLAGS)
+endif
+endif
+
+#pkgconfigdir is defined in $(top_srcdir)/setup-variables.am
+pkgconfig_DATA += src/syncevo/syncevolution.pc
+DISTCLEANFILES += src/syncevo/syncevolution.pc
+dist_noinst_DATA += src/syncevo/syncevolution.pc.in
+
+src_syncevo_libsyncevolution_la_SOURCES = $(src_syncevo_sources)
+nodist_src_syncevo_libsyncevolution_la_SOURCES = src/syncevo/SyncEvolutionXML.c
+CLEANFILES += src/syncevo/SyncEvolutionXML.c
+src_syncevo_libsyncevolution_la_LIBADD = \
+ @EPACKAGE_LIBS@ \
+ @GIO_LIBS@ \
+ @GTHREAD_LIBS@ \
+ @GLIB_LIBS@ \
+ $(SYNTHESIS_LIBS) \
+ $(TRANSPORT_LIBS) \
+ @LIBS@ \
+ $(src_syncevo_ldadd) \
+ $(NSS_LIBS)
+src_syncevo_libsyncevolution_la_CXXFLAGS = \
+ $(TRANSPORT_CFLAGS) \
+ $(src_syncevo_cxxflags) \
+ $(SYNTHESIS_CFLAGS) \
+ $(NSS_CFLAGS) \
+ $(SYNCEVO_WFLAGS)
+src_syncevo_libsyncevolution_la_CFLAGS = \
+ $(SYNCEVO_WFLAGS)
+src_syncevo_libsyncevolution_la_CPPFLAGS = \
+ $(src_syncevo_cppflags) \
+ -DDATA_DIR=\""$(pkgdatadir)"\" \
+ -DXML_CONFIG_DIR=\""$(datadir)/syncevolution/xml"\" \
+ -DTEMPLATE_DIR=\""$(datadir)/syncevolution/templates"\" \
+ -DLIBDIR=\""$(libdir)"\"
+src_syncevo_libsyncevolution_la_DEPENDENCIES = $(SYNTHESIS_DEP) @SYNCEVOLUTION_LDADD@
+
+if ENABLE_MODULES
+src_syncevo_libsyncevolution_la_LDFLAGS =
+else
+src_syncevo_libsyncevolution_la_LDFLAGS = -static
+endif
+
+# command which embeds its input lines into a C-style string that runs across multiple lines
+TO_C_STRING = sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/'
+
+# Don't depend on specific XML files. Instead recreate
+# SyncEvolutionXML.c each time make is invoked (allows including new
+# fragments in the binary without rerunning configure).
+src/syncevo/SyncEvolutionXML.c: src/syncevo/GenSyncEvolutionXML
+ $(AM_V_GEN)
+ @true
+all_phonies += src/syncevo/GenSyncEvolutionXML
+src/syncevo/GenSyncEvolutionXML:
+ $(AM_V_at)echo "const char *SyncEvolutionXMLClient =" >src/syncevo/SyncEvolutionXML.c.new \
+ && (cd $(top_srcdir)/src/syncevo/configs && perl update-samples.pl syncevolution.xml client ) | \
+ perl -p -e 's;</datatypes>; <fieldlists/>\n <profiles/>\n <datatypedefs/>\n </datatypes>;' | \
+ $(TO_C_STRING) >>src/syncevo/SyncEvolutionXML.c.new \
+ && echo ";" >>src/syncevo/SyncEvolutionXML.c.new \
+ && echo "const char *SyncEvolutionXMLClientRules =" >>src/syncevo/SyncEvolutionXML.c.new \
+ && (cd $(top_srcdir)/src/syncevo/configs && cat remoterules/*.xml remoterules/client/*.xml) | $(TO_C_STRING) >>src/syncevo/SyncEvolutionXML.c.new \
+ && echo ";" >>src/syncevo/SyncEvolutionXML.c.new \
+ && if cmp -s src/syncevo/SyncEvolutionXML.c src/syncevo/SyncEvolutionXML.c.new; \
+ then \
+ rm src/syncevo/SyncEvolutionXML.c.new; \
+ else \
+ mv src/syncevo/SyncEvolutionXML.c.new src/syncevo/SyncEvolutionXML.c; \
+ fi;
+
+# turn README.rst into a file with plain text strings for
+# "Synopsis" and "Usage"
+CLEANFILES += src/syncevo/CmdlineHelp.c
+BUILT_SOURCES += src/syncevo/CmdlineHelp.c
+dist_noinst_SCRIPTS += src/syncevo/readme2c.pl
+src/syncevo/CmdlineHelp.c: src/syncevo/readme2c.pl $(top_srcdir)/README.rst
+ $(AM_V_GEN)perl $+ >$@
+
+# include boost in distribution
+#dist-hook:
+# cp -r $(srcdir)/boost $(distdir)
+# find $(distdir) -name .libs -o -name "*~" -o -name ".*" -o -name "*.o" -o -name "*.lo" -o -name CVS -o -name autom4te.cache | xargs rm -rf
+
+# make sure that the installed development files are usable
+src_syncevo_install_check_local: $(top_srcdir)/src/syncevo/installcheck-local.sh
+ env PKG_CONFIG_PATH=$(DESTDIR)/$(pkgconfigdir):$$PKG_CONFIG_PATH $< "$(DESTDIR)/$(src_syncevo_libsyncevolution_includedir)" "$(DESTDIR)/$(includedir)" "$(DESTDIR)/$(libdir)"
+
+all_local_installchecks += src_syncevo_install_check_local
+dist_noinst_SCRIPTS += src/syncevo/installcheck-local.sh
diff --git a/src/syncevo/syncevolution.pc.in b/src/syncevo/syncevolution.pc.in
index ef46d44d..aaecb924 100644
--- a/src/syncevo/syncevolution.pc.in
+++ b/src/syncevo/syncevolution.pc.in
@@ -3,6 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
backenddir=@libdir@/syncevolution/backends
+datarootdir=@datarootdir@
templatedir=@datadir@/syncevolution/templates
Name: libsyncevolution
diff --git a/src/templates/templates.am b/src/templates/templates.am
new file mode 100644
index 00000000..1fe1ffb8
--- /dev/null
+++ b/src/templates/templates.am
@@ -0,0 +1,16 @@
+# TODO: preferably generate this list instead
+# ./
+src_templatesdir = $(datadir)/syncevolution/templates
+dist_src_templates_DATA = src/templates/README
+# ./clients
+src_templates_clientsdir = $(datadir)/syncevolution/templates/clients
+dist_src_templates_clients_DATA = $(wildcard src/templates/clients/*.ini)
+# ./clients/phone
+src_templates_clients_phonedir = $(datadir)/syncevolution/templates/clients/phone
+dist_src_templates_clients_phone_DATA = $(wildcard src/templates/clients/phone/*.ini)
+# ./contexts
+src_templates_contextsdir = $(datadir)/syncevolution/templates/contexts
+dist_src_templates_contexts_DATA = $(wildcard src/templates/contexts/*.ini)
+# ./servers
+src_templates_serversdir = $(datadir)/syncevolution/templates/servers
+dist_src_templates_servers_DATA = $(wildcard src/templates/servers/*.ini)
diff --git a/src/testcases.am b/src/testcases.am
new file mode 100644
index 00000000..6a065687
--- /dev/null
+++ b/src/testcases.am
@@ -0,0 +1,27 @@
+# this file is not standalone. it needs variable TEST_FILES_GENERATED to be
+# already defined.
+
+src_testcasesdir = $(docdir)/testcases
+dist_src_testcases_DATA = \
+ src/testcases/local.png \
+ src/testcases/google_event.ics \
+ src/testcases/yahoo_contact.vcf \
+ src/testcases/eds_contact.vcf \
+ src/testcases/eds_event.ics \
+ src/testcases/eds_event.ics.local \
+ src/testcases/eds_memo.ics \
+ src/testcases/eds_task.ics \
+ $(TEST_FILES_GENERATED)
+
+src_testcases_lcsdir = $(docdir)/testcases/lcs
+dist_src_testcases_lcs_DATA = \
+ src/testcases/lcs/file1.txt \
+ src/testcases/lcs/file2.txt
+
+src_testcases_templates_clientsdir = $(docdir)/testcases/templates/clients
+dist_src_testcases_templates_clients_DATA = \
+ src/testcases/templates/clients/SyncEvolution.ini
+
+src_testcases_templates_clients_phone_nokia_s40dir = $(docdir)/testcases/templates/clients/phone/nokia/S40
+dist_src_testcases_templates_clients_phone_nokia_s40_DATA = \
+ src/testcases/templates/clients/phone/nokia/S40/7210c.ini
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index cfec2ded..00000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-EXTRA_DIST = \
- abort-redirect.cpp \
- ClientTest.h \
- ClientTest.cpp \
- COPYING \
- client-test-main.cpp \
- test.h \
- test.cpp \
- Algorithm/Artistic \
- Algorithm/COPYING \
- Algorithm/Diff.pm \
- Algorithm/README \
- testcases/eds_event.ics \
- testcases/eds_event.ics.local \
- testcases/eds_task.ics \
- testcases/vcal10.ics \
- testcases/eds_contact.vcf \
- testcases/eds_contact.vcf \
- testcases/eds_memo.ics \
- testcases/google_event.ics \
- testcases/yahoo_contact.vcf \
- testcases/lcs/file1.txt \
- testcases/lcs/file2.txt \
- testcases/local.png \
- testcases/templates/clients/phone/nokia/S40/7210c.ini \
- testcases/templates/clients/SyncEvolution.ini \
- syncevo-http-server.py \
- syncevo-http-server-logging.conf \
- syncevo-phone-config.py \
- $(wildcard testcases/*.patch) \
- synccompare.pl
diff --git a/test/run_src_client_test.sh b/test/run_src_client_test.sh
new file mode 100755
index 00000000..740da46b
--- /dev/null
+++ b/test/run_src_client_test.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# This script is run by `make check'. Since `make check' is run from top source
+# directory and `client-test' is expected to be run from `src' directory, this
+# script have to be employed, so `client-test' can find some files.
+cd 'src' && ./client-test
diff --git a/test/test-dbus.py b/test/test-dbus.py
index 16d2b4f6..60aed1a6 100755
--- a/test/test-dbus.py
+++ b/test/test-dbus.py
@@ -291,6 +291,28 @@ def ShutdownSubprocess(popen, timeout):
return False
return True
+def TryKill(pid, signal):
+ try:
+ os.kill(pid, signal)
+ except OSError, ex:
+ # might have quit in the meantime, deal with the race
+ # condition
+ if ex.errno != 3:
+ raise ex
+
+def ShutdownSubprocess(popen, timeout):
+ start = time.time()
+ if popen.poll() == None:
+ TryKill(popen.pid, signal.SIGTERM)
+ while popen.poll() == None and start + timeout >= time.time():
+ time.sleep(0.01)
+ if popen.poll() == None:
+ TryKill(popen.pid, signal.SIGKILL)
+ while popen.poll() == None and start + timeout + 1 >= time.time():
+ time.sleep(0.01)
+ return False
+ return True
+
class DBusUtil(Timeout):
"""Contains the common run() method for all D-Bus test suites
and some utility functions."""
diff --git a/test/test.am b/test/test.am
new file mode 100644
index 00000000..37ea3ba9
--- /dev/null
+++ b/test/test.am
@@ -0,0 +1,36 @@
+dist_noinst_DATA += \
+ test/abort-redirect.cpp \
+ test/ClientTest.h \
+ test/ClientTest.cpp \
+ test/client-test-main.cpp \
+ test/test.h \
+ test/test.cpp
+
+dist_noinst_SCRIPTS += \
+ test/Algorithm/Diff.pm \
+ test/syncevo-http-server.py \
+ test/syncevo-phone-config.py \
+ test/synccompare.pl \
+ test/run_src_client_test.sh
+
+dist_noinst_DATA += \
+ test/COPYING \
+ test/Algorithm/Artistic \
+ test/Algorithm/COPYING \
+ test/Algorithm/README \
+ test/testcases/eds_event.ics \
+ test/testcases/eds_event.ics.local \
+ test/testcases/eds_task.ics \
+ test/testcases/vcal10.ics \
+ test/testcases/eds_contact.vcf \
+ test/testcases/eds_contact.vcf \
+ test/testcases/eds_memo.ics \
+ test/testcases/google_event.ics \
+ test/testcases/yahoo_contact.vcf \
+ test/testcases/lcs/file1.txt \
+ test/testcases/lcs/file2.txt \
+ test/testcases/local.png \
+ test/testcases/templates/clients/phone/nokia/S40/7210c.ini \
+ test/testcases/templates/clients/SyncEvolution.ini \
+ test/syncevo-http-server-logging.conf \
+ $(wildcard test/testcases/*.patch)