[gtk/wip/carlosg/tracker3-dist-fix] autotools: Teach about tracker3 search engine



commit b999c8d826257798e0dcccfc5bf89c96f2e33c3d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 7 23:07:11 2020 +0200

    autotools: Teach about tracker3 search engine
    
    Add --enable-tracker3 option (off by default, like in meson) and
    hook the tracker3 search engine to build. Also, make sure it's part
    of dist.
    
    Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2912

 configure.ac    | 24 ++++++++++++++++++++++++
 gtk/Makefile.am |  9 +++++++++
 2 files changed, 33 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 3e7a846e33..a025a3f8f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1552,6 +1552,30 @@ else
   fi
 fi
 
+# Checks to see if we should compile with tracker3 search engine
+#
+
+AC_ARG_ENABLE(tracker3,
+              [AS_HELP_STRING([--enable-tracker3],
+                              [enable tracker3 search engine])],
+              [enable_tracker3=yes],
+              [enable_tracker3=no])
+
+if test "x$enable_tracker3" = "xyes"; then
+  PKG_CHECK_MODULES(TRACKER3, [tracker-sparql-3.0], have_tracker3=yes, have_tracker3=no)
+  GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $TRACKER3_CFLAGS"
+  GTK_DEP_LIBS="$GTK_DEP_LIBS $TRACKER3_LIBS"
+  if test "x$have_tracker3" = "xyes"; then
+    AC_DEFINE([HAVE_TRACKER3], [], [Define if tracker3 is available])
+  else
+    AC_MSG_ERROR([
+*** tracker3 not found.
+])
+  fi
+fi
+
+AM_CONDITIONAL(HAVE_TRACKER3, test "x$have_tracker3" = "xyes")
+
 # Checks to see if we should compile with cloudprint backend for GTK+
 #
 
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 9559595586..b200274135 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1030,6 +1030,13 @@ gtk_private_h_sources += \
        gtkprinteroptionwidget.h        \
        gtksearchenginetracker.h
 
+if HAVE_TRACKER3
+gtk_private_h_sources += \
+       gtksearchenginetracker3.h
+gtk_os_unix_c_sources += \
+       gtksearchenginetracker3.c
+endif
+
 gtk_c_sources += $(gtk_os_unix_c_sources)
 endif
 
@@ -1770,6 +1777,8 @@ EXTRA_DIST +=                   \
        gtkwin32embedwidget.c   \
        gtkprint-win32.h        \
        gtkprint-win32.c        \
+       gtksearchenginetracker3.c \
+       gtksearchenginetracker3.h \
        gtksearchenginequartz.h \
        gtkdbusinterfaces.xml   \
        gtk-keys.css.default    \


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