[tracker/tracker-0.10] libtracker-sparql: Use static linking instead of plugins



commit cd35ed6b92a66522dd0b20ce55afbf421569e7ab
Author: Jürg Billeter <j bitron ch>
Date:   Fri Apr 1 15:35:10 2011 +0200

    libtracker-sparql: Use static linking instead of plugins
    
    Plugin loading in threads may be problematic in certain environments.
    As we do not currently support external plugins anyway, this changes
    libtracker-bus and libtracker-direct to be part of libtracker-sparql.
    This will also slightly improve initialization performance.
    
    Fixes NB#241659.

 configure.ac                                       |    3 +-
 docs/reference/libtracker-miner/Makefile.am        |    2 +-
 docs/reference/libtracker-sparql/Makefile.am       |    2 +-
 docs/reference/libtracker-sparql/overview.sgml     |   11 -
 docs/tools/Makefile.am                             |    1 +
 examples/libtracker-extract/Makefile.am            |    2 +-
 examples/libtracker-miner/Makefile.am              |    2 +-
 examples/libtracker-sparql/Makefile.am             |    2 +-
 src/Makefile.am                                    |    1 +
 src/libtracker-bus/Makefile.am                     |    8 +-
 src/libtracker-bus/tracker-bus.vala                |    5 -
 src/libtracker-data/Makefile.am                    |    1 -
 src/libtracker-direct/Makefile.am                  |    7 +-
 src/libtracker-direct/tracker-direct.vala          |    5 -
 src/libtracker-extract/Makefile.am                 |    2 +-
 src/libtracker-miner/Makefile.am                   |    2 +-
 src/libtracker-sparql-backend/.gitignore           |    1 +
 src/libtracker-sparql-backend/Makefile.am          |   31 +++
 .../tracker-backend.vala                           |  229 ++++++++++++++------
 src/libtracker-sparql/Makefile.am                  |   18 +--
 src/libtracker-sparql/config.vapi                  |   23 --
 src/libtracker-sparql/tracker-connection.vala      |  160 +-------------
 src/miners/flickr/Makefile.am                      |    2 +-
 src/miners/fs/Makefile.am                          |    3 +-
 src/miners/rss/Makefile.am                         |    2 +-
 src/plugins/evolution/Makefile.am                  |    2 +-
 src/plugins/nautilus/Makefile.am                   |    2 +-
 src/tracker-control/Makefile.am                    |    2 +-
 src/tracker-extract/Makefile.am                    |    2 +-
 src/tracker-needle/Makefile.am                     |    2 +-
 src/tracker-search-bar/Makefile.am                 |    2 +-
 src/tracker-store/Makefile.am                      |    2 +-
 src/tracker-utils/Makefile.am                      |    2 +-
 src/tracker-writeback/Makefile.am                  |    2 +-
 tests/functional-tests/ipc/Makefile.am             |    2 +-
 .../ipc/test-update-array-performance.c            |    3 -
 tests/libtracker-data/Makefile.am                  |    2 +-
 tests/libtracker-extract/Makefile.am               |    2 +-
 tests/libtracker-fts/Makefile.am                   |    2 +-
 tests/libtracker-miner/Makefile.am                 |    2 +-
 tests/libtracker-sparql/Makefile.am                |    2 +-
 tests/libtracker-sparql/tracker-test.c             |    3 -
 tests/tracker-steroids/Makefile.am                 |    2 +-
 tests/tracker-steroids/tracker-test.c              |    3 -
 utils/mtp/Makefile.am                              |    2 +-
 utils/services/Makefile.am                         |    2 +-
 utils/tracker-resdump/Makefile.am                  |    2 +-
 utils/tracker-sql/Makefile.am                      |    2 +-
 48 files changed, 237 insertions(+), 337 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 140181f..d10b51a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2019,8 +2019,9 @@ AC_CONFIG_FILES([
 	src/libtracker-common/Makefile
 	src/libtracker-sparql/Makefile
 	src/libtracker-bus/Makefile
-	src/libtracker-direct/Makefile
 	src/libtracker-data/Makefile
+	src/libtracker-direct/Makefile
+	src/libtracker-sparql-backend/Makefile
 	src/libtracker-fts/Makefile
 	src/libtracker-extract/Makefile
 	src/libtracker-client/Makefile
diff --git a/docs/reference/libtracker-miner/Makefile.am b/docs/reference/libtracker-miner/Makefile.am
index b4174fd..cf1744b 100644
--- a/docs/reference/libtracker-miner/Makefile.am
+++ b/docs/reference/libtracker-miner/Makefile.am
@@ -46,7 +46,7 @@ AM_CPPFLAGS =                                          \
 
 GTKDOC_LIBS =                                          \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(LIBTRACKER_MINER_LIBS)
 
diff --git a/docs/reference/libtracker-sparql/Makefile.am b/docs/reference/libtracker-sparql/Makefile.am
index 3649b66..308ac39 100644
--- a/docs/reference/libtracker-sparql/Makefile.am
+++ b/docs/reference/libtracker-sparql/Makefile.am
@@ -32,7 +32,7 @@ AM_CPPFLAGS =                                          \
 	$(LIBTRACKER_SPARQL_CFLAGS)
 
 GTKDOC_LIBS =                                          \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(LIBTRACKER_SPARQL_LIBS)
 
diff --git a/docs/reference/libtracker-sparql/overview.sgml b/docs/reference/libtracker-sparql/overview.sgml
index 47707b9..0c6673f 100644
--- a/docs/reference/libtracker-sparql/overview.sgml
+++ b/docs/reference/libtracker-sparql/overview.sgml
@@ -116,17 +116,6 @@ $ pkg-config --libs tracker-sparql-0.10
 	  </para>
 	</listitem>
 	<listitem>
-	  <emphasis>TRACKER_SPARQL_MODULE_PATH</emphasis>
-	  <para>
-	    As explained in the last paragraph, the backends are
-	    dynamically loaded at run time. The location for these
-	    backends is usually in a set
-	    place: <emphasis>$prefix/lib/tracker-$version/sparql-modules</emphasis>.
-	    This environment variable is mostly useful for the unit
-	    tests and general debugging to override this location.
-	  </para>
-	</listitem>
-	<listitem>
 	  <emphasis>TRACKER_SPARQL_CACHE_SIZE</emphasis>
 	  <para>
 	    Tracker caches database statements which occur frequently to make
diff --git a/docs/tools/Makefile.am b/docs/tools/Makefile.am
index 18b7796..008b21b 100644
--- a/docs/tools/Makefile.am
+++ b/docs/tools/Makefile.am
@@ -12,6 +12,7 @@ AM_CPPFLAGS =                                          \
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(LIBTRACKER_DATA_LIBS)
 
 ontology_graph_SOURCES =                               \
diff --git a/examples/libtracker-extract/Makefile.am b/examples/libtracker-extract/Makefile.am
index 798c73c..b00bdf2 100644
--- a/examples/libtracker-extract/Makefile.am
+++ b/examples/libtracker-extract/Makefile.am
@@ -15,7 +15,7 @@ libextract_mockup_la_SOURCES = tracker-extract-mockup.c
 libextract_mockup_la_LDFLAGS = $(module_flags)
 libextract_mockup_la_LIBADD =                          \
 	$(top_builddir)/src/libtracker-extract/libtracker-extract- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_EXTRACT_LIBS)
 
diff --git a/examples/libtracker-miner/Makefile.am b/examples/libtracker-miner/Makefile.am
index 0681c8a..f423ad6 100644
--- a/examples/libtracker-miner/Makefile.am
+++ b/examples/libtracker-miner/Makefile.am
@@ -12,7 +12,7 @@ AM_CPPFLAGS =                                          \
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-client/libtracker-client- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_MINER_LIBS)
diff --git a/examples/libtracker-sparql/Makefile.am b/examples/libtracker-sparql/Makefile.am
index aaecc6a..ef417f9 100644
--- a/examples/libtracker-sparql/Makefile.am
+++ b/examples/libtracker-sparql/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS = $(BUILD_CFLAGS) \
 	-I$(top_srcdir)/src \
 	$(LIBTRACKER_SPARQL_CFLAGS)
 
