[tracker/disable-fts] FTS: make it optional at configure time



commit c99a2aa49dd1fddd655a60a5a8682e1985ab15cf
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Jun 3 17:59:02 2010 +0300

    FTS: make it optional at configure time
    
    	* New --enable-tracker-fts configure option.
    	* Disables compilation of all FTS related stuff, including
    	libtracker-fts, libstemmer and language support in
    	libtracker-common

 configure.ac                                    |   25 ++++++
 src/Makefile.am                                 |    8 ++-
 src/libtracker-common/Makefile.am               |   15 +++-
 src/libtracker-data/tracker-data-manager.c      |   25 ++++--
 src/libtracker-data/tracker-data-update.c       |  106 +++++++++++++---------
 src/libtracker-db/Makefile.am                   |    8 ++-
 src/libtracker-db/tracker-db-interface-sqlite.c |    9 ++
 src/libtracker-db/tracker-db-manager.c          |    3 +
 src/tracker-store/Makefile.am                   |    6 +-
 src/tracker-utils/Makefile.am                   |    4 +-
 tests/Makefile.am                               |    5 +-
 tests/libtracker-db/Makefile.am                 |    3 +-
 12 files changed, 155 insertions(+), 62 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b56c635..1dd9112 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1245,6 +1245,30 @@ fi
 
 AM_CONDITIONAL(HAVE_TRACKER_PREFERENCES, test "$have_tracker_preferences" = "yes")
 
+##################################################################
+# Checks for tracker-fts
+##################################################################
+
+AC_ARG_ENABLE([tracker-fts],
+              AS_HELP_STRING([--enable-tracker-fts],
+	                     [enable the tracker FTS [[default=auto]]]),,
+              [enable_tracker_fts=auto])
+
+if test "x$enable_tracker_fts" != "xno" ; then
+   have_tracker_fts="yes"
+else
+   have_tracker_fts="no  (disabled)"
+fi
+
+if test "x$have_tracker_fts" = "xyes"; then
+   AC_DEFINE(HAVE_TRACKER_FTS, [1], [Define to 1 if tracker FTS is compiled])
+else
+   AC_DEFINE(HAVE_TRACKER_FTS, [0], [Define to 0 if tracker FTS is not compiled])
+fi
+
+AM_CONDITIONAL(HAVE_TRACKER_FTS, test "$have_tracker_fts" = "yes")
+
+
 ####################################################################
 # PS extractor option
 ####################################################################
@@ -1979,6 +2003,7 @@ Applications:
 	Build tracker-status-icon:              $have_tracker_status_icon
 	Build tracker-explorer:                 $have_tracker_explorer
 	Build tracker-search-bar:               $have_tracker_search_bar
+	Build tracker-fts:		        $have_tracker_fts
 
 Metadata Extractors:
 
diff --git a/src/Makefile.am b/src/Makefile.am
index cc018d0..7db30e8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,11 +5,9 @@ libinotify_dir = libinotify
 endif
 
 SUBDIRS = 					\
-	libstemmer				\
 	$(libinotify_dir)			\
 	libtracker-common 			\
 	libtracker-client			\
-	libtracker-fts				\
 	libtracker-db				\
 	libtracker-data				\
 	libtracker-extract			\
@@ -42,3 +40,9 @@ endif
 if HAVE_TRACKER_EXPLORER
 SUBDIRS += tracker-explorer
 endif
+
+if HAVE_TRACKER_FTS
+SUBDIRS += 					\
+	libstemmer				\
+	libtracker-fts
+endif
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 555fcff..e6ebd17 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -47,7 +47,6 @@ libtracker_common_la_SOURCES =	 			\
 	tracker-file-utils.c				\
 	tracker-ioprio.c				\
 	tracker-keyfile-object.c			\
-	tracker-language.c				\
 	tracker-log.c	 				\
 	tracker-type-utils.c				\
 	tracker-utils.c					\
@@ -64,17 +63,22 @@ noinst_HEADERS =					\
 	tracker-date-time.h				\
 	tracker-file-utils.h				\
 	tracker-keyfile-object.h			\
