sqlite backend: made it possible to compile out-of-tree

config.h is now only included if HAVE_CONFIG_H is set.
ENABLE_SQLITE can be set via -D instead.

Removed inclusion of "test.h" and "syncevo/Logging.h",
we don't install it.

Moved header files around so that they are only
included when needed.

Added a README with compile instructions.
This commit is contained in:
Patrick Ohly 2009-10-02 15:02:13 +02:00
parent 2e938f6520
commit 7e0770461f
4 changed files with 41 additions and 5 deletions

View File

@ -0,0 +1,28 @@
This is a demo backend. It uses a database schema that is similar to
the one used on the iPhone, but it is not as complete.
To compile this backend as part of SyncEvolution, configure with
--enable-sqlite.
To compile it against a binary distribution of SyncEvolution, make
sure that the SyncEvolution, Synthesis and sqlite developer files are
installed and that pkg-config can find syncevolution.pc, synthesis.pc
and sqlite.pc. Set your PKG_CONFIG_PATH if necessary.
Then the source files can be compiled as follows:
g++ -fpic -DPIC -DENABLE_SQLITE -shared -I. \
`pkg-config --cflags --libs syncevolution`
`pkg-config --cflags --libs sqlite`
*.cpp \
-o /tmp/syncsqlite.so
Install /tmp/syncsqlite.so by moving it into the
"lib/syncevolution/backends" directory of the SyncEvolution
installation.
It then should show up as additional choice for the "type" property:
syncevolution --source-property type=?
...
SQLite Address Book = addressbook = contacts = sqlite-contacts
vCard 2.1 (default) = text/x-vcard

View File

@ -18,15 +18,17 @@
* 02110-1301 USA
*/
#include "config.h"
#include <syncevo/Logging.h>
#include <syncevo/SynthesisEngine.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <synthesis/SDK_util.h>
#ifdef ENABLE_SQLITE
#include "SQLiteContactSource.h"
#include <syncevo/SynthesisEngine.h>
#include <synthesis/sync_dbapi.h>
#include <algorithm>
#include <cctype>

View File

@ -19,7 +19,11 @@
*/
#include "SQLiteContactSource.h"
#include "test.h"
#ifdef ENABLE_UNIT_TESTS
# include <cppunit/extensions/TestFactoryRegistry.h>
# include <cppunit/extensions/HelperMacros.h>
#endif
static SyncSource *createSource(const SyncSourceParams &params)
{

View File

@ -17,7 +17,9 @@
* 02110-1301 USA
*/
#include "config.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef ENABLE_SQLITE