-LDADD = $(top_builddir)/src/libtracker-sparql/libtracker-sparql-$(TRACKER_API_VERSION).la \
+LDADD = $(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-$(TRACKER_API_VERSION).la \
 	$(BUILD_LIBS) \
 	$(LIBTRACKER_SPARQL_LIBS)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index f7f8b3c..25cbe47 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,6 +18,7 @@ SUBDIRS =                                              \
 	libtracker-bus                                 \
 	libtracker-data                                \
 	libtracker-direct                              \
+	libtracker-sparql-backend                      \
 	libtracker-extract                             \
 	libtracker-miner                               \
 	miners                                         \
diff --git a/src/libtracker-bus/Makefile.am b/src/libtracker-bus/Makefile.am
index 05af4f8..704d956 100644
--- a/src/libtracker-bus/Makefile.am
+++ b/src/libtracker-bus/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/Makefile.decl
 
-modulesdir = $(libdir)/tracker-$(TRACKER_API_VERSION)/sparql-modules
-
-modules_LTLIBRARIES = libtracker-bus.la
+noinst_LTLIBRARIES = libtracker-bus.la
 
 AM_VALAFLAGS =                                         \
 	--includedir=libtracker-bus                    \
@@ -26,14 +24,10 @@ libtracker_bus_la_SOURCES =                            \
 	tracker-bus-fd-cursor.vala
 
 libtracker_bus_la_LIBADD =                             \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql-$(TRACKER_API_VERSION).la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_BUS_LIBS)
 
-libtracker_bus_la_LDFLAGS =                            \
-	-module -avoid-version -no-undefined
-
 noinst_HEADERS =                                       \
 	tracker-bus.h
 
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index c46fe2d..03ae3f3 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -349,8 +349,3 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 		                                    types);
 	}
 }
-
-public Tracker.Sparql.Connection? module_init () throws GLib.Error {
-	Tracker.Sparql.Connection plugin = new Tracker.Bus.Connection ();
-	return plugin;
-}
diff --git a/src/libtracker-data/Makefile.am b/src/libtracker-data/Makefile.am
index 4434b1b..cf7ba92 100644
--- a/src/libtracker-data/Makefile.am
+++ b/src/libtracker-data/Makefile.am
@@ -47,7 +47,6 @@ libtracker_data_la_SOURCES =                           \
 libtracker_data_la_LIBADD =                            \
 	$(top_builddir)/src/gvdb/libgvdb.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_DATA_LIBS)
 
diff --git a/src/libtracker-direct/Makefile.am b/src/libtracker-direct/Makefile.am
index 64fe2b4..c315adc 100644
--- a/src/libtracker-direct/Makefile.am
+++ b/src/libtracker-direct/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/Makefile.decl
 
-modulesdir = $(libdir)/tracker-$(TRACKER_API_VERSION)/sparql-modules
-
-modules_LTLIBRARIES = libtracker-direct.la
+noinst_LTLIBRARIES = libtracker-direct.la
 
 AM_VALAFLAGS =                                         \
 	--includedir=libtracker-direct                 \
@@ -29,9 +27,6 @@ libtracker_direct_la_LIBADD =                          \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_DIRECT_LIBS)
 
-libtracker_direct_la_LDFLAGS =                         \
-	-module -avoid-version -no-undefined
-
 noinst_HEADERS =                                       \
 	tracker-direct.h
 
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index 9abf5b7..87aa6cc 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -120,8 +120,3 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
 		}
 	}
 }
-
-public Tracker.Sparql.Connection? module_init () throws GLib.Error {
-	Tracker.Sparql.Connection plugin = new Tracker.Direct.Connection ();
-	return plugin;
-}
diff --git a/src/libtracker-extract/Makefile.am b/src/libtracker-extract/Makefile.am
index e4b691e..6522387 100644
--- a/src/libtracker-extract/Makefile.am
+++ b/src/libtracker-extract/Makefile.am
@@ -39,7 +39,7 @@ libtracker_extract_ TRACKER_API_VERSION@_la_LDFLAGS =  \
 	-export-symbols-regex '^tracker_.*'
 
 libtracker_extract_ TRACKER_API_VERSION@_la_LIBADD =   \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_EXTRACT_LIBS)