-	tracker-language.h				\
 	tracker-ontologies.h				\
 	tracker-type-utils.h				\
 	tracker-utils.h					\
 	tracker-crc32.h
 
+if HAVE_TRACKER_FTS
+libtracker_common_la_SOURCES +=	 			\
+	tracker-language.c
+noinst_HEADERS +=					\
+	tracker-language.h
+endif
+
 libtracker_common_la_LDFLAGS = 				\
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 
 libtracker_common_la_LIBADD = 				\
-	$(top_builddir)/src/libstemmer/libstemmer.la	\
 	$(HAL_LIBS)					\
 	$(UPOWER_LIBS)					\
 	$(DBUS_LIBS)					\
@@ -82,6 +86,11 @@ libtracker_common_la_LIBADD = 				\
 	$(GCOV_LIBS)					\
 	$(GLIB2_LIBS)
 
+if HAVE_TRACKER_FTS
+libtracker_common_la_LIBADD += 				\
+	$(top_builddir)/src/libstemmer/libstemmer.la
+endif
+
 marshal_sources =                              		\
         tracker-marshal.h              			\
         tracker-marshal.c
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index f2e8d6e..00960ed 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -32,7 +32,9 @@
 
 #include <libtracker-common/tracker-common.h>
 
+#if HAVE_TRACKER_FTS
 #include <libtracker-fts/tracker-fts.h>
+#endif
 
 #include <libtracker-db/tracker-db-interface-sqlite.h>
 #include <libtracker-db/tracker-db-manager.h>