diff --git a/src/libtracker-miner/Makefile.am b/src/libtracker-miner/Makefile.am
index a9667bf..c41c176 100644
--- a/src/libtracker-miner/Makefile.am
+++ b/src/libtracker-miner/Makefile.am
@@ -66,7 +66,7 @@ libtracker_miner_ TRACKER_API_VERSION@_la_LDFLAGS =    \
 
 libtracker_miner_ TRACKER_API_VERSION@_la_LIBADD =     \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	-lm                                            \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_MINER_LIBS)
diff --git a/src/libtracker-sparql-backend/.gitignore b/src/libtracker-sparql-backend/.gitignore
new file mode 100644
index 0000000..f8e59d4
--- /dev/null
+++ b/src/libtracker-sparql-backend/.gitignore
@@ -0,0 +1 @@
+tracker-backend.c
diff --git a/src/libtracker-sparql-backend/Makefile.am b/src/libtracker-sparql-backend/Makefile.am
new file mode 100644
index 0000000..b7d16fb
--- /dev/null
+++ b/src/libtracker-sparql-backend/Makefile.am
@@ -0,0 +1,31 @@
+include $(top_srcdir)/Makefile.decl
+
+lib_LTLIBRARIES = libtracker-sparql- TRACKER_API_VERSION@.la
+
+AM_VALAFLAGS =                                         \
+	--pkg gio-2.0                                  \
+	$(BUILD_VALAFLAGS)                             \
+	$(top_srcdir)/src/libtracker-sparql/tracker-sparql-$(TRACKER_API_VERSION).vapi \
+	$(top_srcdir)/src/libtracker-bus/tracker-bus.vapi \
+	$(top_srcdir)/src/libtracker-direct/tracker-direct.vapi
+
+AM_CPPFLAGS =                                          \
+	$(BUILD_CFLAGS)                                \
+	-I$(top_srcdir)/src                            \
+	-I$(top_builddir)/src                          \
+	$(LIBTRACKER_SPARQL_CFLAGS)
+
+libtracker_sparql_ TRACKER_API_VERSION@_la_SOURCES =   \
+	tracker-backend.vala
+
+libtracker_sparql_ TRACKER_API_VERSION@_la_LIBADD =    \
+	$(top_builddir)/src/libtracker-sparql/libtracker-sparql.la \
+	$(top_builddir)/src/libtracker-bus/libtracker-bus.la \
+	$(top_builddir)/src/libtracker-direct/libtracker-direct.la \
+	$(BUILD_LIBS)                                  \
+	$(LIBTRACKER_SPARQL_LIBS)
+
+libtracker_sparql_ TRACKER_API_VERSION@_la_LDFLAGS =   \
+	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+	-export-symbols-regex '^tracker_sparql_(connection|cursor|builder|escape|error|value|get)_.*'
+
diff --git a/src/libtracker-sparql/tracker-backend.vala b/src/libtracker-sparql-backend/tracker-backend.vala
similarity index 55%
rename from src/libtracker-sparql/tracker-backend.vala
rename to src/libtracker-sparql-backend/tracker-backend.vala
index b8b120f..d68b2c6 100644
--- a/src/libtracker-sparql/tracker-backend.vala
+++ b/src/libtracker-sparql-backend/tracker-backend.vala
@@ -23,8 +23,6 @@ interface Tracker.Backend.Status : DBusProxy {
 }
 
 class Tracker.Sparql.Backend : Connection {
-	bool direct_only;
-
 	Tracker.Sparql.Connection direct = null;
 	Tracker.Sparql.Connection bus = null;
 	enum Backend {
@@ -33,19 +31,11 @@ class Tracker.Sparql.Backend : Connection {
 		BUS
 	}
 
-	[CCode (has_target = false)]
-	private delegate Tracker.Sparql.Connection? ModuleInitFunc () throws GLib.Error;
-
-	public Backend (bool direct_only = false) throws Sparql.Error
-	requires (Module.supported ()) {
-		this.direct_only = direct_only;
-	}
-
 	public override void init () throws Sparql.Error, IOError, DBusError, SpawnError {
-		Tracker.Backend.Status status = Bus.get_proxy_sync (BusType.SESSION,
-		                                                    TRACKER_DBUS_SERVICE,
-		                                                    TRACKER_DBUS_OBJECT_STATUS,
-		                                                    DBusProxyFlags.DO_NOT_LOAD_PROPERTIES | DBusProxyFlags.DO_NOT_CONNECT_SIGNALS);
+		Tracker.Backend.Status status = GLib.Bus.get_proxy_sync (BusType.SESSION,
+		                                                         TRACKER_DBUS_SERVICE,
+		                                                         TRACKER_DBUS_OBJECT_STATUS,
+		                                                         DBusProxyFlags.DO_NOT_LOAD_PROPERTIES | DBusProxyFlags.DO_NOT_CONNECT_SIGNALS);
 		status.set_default_timeout (int.MAX);
 
 		// Makes sure the sevice is available
@@ -146,18 +136,6 @@ class Tracker.Sparql.Backend : Connection {
 
 	// Plugin loading functions
 	private bool load_plugins (bool direct_only) throws GLib.Error {
-		string env_path = Environment.get_variable ("TRACKER_SPARQL_MODULE_PATH");
-		string path;
-		
-		if (env_path != null && env_path.length > 0) {
-			path = env_path;
-		} else {
-			path = Config.SPARQL_MODULES_DIR;
-		}
-
-		File dir = File.new_for_path (path);
-		string dir_path = dir.get_path ();
-
 		string env_backend = Environment.get_variable ("TRACKER_SPARQL_BACKEND");
 		Backend backend = Backend.AUTO;
 
@@ -186,80 +164,193 @@ class Tracker.Sparql.Backend : Connection {
 			debug ("Backend set in environment contradicts requested connection type, using environment to override");
 		}
 
-		debug ("Searching for modules in folder '%s' ..", dir_path);
-
 		Tracker.Sparql.Connection connection;
 
 		switch (backend) {
 		case backend.AUTO:
-			string direct_path = Module.build_path (dir_path, "tracker-direct");
-			direct = load_plugins_from_path (direct_path, false /* required */);
+			try {
+				direct = new Tracker.Direct.Connection ();
+			} catch (Error e) {
+				debug ("Unable to initialize direct backend");
+			}
 
-			string bus_path = Module.build_path (dir_path, "tracker-bus");
-			bus = load_plugins_from_path (bus_path, true /* required */);
+			bus = new Tracker.Bus.Connection ();
 
 			connection = bus;
 			break;
 
 		case backend.DIRECT:
-			string direct_path = Module.build_path (dir_path, "tracker-direct");
-			connection = direct = load_plugins_from_path (direct_path, true /* required */);
+			connection = direct = new Tracker.Direct.Connection ();
 			break;
 
 		case backend.BUS:
-			string bus_path = Module.build_path (dir_path, "tracker-bus");
-			connection = bus = load_plugins_from_path (bus_path, true /* required */);
+			connection = bus = new Tracker.Bus.Connection ();
 			break;
 
 		default:
 			assert_not_reached ();
 		}
 
-		debug ("Finished searching for modules");
-
 		return connection != null;
 	}
 
-	private Tracker.Sparql.Connection? load_plugins_from_path (string path, bool required) throws GLib.Error {
-		try {
-			// lazy resolving reduces initialization time
-			Module module = Module.open (path, ModuleFlags.BIND_LOCAL | ModuleFlags.BIND_LAZY);
-			if (module == null) {
-				throw new IOError.FAILED ("Failed to load module from path '%s': %s",
-				                          path,
-				                          Module.error ());
-			}
+	static bool direct_only;
+	static weak Connection? singleton;
+	static bool log_initialized;
+	static StaticMutex door;
 
-			void *function;
+	public static new Connection get_internal (bool is_direct_only = false, Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
+		door.lock ();
 
-			if (!module.symbol ("module_init", out function)) {
-				throw new IOError.FAILED ("Failed to find entry point function '%s' in '%s': %s",
-				                          "module_init",
-				                          path,
-				                          Module.error ());
-			}
+		// assign to owned variable to ensure it doesn't get freed between unlock and return
+		var result = singleton;
+		if (result != null) {
+			assert (direct_only == is_direct_only);
+			door.unlock ();
+			return result;
+		}
 
-			ModuleInitFunc module_init = (ModuleInitFunc) function;
-			
-			assert (module_init != null);
+		log_init ();
 
-			// We don't want our modules to ever unload
-			module.make_resident ();
+		direct_only = is_direct_only;
 
-			// Call module init function
-			Tracker.Sparql.Connection c = module_init ();
+		result = new Tracker.Sparql.Backend ();
+		result.init ();
 
-			debug ("Loaded module source: '%s'", module.name ());
+		if (cancellable != null && cancellable.is_cancelled ()) {
+			door.unlock ();
+			throw new IOError.CANCELLED ("Operation was cancelled");
+		}
 
-			return c;
-		} catch (GLib.Error e) {
-			if (required) {
-				// plugin required => error is fatal
-				throw e;
-			} else {
-				return null;
+		singleton = result;
+		result.add_weak_pointer ((void**) (&singleton));
+
+		door.unlock ();
+
+		return singleton;
+	}
+
+	public async static new Connection get_internal_async (bool is_direct_only = false, Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
+		// fast path: avoid extra thread if connection is already available
+		if (door.trylock ()) {
+			// assign to owned variable to ensure it doesn't get freed between unlock and return
+			var result = singleton;
+
+			door.unlock ();
+
+			if (result != null) {
+				assert (direct_only == is_direct_only);
+				return result;
 			}
 		}
+
+		// run in a separate thread
+		Sparql.Error sparql_error = null;
+		IOError io_error = null;
+		DBusError dbus_error = null;
+		SpawnError spawn_error = null;
+		Connection result = null;
+		var context = MainContext.get_thread_default ();
+
+		g_io_scheduler_push_job (job => {
+			try {
+				result = get_internal (is_direct_only, cancellable);
+			} catch (IOError e_io) {
+				io_error = e_io;
+			} catch (Sparql.Error e_spql) {
+				sparql_error = e_spql;
+			} catch (DBusError e_dbus) {
+				dbus_error = e_dbus;
+			} catch (SpawnError e_spawn) {
+				spawn_error = e_spawn;
+			}
+
+			var source = new IdleSource ();
+			source.set_callback (() => {
+				get_internal_async.callback ();
+				return false;
+			});
+			source.attach (context);
+
+			return false;
+		});
+		yield;
+
+		if (sparql_error != null) {
+			throw sparql_error;
+		} else if (io_error != null) {
+			throw io_error;
+		} else if (dbus_error != null) {
+			throw dbus_error;
+		} else if (spawn_error != null) {
+			throw spawn_error;
+		} else {
+			return result;
+		}
+	}
+
+	private static void log_init () {
+		if (log_initialized) {
+			return;
+		}
+
+		log_initialized = true;
+
+		// Avoid debug messages
+		int verbosity = 0;
+		string env_verbosity = Environment.get_variable ("TRACKER_VERBOSITY");
+		if (env_verbosity != null)
+			verbosity = env_verbosity.to_int ();
+
+		LogLevelFlags remove_levels = 0;
+
+		switch (verbosity) {
+		// Log level 3: EVERYTHING
+		case 3:
+			break;
+
+		// Log level 2: CRITICAL/ERROR/WARNING/INFO/MESSAGE only
+		case 2:
+			remove_levels = LogLevelFlags.LEVEL_DEBUG;
+			break;
+
+		// Log level 1: CRITICAL/ERROR/WARNING/INFO only
+		case 1:
+			remove_levels = LogLevelFlags.LEVEL_DEBUG |
+			              LogLevelFlags.LEVEL_MESSAGE;
+			break;
+
+		// Log level 0: CRITICAL/ERROR/WARNING only (default)
+		default:
+		case 0:
+			remove_levels = LogLevelFlags.LEVEL_DEBUG |
+			              LogLevelFlags.LEVEL_MESSAGE |
+			              LogLevelFlags.LEVEL_INFO;
+			break;
+		}
+
+		if (remove_levels != 0) {
+			GLib.Log.set_handler ("Tracker", remove_levels, remove_log_handler);
+		}
+	}
+
+	private static void remove_log_handler (string? log_domain, LogLevelFlags log_level, string message) {
+		/* do nothing */
 	}
 }
 
+public async static Tracker.Sparql.Connection tracker_sparql_connection_get_async (Cancellable? cancellable = null) throws Tracker.Sparql.Error, IOError, DBusError, SpawnError {
+	return yield Tracker.Sparql.Backend.get_internal_async (false, cancellable);
+}
+
+public static Tracker.Sparql.Connection tracker_sparql_connection_get (Cancellable? cancellable = null) throws Tracker.Sparql.Error, IOError, DBusError, SpawnError {
+	return Tracker.Sparql.Backend.get_internal (false, cancellable);
+}
+
+public async static Tracker.Sparql.Connection tracker_sparql_connection_get_direct_async (Cancellable? cancellable = null) throws Tracker.Sparql.Error, IOError, DBusError, SpawnError {
+	return yield Tracker.Sparql.Backend.get_internal_async (true, cancellable);
+}
+
+public static Tracker.Sparql.Connection tracker_sparql_connection_get_direct (Cancellable? cancellable = null) throws Tracker.Sparql.Error, IOError, DBusError, SpawnError {
+	return Tracker.Sparql.Backend.get_internal (true, cancellable);
+}
diff --git a/src/libtracker-sparql/Makefile.am b/src/libtracker-sparql/Makefile.am
index 38f9512..e863868 100644
--- a/src/libtracker-sparql/Makefile.am
+++ b/src/libtracker-sparql/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/Makefile.decl
 
-modulesdir = $(libdir)/tracker-$(TRACKER_API_VERSION)/sparql-modules
-
-lib_LTLIBRARIES = libtracker-sparql- TRACKER_API_VERSION@.la
+noinst_LTLIBRARIES = libtracker-sparql.la
 
 AM_VALAFLAGS =                                         \
 	--includedir=libtracker-sparql                 \
@@ -10,35 +8,28 @@ AM_VALAFLAGS =                                         \
 	--vapi tracker-sparql-$(TRACKER_API_VERSION).vapi \
 	--pkg gio-2.0 --pkg gmodule-2.0 --pkg posix    \
 	$(BUILD_VALAFLAGS)                             \
-	config.vapi                                    \
 	$(top_srcdir)/src/vapi/glib-2.0-fixes.vapi
 
 AM_CPPFLAGS =                                          \
 	$(BUILD_CFLAGS)                                \
-	-DSPARQL_MODULES_DIR=\""$(modulesdir)"\"       \
 	-I$(top_srcdir)/src                            \
 	-I$(top_builddir)/src                          \
 	$(LIBTRACKER_SPARQL_CFLAGS)
 
 libtracker_sparqlincludedir = $(includedir)/tracker-$(TRACKER_API_VERSION)/libtracker-sparql
 
-libtracker_sparql_ TRACKER_API_VERSION@_la_SOURCES =   \
+libtracker_sparql_la_SOURCES =   \
 	tracker-builder.vala                           \
 	tracker-connection.vala                        \
 	tracker-cursor.vala                            \
-	tracker-backend.vala                           \
 	tracker-utils.vala                             \
 	tracker-uri.c                                  \
 	tracker-init.c
 
-libtracker_sparql_ TRACKER_API_VERSION@_la_LIBADD =    \
+libtracker_sparql_la_LIBADD =    \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_SPARQL_LIBS)
 
-libtracker_sparql_ TRACKER_API_VERSION@_la_LDFLAGS =   \
-	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
-	-export-symbols-regex '^tracker_sparql_(connection|cursor|builder|escape|error|value|get)_.*'
-
 libtracker_sparqlinclude_HEADERS =                     \
 	tracker-sparql.h
 
@@ -52,7 +43,7 @@ vapi_DATA =                                            \
 	tracker-sparql-$(TRACKER_API_VERSION).deps
 
 BUILT_SOURCES =                                        \
-	libtracker_sparql_$(TRACKER_API_VERSION)_la_vala.stamp
+	libtracker_sparql_la_vala.stamp
 
 MAINTAINERCLEANFILES =                                 \
 	tracker-sparql-$(TRACKER_API_VERSION).vapi     \
@@ -60,7 +51,6 @@ MAINTAINERCLEANFILES =                                 \
 	tracker-sparql.h
 
 EXTRA_DIST =                                           \
-	config.vapi                                    \
 	tracker-sparql-$(TRACKER_API_VERSION).vapi     \
 	tracker-sparql-$(TRACKER_API_VERSION).deps     \
 	tracker-sparql.deps
diff --git a/src/libtracker-sparql/tracker-connection.vala b/src/libtracker-sparql/tracker-connection.vala
index 8cd7086..030836b 100644
--- a/src/libtracker-sparql/tracker-connection.vala
+++ b/src/libtracker-sparql/tracker-connection.vala
@@ -80,101 +80,6 @@ public errordomain Tracker.Sparql.Error {
  * non-direct requests.
  */
 public abstract class Tracker.Sparql.Connection : Object {
-	static bool direct_only;
-	static weak Connection? singleton;
-	static bool log_initialized;
-	static StaticMutex door;
-
-	private static new Connection get_internal (bool is_direct_only = false, Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
-		door.lock ();
-
-		// assign to owned variable to ensure it doesn't get freed between unlock and return
-		var result = singleton;
-		if (result != null) {
-			assert (direct_only == is_direct_only);
-			door.unlock ();
-			return result;
-		}
-
-		log_init ();
-
-		/* the True is to assert that direct only is required */
-		result = new Backend (is_direct_only);
-		result.init ();
-
-		if (cancellable != null && cancellable.is_cancelled ()) {
-			door.unlock ();
-			throw new IOError.CANCELLED ("Operation was cancelled");
-		}
-
-		direct_only = is_direct_only;
-		singleton = result;
-		result.add_weak_pointer ((void**) (&singleton));
-
-		door.unlock ();
-
-		return singleton;
-	}
-
-	private async static new Connection get_internal_async (bool is_direct_only = false, Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
-		// fast path: avoid extra thread if connection is already available
-		if (door.trylock ()) {
-			// assign to owned variable to ensure it doesn't get freed between unlock and return
-			var result = singleton;
-
-			door.unlock ();
-
-			if (result != null) {
-				assert (direct_only == is_direct_only);
-				return result;
-			}
-		}
-
-		// run in a separate thread
-		Sparql.Error sparql_error = null;
-		IOError io_error = null;
-		DBusError dbus_error = null;
-		SpawnError spawn_error = null;
-		Connection result = null;
-		var context = MainContext.get_thread_default ();
-
-		g_io_scheduler_push_job (job => {
-			try {
-				result = get_internal (is_direct_only, cancellable);
-			} catch (IOError e_io) {
-				io_error = e_io;
-			} catch (Sparql.Error e_spql) {
-				sparql_error = e_spql;
-			} catch (DBusError e_dbus) {
-				dbus_error = e_dbus;
-			} catch (SpawnError e_spawn) {
-				spawn_error = e_spawn;
-			}
-
-			var source = new IdleSource ();
-			source.set_callback (() => {
-				get_internal_async.callback ();
-				return false;
-			});
-			source.attach (context);
-
-			return false;
-		});
-		yield;
-
-		if (sparql_error != null) {
-			throw sparql_error;
-		} else if (io_error != null) {
-			throw io_error;
-		} else if (dbus_error != null) {
-			throw dbus_error;
-		} else if (spawn_error != null) {
-			throw spawn_error;
-		} else {
-			return result;
-		}
-	}
-
 	/**
 	 * tracker_sparql_connection_get_finish:
 	 * @_res_: The #GAsyncResult from the callback used to return the #TrackerSparqlConnection
@@ -205,9 +110,7 @@ public abstract class Tracker.Sparql.Connection : Object {
 	 *
 	 * Since: 0.10
 	 */
-	public async static new Connection get_async (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
-		return yield get_internal_async (false, cancellable);
-	}
+	public extern async static new Connection get_async (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError;
 
 	/**
 	 * tracker_sparql_connection_get:
@@ -244,9 +147,7 @@ public abstract class Tracker.Sparql.Connection : Object {
 	 *
 	 * Since: 0.10
 	 */
-	public static new Connection get (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
-		return get_internal (false, cancellable);
-	}
+	public extern static new Connection get (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError;
 
 	/**
 	 * tracker_sparql_connection_get_direct_finish:
@@ -279,9 +180,7 @@ public abstract class Tracker.Sparql.Connection : Object {
 	 *
 	 * Since: 0.10
 	 */
-	public async static Connection get_direct_async (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
-		return yield get_internal_async (true, cancellable);
-	}
+	public extern async static Connection get_direct_async (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError;
 
 	/**
 	 * tracker_sparql_connection_get_direct:
@@ -299,58 +198,7 @@ public abstract class Tracker.Sparql.Connection : Object {
 	 *
 	 * Since: 0.10
 	 */
-	public static new Connection get_direct (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError {
-		return get_internal (true, cancellable);
-	}
-
-	private static void log_init () {
-		if (log_initialized) {
-			return;
-		}
-
-		log_initialized = true;
-
-		// Avoid debug messages
-		int verbosity = 0;
-		string env_verbosity = Environment.get_variable ("TRACKER_VERBOSITY");
-		if (env_verbosity != null)
-			verbosity = env_verbosity.to_int ();
-
-		LogLevelFlags remove_levels = 0;
-
-		switch (verbosity) {
-		// Log level 3: EVERYTHING
-		case 3:
-			break;
-
-		// Log level 2: CRITICAL/ERROR/WARNING/INFO/MESSAGE only
-		case 2:
-			remove_levels = LogLevelFlags.LEVEL_DEBUG;
-			break;
-
-		// Log level 1: CRITICAL/ERROR/WARNING/INFO only
-		case 1:
-			remove_levels = LogLevelFlags.LEVEL_DEBUG |
-			              LogLevelFlags.LEVEL_MESSAGE;
-			break;
-
-		// Log level 0: CRITICAL/ERROR/WARNING only (default)
-		default:
-		case 0:
-			remove_levels = LogLevelFlags.LEVEL_DEBUG |
-			              LogLevelFlags.LEVEL_MESSAGE |
-			              LogLevelFlags.LEVEL_INFO;
-			break;
-		}
-
-		if (remove_levels != 0) {
-			GLib.Log.set_handler ("Tracker", remove_levels, remove_log_handler);
-		}
-	}
-
-	private static void remove_log_handler (string? log_domain, LogLevelFlags log_level, string message) {
-		/* do nothing */
-	}
+	public extern static new Connection get_direct (Cancellable? cancellable = null) throws Sparql.Error, IOError, DBusError, SpawnError;
 
 	public virtual void init () throws Sparql.Error, IOError, DBusError, SpawnError {
 		warning ("Interface 'init' not implemented");
diff --git a/src/miners/flickr/Makefile.am b/src/miners/flickr/Makefile.am
index 95c888a..415d01a 100644
--- a/src/miners/flickr/Makefile.am
+++ b/src/miners/flickr/Makefile.am
@@ -22,7 +22,7 @@ AM_CPPFLAGS =                                          \
 
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(TRACKER_MINER_FLICKR_LIBS)
 
diff --git a/src/miners/fs/Makefile.am b/src/miners/fs/Makefile.am
index 6af53b2..4c6c9f2 100644
--- a/src/miners/fs/Makefile.am
+++ b/src/miners/fs/Makefile.am
@@ -43,7 +43,8 @@ tracker_miner_fs_SOURCES =                             \
 
 tracker_miner_fs_LDADD =                               \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-extract/libtracker-extract- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
diff --git a/src/miners/rss/Makefile.am b/src/miners/rss/Makefile.am
index c752cec..d38566b 100644
--- a/src/miners/rss/Makefile.am
+++ b/src/miners/rss/Makefile.am
@@ -17,7 +17,7 @@ tracker_miner_rss_SOURCES =                            \
 	tracker-miner-rss.c
 
 tracker_miner_rss_LDADD =                              \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
diff --git a/src/plugins/evolution/Makefile.am b/src/plugins/evolution/Makefile.am
index 2c5d7bb..9717511 100644
--- a/src/plugins/evolution/Makefile.am
+++ b/src/plugins/evolution/Makefile.am
@@ -31,7 +31,7 @@ liborg_freedesktop_Tracker_evolution_plugin_la_SOURCES = \
 
 liborg_freedesktop_Tracker_evolution_plugin_la_LDFLAGS = -module -avoid-version
 liborg_freedesktop_Tracker_evolution_plugin_la_LIBADD = \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
diff --git a/src/plugins/nautilus/Makefile.am b/src/plugins/nautilus/Makefile.am
index 9581fd8..cfe229c 100644
--- a/src/plugins/nautilus/Makefile.am
+++ b/src/plugins/nautilus/Makefile.am
@@ -19,6 +19,6 @@ libnautilus_tracker_tags_la_SOURCES =                  \
 
 libnautilus_tracker_tags_la_LDFLAGS = -module -avoid-version
 libnautilus_tracker_tags_la_LIBADD =                   \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(TRACKER_NAUTILUS_EXTENSION_LIBS)
diff --git a/src/tracker-control/Makefile.am b/src/tracker-control/Makefile.am
index 69f6bf9..6bcb0f2 100644
--- a/src/tracker-control/Makefile.am
+++ b/src/tracker-control/Makefile.am
@@ -18,7 +18,7 @@ tracker_control_SOURCES = \
 
 tracker_control_LDADD = \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS) \
diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am
index ce71311..0d17671 100644
--- a/src/tracker-extract/Makefile.am
+++ b/src/tracker-extract/Makefile.am
@@ -382,7 +382,7 @@ tracker_extract_SOURCES = \
 
 tracker_extract_LDADD = \
 	$(top_builddir)/src/libtracker-extract/libtracker-extract- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS) \
diff --git a/src/tracker-needle/Makefile.am b/src/tracker-needle/Makefile.am
index b8e5aed..cdbf4c1 100644
--- a/src/tracker-needle/Makefile.am
+++ b/src/tracker-needle/Makefile.am
@@ -20,7 +20,7 @@ AM_CPPFLAGS =                                      \
 	-include config.h
 
 LDADD =                                            \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql-$(TRACKER_API_VERSION).la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-$(TRACKER_API_VERSION).la \
 	$(BUILD_LIBS)                                  \
 	$(TRACKER_NEEDLE_LIBS)
 
diff --git a/src/tracker-search-bar/Makefile.am b/src/tracker-search-bar/Makefile.am
index b5772dc..8ba006f 100644
--- a/src/tracker-search-bar/Makefile.am
+++ b/src/tracker-search-bar/Makefile.am
@@ -23,7 +23,7 @@ tracker_search_bar_CFLAGS =                            \
 	$(TRACKER_SEARCH_BAR_CFLAGS)
 
 tracker_search_bar_LDADD =                             \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(TRACKER_SEARCH_BAR_LIBS)
diff --git a/src/tracker-store/Makefile.am b/src/tracker-store/Makefile.am
index 77c060b..6ef3532 100644
--- a/src/tracker-store/Makefile.am
+++ b/src/tracker-store/Makefile.am
@@ -58,7 +58,7 @@ tracker_store_VALAFLAGS = \
 tracker_store_LDADD =                                  \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(TRACKER_STORE_LIBS)
 
diff --git a/src/tracker-utils/Makefile.am b/src/tracker-utils/Makefile.am
index ef7ad97..7795fb8 100644
--- a/src/tracker-utils/Makefile.am
+++ b/src/tracker-utils/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS =                                          \
 	$(TRACKER_UTILS_CFLAGS)
 
 libs =                                                 \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
diff --git a/src/tracker-writeback/Makefile.am b/src/tracker-writeback/Makefile.am
index 7afd682..f0d0f7c 100644
--- a/src/tracker-writeback/Makefile.am
+++ b/src/tracker-writeback/Makefile.am
@@ -63,7 +63,7 @@ tracker_writeback_SOURCES =                            \
 	tracker-main.c
 
 tracker_writeback_LDADD =                              \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
diff --git a/tests/functional-tests/ipc/Makefile.am b/tests/functional-tests/ipc/Makefile.am
index 4b5335b..3ca28a2 100644
--- a/tests/functional-tests/ipc/Makefile.am
+++ b/tests/functional-tests/ipc/Makefile.am
@@ -28,7 +28,7 @@ LDADD =\
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-direct/libtracker-direct.la \
 	$(top_builddir)/src/libtracker-bus/libtracker-bus.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql-$(TRACKER_API_VERSION).la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-$(TRACKER_API_VERSION).la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)\
 	$(LIBTRACKER_SPARQL_LIBS)
diff --git a/tests/functional-tests/ipc/test-update-array-performance.c b/tests/functional-tests/ipc/test-update-array-performance.c
index 3f0d726..9d3c60f 100644
--- a/tests/functional-tests/ipc/test-update-array-performance.c
+++ b/tests/functional-tests/ipc/test-update-array-performance.c
@@ -222,9 +222,6 @@ main (gint argc, gchar **argv)
 
 	g_type_init ();
 
-	/* do not require prior installation */
-	g_setenv ("TRACKER_SPARQL_MODULE_PATH", "../../src/libtracker-bus/.libs", TRUE);
-
 	connection = tracker_sparql_connection_get (NULL, NULL);
 
 	g_print ("First run (first update then array)\n");
diff --git a/tests/libtracker-data/Makefile.am b/tests/libtracker-data/Makefile.am
index 0ec6d4b..916578d 100644
--- a/tests/libtracker-data/Makefile.am
+++ b/tests/libtracker-data/Makefile.am
@@ -44,7 +44,7 @@ AM_CPPFLAGS =                                          \
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/tests/common/libtracker-testcommon.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_DATA_LIBS)
diff --git a/tests/libtracker-extract/Makefile.am b/tests/libtracker-extract/Makefile.am
index 25b81c4..d9146d3 100644
--- a/tests/libtracker-extract/Makefile.am
+++ b/tests/libtracker-extract/Makefile.am
@@ -17,7 +17,7 @@ LDADD =                                                \
 	$(top_builddir)/tests/common/libtracker-testcommon.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(top_builddir)/src/libtracker-extract/libtracker-extract- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_EXTRACT_LIBS)
 
diff --git a/tests/libtracker-fts/Makefile.am b/tests/libtracker-fts/Makefile.am
index 3535cec..d27b15a 100644
--- a/tests/libtracker-fts/Makefile.am
+++ b/tests/libtracker-fts/Makefile.am
@@ -24,7 +24,7 @@ AM_CPPFLAGS =                                          \
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/tests/common/libtracker-testcommon.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_FTS_LIBS)
diff --git a/tests/libtracker-miner/Makefile.am b/tests/libtracker-miner/Makefile.am
index fee0787..13b5f08 100644
--- a/tests/libtracker-miner/Makefile.am
+++ b/tests/libtracker-miner/Makefile.am
@@ -36,7 +36,7 @@ AM_CPPFLAGS =                                          \
 
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-miner/libtracker-miner- TRACKER_API_VERSION@.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_MINER_LIBS)
diff --git a/tests/libtracker-sparql/Makefile.am b/tests/libtracker-sparql/Makefile.am
index def341f..84c0d6d 100644
--- a/tests/libtracker-sparql/Makefile.am
+++ b/tests/libtracker-sparql/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS =                                          \
 	$(LIBTRACKER_SPARQL_CFLAGS)
 
 LDADD =                                                \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_SPARQL_LIBS)
 
diff --git a/tests/libtracker-sparql/tracker-test.c b/tests/libtracker-sparql/tracker-test.c
index 0d0f1d8..73f381a 100644
--- a/tests/libtracker-sparql/tracker-test.c
+++ b/tests/libtracker-sparql/tracker-test.c
@@ -329,9 +329,6 @@ main (gint argc, gchar **argv)
 	g_type_init ();
 	g_test_init (&argc, &argv, NULL);
 
-        /* do not require prior installation */
-        g_setenv ("TRACKER_SPARQL_MODULE_PATH", "../../src/libtracker-bus/.libs", TRUE);
-
 #if HAVE_TRACKER_FTS
 	main_loop = g_main_loop_new (NULL, FALSE);
 	g_assert (main_loop != NULL);
diff --git a/tests/tracker-steroids/Makefile.am b/tests/tracker-steroids/Makefile.am
index 2311d1e..f173833 100644
--- a/tests/tracker-steroids/Makefile.am
+++ b/tests/tracker-steroids/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS =                                          \
 	$(LIBTRACKER_SPARQL_CFLAGS)
 
 LDADD =                                                \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_SPARQL_LIBS)
diff --git a/tests/tracker-steroids/tracker-test.c b/tests/tracker-steroids/tracker-test.c
index 2870cc2..7ce2f55 100644
--- a/tests/tracker-steroids/tracker-test.c
+++ b/tests/tracker-steroids/tracker-test.c
@@ -679,9 +679,6 @@ main (gint argc, gchar **argv)
 	g_type_init ();
 	g_test_init (&argc, &argv, NULL);
 
-	/* do not require prior installation */
-	g_setenv ("TRACKER_SPARQL_MODULE_PATH", "../../src/libtracker-bus/.libs", TRUE);
-
 	connection = tracker_sparql_connection_get (NULL, NULL);
 
 	insert_test_data ();
diff --git a/utils/mtp/Makefile.am b/utils/mtp/Makefile.am
index 8f2ab95..1b98cad 100644
--- a/utils/mtp/Makefile.am
+++ b/utils/mtp/Makefile.am
@@ -11,7 +11,7 @@ noinst_PROGRAMS = mtp-dummy
 
 mtp_dummy_SOURCES = mtp-dummy.c
 mtp_dummy_LDADD =                                      \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_SPARQL_LIBS)
diff --git a/utils/services/Makefile.am b/utils/services/Makefile.am
index 9460f78..78dd9be 100644
--- a/utils/services/Makefile.am
+++ b/utils/services/Makefile.am
@@ -12,7 +12,7 @@ AM_CPPFLAGS =                                          \
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(BUILD_LIBS)                                  \
 	$(LIBTRACKER_DATA_LIBS)
 
diff --git a/utils/tracker-resdump/Makefile.am b/utils/tracker-resdump/Makefile.am
index d2c63ef..b26b59e 100644
--- a/utils/tracker-resdump/Makefile.am
+++ b/utils/tracker-resdump/Makefile.am
@@ -20,7 +20,7 @@ LDADD =\
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-direct/libtracker-direct.la \
 	$(top_builddir)/src/libtracker-bus/libtracker-bus.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql-$(TRACKER_API_VERSION).la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql-$(TRACKER_API_VERSION).la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
 	$(BUILD_LIBS)\
 	$(LIBTRACKER_SPARQL_LIBS) \
diff --git a/utils/tracker-sql/Makefile.am b/utils/tracker-sql/Makefile.am
index ceb6a0d..b86feca 100644
--- a/utils/tracker-sql/Makefile.am
+++ b/utils/tracker-sql/Makefile.am
@@ -11,7 +11,7 @@ INCLUDES =                                             \
 LDADD =                                                \
 	$(top_builddir)/src/libtracker-data/libtracker-data.la \
 	$(top_builddir)/src/libtracker-common/libtracker-common.la \
-	$(top_builddir)/src/libtracker-sparql/libtracker-sparql- TRACKER_API_VERSION@.la \
+	$(top_builddir)/src/libtracker-sparql-backend/libtracker-sparql- TRACKER_API_VERSION@.la \
 	$(TRACKER_UTILS_LIBS)
 
 tracker_sql_SOURCES = tracker-sql.c



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]