@@ -730,7 +732,7 @@ tracker_data_ontology_process_changes (GPtrArray *seen_classes,
 	gint i;
 
 	/* This updates property-property changes and marks classes for necessity
-	 * of having their tables recreated later. There's support for 
+	 * of having their tables recreated later. There's support for
 	 * tracker:notify, tracker:writeback and tracker:indexed */
 
 	if (seen_classes) {
@@ -822,7 +824,7 @@ tracker_data_ontology_process_changes (GPtrArray *seen_classes,
 			}
 
 			if (update_property_value ("rdfs:range", subject, RDFS_PREFIX "range",
-			                           tracker_class_get_uri (tracker_property_get_range (property)), 
+			                           tracker_class_get_uri (tracker_property_get_range (property)),
 			                           allowed_range_conversions,
 			                           NULL, property)) {
 				TrackerClass *class;
@@ -1884,9 +1886,9 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
 
 				if (in_update) {
 					g_debug ("%sAltering database for class '%s' property '%s': single value (%s)",
-					         in_alter ? "" : "  ", 
-					         service_name, 
-					         field_name, 
+					         in_alter ? "" : "  ",
+					         service_name,
+					         field_name,
 					         in_alter ? "alter" : "create");
 				}
 
@@ -2068,7 +2070,7 @@ create_decomposed_transient_metadata_tables (TrackerDBInterface *iface)
 	}
 }
 
-void 
+void
 tracker_data_ontology_import_finished (void)
 {
 	TrackerClass **classes;
@@ -2235,7 +2237,9 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		return FALSE;
 	}
 
+#if HAVE_TRACKER_FTS
 	tracker_fts_set_map_function (tracker_ontologies_get_uri_by_id);
+#endif
 
 	if (first_time != NULL) {
 		*first_time = is_first_time_index;
@@ -2277,14 +2281,16 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 
 		/* Read first ontology and commit it into the DB */
 		tracker_data_begin_db_transaction_for_replay (tracker_db_journal_reader_get_time ());
+#if HAVE_TRACKER_FTS
 		tracker_db_interface_sqlite_fts_init (TRACKER_DB_INTERFACE_SQLITE (iface), TRUE);
+#endif
 		tracker_data_ontology_import_into_db (FALSE);
 		tracker_data_commit_db_transaction ();
 		tracker_db_journal_reader_shutdown ();
 
 		/* Start replay. Ontology changes might happen during replay of the journal. */
 
-		tracker_data_replay_journal (classes, properties, id_uri_map, 
+		tracker_data_replay_journal (classes, properties, id_uri_map,
 		                             busy_callback, busy_user_data, busy_status);
 
 		in_journal_replay = FALSE;
@@ -2333,7 +2339,10 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		/* Not an ontology transaction: this is the first ontology */
 		tracker_db_journal_start_transaction (time (NULL));
 
+#if HAVE_TRACKER_FTS
 		tracker_db_interface_sqlite_fts_init (TRACKER_DB_INTERFACE_SQLITE (iface), TRUE);
+#endif
+
 		tracker_data_ontology_import_into_db (FALSE);
 
 		/* store ontology in database */
@@ -2371,7 +2380,9 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		create_decomposed_transient_metadata_tables (iface);
 		check_ontology = TRUE;
 
+#if HAVE_TRACKER_FTS
 		tracker_db_interface_sqlite_fts_init (TRACKER_DB_INTERFACE_SQLITE (iface), FALSE);
+#endif
 	}
 
 	if (check_ontology) {
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 30df3a2..29a10ad 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -29,7 +29,9 @@
 #include <libtracker-common/tracker-file-utils.h>
 #include <libtracker-common/tracker-ontologies.h>
 
+#if HAVE_TRACKER_FTS
 #include <libtracker-fts/tracker-fts.h>
+#endif
 
 #include <libtracker-db/tracker-db-manager.h>
 #include <libtracker-db/tracker-db-dbus.h>
@@ -70,7 +72,9 @@ struct _TrackerDataUpdateBuffer {
 	GHashTable *resources_by_id;
 
 	/* the following two fields are valid per sqlite transaction, not just for same subject */
+#if HAVE_TRACKER_FTS
 	gboolean fts_ever_updated;
+#endif
 	/* TrackerClass -> integer */
 	GHashTable *class_counts;
 };
@@ -79,7 +83,9 @@ struct _TrackerDataUpdateBufferResource {
 	const gchar *subject;
 	gint id;
 	gboolean create;
+#if HAVE_TRACKER_FTS
 	gboolean fts_updated;
+#endif
 	/* TrackerProperty -> GValueArray */
 	GHashTable *predicates;
 	/* string -> TrackerDataUpdateBufferTable */
@@ -92,7 +98,9 @@ struct _TrackerDataUpdateBufferProperty {
 	const gchar *name;
 	GValue value;
 	gint graph;
+#if HAVE_TRACKER_FTS
 	gboolean fts : 1;
+#endif
 	gboolean date_time : 1;
 };
 
@@ -482,7 +490,9 @@ cache_insert_value (const gchar            *table_name,
 
 	property.value = *value;
 	property.graph = graph;
+#if TRACKER_HAVE_FTS
 	property.fts = fts;
+#endif
 	property.date_time = date_time;
 
 	table = cache_ensure_table (table_name, multiple_values);
@@ -513,7 +523,9 @@ cache_delete_value (const gchar            *table_name,
 	property.name = field_name;
 	property.value = *value;
 	property.graph = 0;
+#if TRACKER_HAVE_FTS
 	property.fts = fts;
+#endif
 	property.date_time = date_time;
 
 	table = cache_ensure_table (table_name, multiple_values);
@@ -642,7 +654,7 @@ tracker_data_resource_buffer_flush (GError **error)
 	TrackerDataUpdateBufferProperty *property;
 	GHashTableIter                  iter;
 	const gchar                    *table_name;
-	GString                        *sql, *fts;
+	GString                        *sql;
 	gint                            i, param;
 	GError                         *actual_error = NULL;
 
@@ -837,6 +849,7 @@ tracker_data_resource_buffer_flush (GError **error)
 		}
 	}
 
+#if HAVE_TRACKER_FTS
 	if (resource_buffer->fts_updated) {
 		TrackerProperty *prop;
 		GValueArray *values;
@@ -845,6 +858,8 @@ tracker_data_resource_buffer_flush (GError **error)
 
 		g_hash_table_iter_init (&iter, resource_buffer->predicates);
 		while (g_hash_table_iter_next (&iter, (gpointer*) &prop, (gpointer*) &values)) {
+			GString *fts;
+
 			if (tracker_property_get_fulltext_indexed (prop)) {
 				fts = g_string_new ("");
 				for (i = 0; i < values->n_values; i++) {
@@ -858,6 +873,7 @@ tracker_data_resource_buffer_flush (GError **error)
 			}
 		}
 	}
+#endif
 }
 
 static void resource_buffer_free (TrackerDataUpdateBufferResource *resource)
@@ -921,8 +937,10 @@ tracker_data_update_buffer_clear (void)
 	g_hash_table_remove_all (update_buffer.resources_by_id);
 	resource_buffer = NULL;
 
+#if HAVE_TRACKER_FTS
 	tracker_fts_update_rollback ();
 	update_buffer.fts_ever_updated = FALSE;
+#endif
 
 	if (update_buffer.class_counts) {
 		/* revert class count changes */
@@ -1223,12 +1241,8 @@ static GValueArray *
 get_old_property_values (TrackerProperty  *property,
                          GError          **error)
 {
-	gboolean            fts;
-	TrackerProperty   **properties, *prop;
 	GValueArray        *old_values;
 
-	fts = tracker_property_get_fulltext_indexed (property);
-
 	/* read existing property values */
 	old_values = g_hash_table_lookup (resource_buffer->predicates, property);
 	if (old_values == NULL) {
@@ -1241,43 +1255,48 @@ get_old_property_values (TrackerProperty  *property,
 			return NULL;
 		}
 
-		if (fts && !resource_buffer->fts_updated && !resource_buffer->create) {
-			guint i, n_props;
+#if HAVE_TRACKER_FTS
+		if (tracker_property_get_fulltext_indexed (property)) {
+			TrackerProperty   **properties, *prop;
 
-			/* first fulltext indexed property to be modified
-			 * retrieve values of all fulltext indexed properties
-			 */
-			tracker_fts_update_init (resource_buffer->id);
+			if (!resource_buffer->fts_updated && !resource_buffer->create) {
+				guint i, n_props;
+
+				/* first fulltext indexed property to be modified
+				 * retrieve values of all fulltext indexed properties
+				 */
+				tracker_fts_update_init (resource_buffer->id);
 
-			properties = tracker_ontologies_get_properties (&n_props);
+				properties = tracker_ontologies_get_properties (&n_props);
 
-			for (i = 0; i < n_props; i++) {
-				prop = properties[i];
+				for (i = 0; i < n_props; i++) {
+					prop = properties[i];
 
-				if (tracker_property_get_fulltext_indexed (prop)
-				    && check_property_domain (prop)) {
-					gint i;
+					if (tracker_property_get_fulltext_indexed (prop)
+					    && check_property_domain (prop)) {
+						gint i;
 
-					old_values = get_property_values (prop);
+						old_values = get_property_values (prop);
 
-					/* delete old fts entries */
-					for (i = 0; i < old_values->n_values; i++) {
-						tracker_fts_update_text (resource_buffer->id, -1,
-						                         g_value_get_string (g_value_array_get_nth (old_values, i)),
-									 !tracker_property_get_fulltext_no_limit (prop));
+						/* delete old fts entries */
+						for (i = 0; i < old_values->n_values; i++) {
+							tracker_fts_update_text (resource_buffer->id, -1,
+							                         g_value_get_string (g_value_array_get_nth (old_values, i)),
+							                         !tracker_property_get_fulltext_no_limit (prop));
+						}
 					}
 				}
-			}
 
-			update_buffer.fts_ever_updated = TRUE;
+				update_buffer.fts_ever_updated = TRUE;
 
-			old_values = g_hash_table_lookup (resource_buffer->predicates, property);
-		} else {
-			old_values = get_property_values (property);
-		}
+				old_values = g_hash_table_lookup (resource_buffer->predicates, property);
+			}
 
-		if (fts) {
 			resource_buffer->fts_updated = TRUE;
+		} else
+#endif
+		{
+			old_values = get_property_values (property);
 		}
 	}
 
@@ -1335,7 +1354,7 @@ cache_set_metadata_decomposed (TrackerProperty  *property,
                                gint              graph_id,
                                GError          **error)
 {
-	gboolean            multiple_values, fts;
+	gboolean            multiple_values;
 	const gchar        *table_name;
 	const gchar        *field_name;
 	TrackerProperty   **super_properties;
@@ -1360,8 +1379,6 @@ cache_set_metadata_decomposed (TrackerProperty  *property,
 	table_name = tracker_property_get_table_name (property);
 	field_name = tracker_property_get_name (property);
 
-	fts = tracker_property_get_fulltext_indexed (property);
-
 	/* read existing property values */
 	old_values = get_old_property_values (property, &new_error);
 	if (new_error) {
@@ -1417,7 +1434,8 @@ cache_set_metadata_decomposed (TrackerProperty  *property,
 	} else {
 		cache_insert_value (table_name, field_name, &gvalue,
 		                    graph != NULL ? ensure_resource_id (graph, NULL) : graph_id,
-		                    multiple_values, fts,
+		                    multiple_values,
+		                    tracker_property_get_fulltext_indexed (property),
 		                    tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_DATETIME);
 
 		change = TRUE;
@@ -1432,7 +1450,7 @@ delete_metadata_decomposed (TrackerProperty  *property,
                             gint              value_id,
                             GError          **error)
 {
-	gboolean            multiple_values, fts;
+	gboolean            multiple_values;
 	const gchar        *table_name;
 	const gchar        *field_name;
 	TrackerProperty   **super_properties;
@@ -1443,9 +1461,7 @@ delete_metadata_decomposed (TrackerProperty  *property,
 
 	multiple_values = tracker_property_get_multiple_values (property);
 	table_name = tracker_property_get_table_name (property);
-	field_name = tracker_property_get_name (property);
-
-	fts = tracker_property_get_fulltext_indexed (property);
+	field_name = tracker_property_get_name (property);;
 
 	/* read existing property values */
 	old_values = get_old_property_values (property, &new_error);
@@ -1469,7 +1485,8 @@ delete_metadata_decomposed (TrackerProperty  *property,
 		/* value not found */
 		g_value_unset (&gvalue);
 	} else {
-		cache_delete_value (table_name, field_name, &gvalue, multiple_values, fts,
+		cache_delete_value (table_name, field_name, &gvalue, multiple_values,
+		                    tracker_property_get_fulltext_indexed (property),
 		                    tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_DATETIME);
 
 		change = TRUE;
@@ -1550,7 +1567,7 @@ cache_delete_resource_type (TrackerClass *class,
 	properties = tracker_ontologies_get_properties (&n_props);
 
 	for (p = 0; p < n_props; p++) {
-		gboolean            multiple_values, fts;
+		gboolean            multiple_values;
 		const gchar        *table_name;
 		const gchar        *field_name;
 		GValueArray        *old_values;
@@ -1566,8 +1583,6 @@ cache_delete_resource_type (TrackerClass *class,
 		table_name = tracker_property_get_table_name (prop);
 		field_name = tracker_property_get_name (prop);
 
-		fts = tracker_property_get_fulltext_indexed (prop);
-
 		old_values = get_old_property_values (prop, NULL);
 
 		for (i = old_values->n_values - 1; i >= 0 ; i--) {
@@ -1579,7 +1594,8 @@ cache_delete_resource_type (TrackerClass *class,
 			g_value_copy (old_gvalue, &gvalue);
 
 			value_set_remove_value (old_values, &gvalue);
-			cache_delete_value (table_name, field_name, &gvalue, multiple_values, fts,
+			cache_delete_value (table_name, field_name, &gvalue, multiple_values,
+			                    tracker_property_get_fulltext_indexed (prop),
 			                    tracker_property_get_data_type (prop) == TRACKER_PROPERTY_TYPE_DATETIME);
 		}
 	}
@@ -1636,7 +1652,9 @@ resource_buffer_switch (const gchar *graph,
 		} else {
 			resource_buffer->id = ensure_resource_id (resource_buffer->subject, &resource_buffer->create);
 		}
+#if HAVE_TRACKER_FTS
 		resource_buffer->fts_updated = FALSE;
+#endif
 		if (resource_buffer->create) {
 			resource_buffer->types = g_ptr_array_new ();
 		} else {
@@ -2063,10 +2081,12 @@ tracker_data_commit_db_transaction (void)
 
 	tracker_data_update_buffer_flush (NULL);
 
+#if HAVE_TRACKER_FTS
 	if (update_buffer.fts_ever_updated) {
 		tracker_fts_update_commit ();
 		update_buffer.fts_ever_updated = FALSE;
 	}
+#endif
 
 	if (update_buffer.class_counts) {
 		/* successful transaction, no need to rollback class counts,
diff --git a/src/libtracker-db/Makefile.am b/src/libtracker-db/Makefile.am
index 3376aaf..1f6452f 100644
--- a/src/libtracker-db/Makefile.am
+++ b/src/libtracker-db/Makefile.am
@@ -19,7 +19,7 @@ libtracker_db_la_SOURCES = 						\
 	tracker-db-interface.c						\
 	tracker-db-interface-sqlite.c					\
 	tracker-db-manager.c						\
-	tracker-db-journal.c						
+	tracker-db-journal.c
 
 noinst_HEADERS =							\
 	tracker-db.h							\
@@ -31,7 +31,6 @@ noinst_HEADERS =							\
 
 libtracker_db_la_LIBADD = 						\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la	\
-	$(top_builddir)/src/libtracker-fts/libtracker-fts.la		\
 	$(SQLITE3_LIBS)							\
 	$(DBUS_LIBS)							\
 	$(GCOV_LIBS)							\
@@ -39,5 +38,10 @@ libtracker_db_la_LIBADD = 						\
 	-lz								\
 	-lm
 
+if HAVE_TRACKER_FTS
+libtracker_db_la_LIBADD += 						\
+	$(top_builddir)/src/libtracker-fts/libtracker-fts.la
+endif
+
 EXTRA_DIST = libtracker-db.vapi
 
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index c76fb9a..86cd9df 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -26,7 +26,10 @@
 #include <math.h>
 
 #include <libtracker-common/tracker-common.h>
+
+#if HAVE_TRACKER_FTS
 #include <libtracker-fts/tracker-fts.h>
+#endif
 
 #include "tracker-db-interface-sqlite.h"
 
@@ -80,7 +83,9 @@ struct TrackerDBInterfaceSqlitePrivate {
 
 	guint in_transaction : 1;
 	guint ro : 1;
+#if HAVE_TRACKER_FTS
 	guint fts_initialized : 1;
+#endif
 	volatile gint interrupt;
 };
 
@@ -630,9 +635,11 @@ close_database (GObject                         *object,
 	g_slist_free (priv->function_data);
 	priv->function_data = NULL;
 
+#if HAVE_TRACKER_FTS
 	if (priv->fts_initialized) {
 		tracker_fts_shutdown (object);
 	}
+#endif
 
 	rc = sqlite3_close (priv->db);
 	g_warn_if_fail (rc == SQLITE_OK);
@@ -642,12 +649,14 @@ void
 tracker_db_interface_sqlite_fts_init (TrackerDBInterfaceSqlite *interface,
                                       gboolean                  create)
 {
+#if HAVE_TRACKER_FTS
 	TrackerDBInterfaceSqlitePrivate *priv;
 
 	priv = TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE (interface);
 
 	tracker_fts_init (priv->db, create, G_OBJECT (interface));
 	priv->fts_initialized = TRUE;
+#endif
 }
 
 static void
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index 7709657..f47f352 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -991,10 +991,13 @@ tracker_db_manager_shutdown (void)
 	sys_tmp_dir = NULL;
 	g_free (sql_dir);
 
+#if HAVE_TRACKER_FTS
 	/* shutdown fts in all threads
 	   needs to be done before shutting down all db interfaces as
 	   shutdown does not happen in thread where interface was created */
 	tracker_fts_shutdown_all ();
+#endif
+
 	/* shutdown db interfaces in all threads */
 	g_static_private_free (&interface_data_key);
 
diff --git a/src/tracker-store/Makefile.am b/src/tracker-store/Makefile.am
index edf3ed8..c1d3182 100644
--- a/src/tracker-store/Makefile.am
+++ b/src/tracker-store/Makefile.am
@@ -63,7 +63,6 @@ tracker_store_LDADD =							\
 	$(top_builddir)/src/libtracker-data/libtracker-data.la		\
 	$(top_builddir)/src/libtracker-db/libtracker-db.la 		\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la 	\
-	$(top_builddir)/src/libstemmer/libstemmer.la	 		\
 	$(SQLITE3_LIBS)							\
 	$(DBUS_LIBS)							\
 	$(GIO_LIBS)							\
@@ -75,6 +74,11 @@ tracker_store_LDADD =							\
 	-lz								\
 	-lm
 
+if HAVE_TRACKER_FTS
+tracker_store_LDADD += 							\
+	$(top_builddir)/src/libstemmer/libstemmer.la
+endif
+
 marshal_sources =                                         		\
         tracker-marshal.h                             			\
         tracker-marshal.c
diff --git a/src/tracker-utils/Makefile.am b/src/tracker-utils/Makefile.am
index dab2ab6..4dc27d8 100644
--- a/src/tracker-utils/Makefile.am
+++ b/src/tracker-utils/Makefile.am
@@ -28,14 +28,16 @@ libs = 									\
 bin_PROGRAMS = 								\
 	tracker-import							\
 	tracker-info							\
-	tracker-search 							\
 	tracker-sparql							\
 	tracker-stats							\
 	tracker-status							\
 	tracker-tag
 
+if HAVE_TRACKER_FTS
+bin_PROGRAMS += tracker-search
 tracker_search_SOURCES = tracker-search.c
 tracker_search_LDADD = $(libs)
+endif
 
 tracker_stats_SOURCES = tracker-stats.c
 tracker_stats_LDADD = $(libs)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3b90efb..a921cb2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,7 +8,6 @@ SUBDIRS = 			\
 	libtracker-miner	\
 	libtracker-data		\
 	libtracker-db 		\
-	libtracker-fts 		\
 	tracker-miner-fs	\
 	tracker-extract		\
 	tracker-store		\
@@ -16,4 +15,8 @@ SUBDIRS = 			\
 
 if DIST_FUNCTIONAL_TESTS
 SUBDIRS += functional-tests
+endif
+
+if HAVE_TRACKER_FTS
+SUBDIRS += libtracker-fts
 endif
\ No newline at end of file
diff --git a/tests/libtracker-db/Makefile.am b/tests/libtracker-db/Makefile.am
index ca3cd55..acc6441 100644
--- a/tests/libtracker-db/Makefile.am
+++ b/tests/libtracker-db/Makefile.am
@@ -36,7 +36,7 @@ TEST_PROGS +=								\
 
 # 	tracker-db-manager-unattach					\
 # 	tracker-db-manager-attach					\
-# 	tracker-db-manager-custom					
+# 	tracker-db-manager-custom
 
 
 tracker_db_journal_SOURCES = 						\
@@ -45,7 +45,6 @@ tracker_db_journal_SOURCES = 						\
 tracker_db_journal_LDADD =						\
 	$(top_builddir)/src/libtracker-db/libtracker-db.la 		\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la 	\
-	$(top_builddir)/src/libtracker-fts/libtracker-fts.la		\
 	$(top_builddir)/tests/common/libtracker-testcommon.la 		\
 	$(SQLITE3_LIBS)							\
 	$(GMODULE_LIBS)							\



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