[tracker] Unify dependency version checking for graphical tools.



commit a8f49a0361440cd218597ec195acf2f55c86a286
Author: Carlos Garnacho <carlos lanedo com>
Date:   Tue Oct 6 17:37:16 2009 +0200

    Unify dependency version checking for graphical tools.

 configure.ac                        |  176 ++++++++++++++---------------------
 src/tracker-explorer/Makefile.am    |    6 +-
 src/tracker-preferences/Makefile.am |   14 +--
 src/tracker-search-bar/Makefile.am  |   10 +-
 src/tracker-search-tool/Makefile.am |    6 +-
 src/tracker-status-icon/Makefile.am |    4 +-
 6 files changed, 88 insertions(+), 128 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c937586..e0a41a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -707,6 +707,40 @@ fi
 DESKBAR_APPLET_DIR="$deskbar_applet_dir"
 AC_SUBST(DESKBAR_APPLET_DIR)
 
+APP_REQUIREMENTS="glib-2.0    >= $GLIB_REQUIRED
+                  gthread-2.0 >= $GLIB_REQUIRED
+                  gtk+-2.0    >= $GTK_REQUIRED
+                  dbus-1      >= $DBUS_REQUIRED
+                  dbus-glib-1 >= $DBUS_GLIB_REQUIRED"
+
+APPLET_REQUIREMENTS="libgnomeui-2.0 libpanelapplet-2.0"
+VALA_REQUIREMENTS="gee-1.0 >= $GEE_REQUIRED"
+
+PKG_CHECK_MODULES(TRACKER_APPS,
+                  [ $APP_REQUIREMENTS ],
+                  [have_app_requirements=yes],
+                  [have_app_requirements=no])
+
+AC_SUBST(TRACKER_APPS_CFLAGS)
+AC_SUBST(TRACKER_APPS_LIBS)
+
+PKG_CHECK_MODULES(TRACKER_APPLETS,
+                  [ $APPLET_REQUIREMENTS ],
+                  [have_applet_requirements=yes],
+                  [have_applet_requirements=no])
+
+AC_SUBST(TRACKER_APPLETS_CFLAGS)
+AC_SUBST(TRACKER_APPLETS_LIBS)
+
+PKG_CHECK_MODULES(TRACKER_VALA,
+                  [ $VALA_REQUIREMENTS ],
+                  [have_vala_requirements=yes],
+                  [have_vala_requirements=no])
+
+AC_SUBST(TRACKER_VALA_CFLAGS)
+AC_SUBST(TRACKER_VALA_LIBS)
+
+
 ##################################################################
 # Enable building libtracker-gtk?
 ##################################################################
@@ -717,26 +751,15 @@ AC_ARG_ENABLE([libtrackergtk],
 	      [enable_libtrackergtk=auto])
 
 if test "x$enable_libtrackergtk" != "xno" ; then
-   PKG_CHECK_MODULES(LIBTRACKERGTK, [
-		     glib-2.0    >= $GLIB_REQUIRED
-		     gtk+-2.0    >= $GTK_REQUIRED
-        	     dbus-1      >= $DBUS_REQUIRED
-        	     dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
-		     [have_libtrackergtk=yes], 
-   		     [have_libtrackergtk=no])
-
-   AC_SUBST([LIBTRACKERGTK_CFLAGS])
-   AC_SUBST([LIBTRACKERGTK_LIBS])
+   if test "x$have_app_requirements" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find libtracker_gtk dependencies ($APP_REQUIREMENTS).])
+   else
+      have_libtrackergtk="yes"
+   fi
 else
    have_libtrackergtk="no  (disabled)"
 fi
 
-if test "x$enable_libtrackergtk" = "xyes"; then
-   if test "x$have_libtrackergtk" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find libtracker_gtk dependencies (glib-2.0 >= $GLIB_REQUIRED, gtk+-2.0 >= $GTK_REQUIRED, dbus-1 >= $DBUS_REQUIRED, dbus-glib-1 >= $DBUS_GLIB_REQUIRED).])
-   fi
-fi
-
 AM_CONDITIONAL(HAVE_LIBTRACKERGTK, test "$have_libtrackergtk" = "yes")
 
 ##################################################################
@@ -749,87 +772,53 @@ AC_ARG_ENABLE([tracker-status-icon],
 	      [enable_tracker_status_icon=auto])
 
 if test "x$enable_tracker_status_icon" != "xno" ; then
-   PKG_CHECK_MODULES(TRACKER_STATUS_ICON, [
-		     glib-2.0    >= $GLIB_REQUIRED
-		     gthread-2.0 >= $GLIB_REQUIRED
-		     gtk+-2.0    >= $GTK_REQUIRED
-        	     dbus-1      >= $DBUS_REQUIRED
-        	     dbus-glib-1 >= $DBUS_GLIB_REQUIRED
-		     libnotify   >= $LIBNOTIFY_REQUIRED],
-		     [have_tracker_status_icon=yes],
-   		     [have_tracker_status_icon=no])
-
-   AC_SUBST([TRACKER_STATUS_ICON_CFLAGS])
-   AC_SUBST([TRACKER_STATUS_ICON_LIBS])
+   if test "x$have_app_requirements" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find tracker-status-icon dependencies ($APP_REQUIREMENTS).])
+   else
+      have_tracker_status_icon="yes"
+   fi
 else
    have_tracker_status_icon="no  (disabled)"
 fi
 
-if test "x$enable_tracker_status_icon" = "xyes"; then
-   if test "x$have_tracker_status_icon" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-status-icon dependencies (glib-2.0 >= $GLIB_REQUIRED, gtk+-2.0 >= $GTK_REQUIRED, dbus-1 >= $DBUS_REQUIRED, dbus-glib-1 >= $DBUS_GLIB_REQUIRED, libnotify >= $LIBNOTIFY_REQUIRED).])
-   fi
-fi
-
 AM_CONDITIONAL(HAVE_TRACKER_STATUS_ICON, test "$have_tracker_status_icon" = "yes")
 
+
 AC_ARG_ENABLE([tracker-explorer],
 	      AS_HELP_STRING([--enable-tracker-explorer],
 	                     [enable tracker-explorer[[default=auto]]]),,
 	      [enable_tracker_explorer=auto])
 
 if test "x$enable_tracker_explorer" != "xno" ; then
-   PKG_CHECK_MODULES(TRACKER_EXPLORER, [
-		glib-2.0    >= $GLIB_REQUIRED
-		gtk+-2.0    >= $GTK_REQUIRED
-		dbus-1      >= $DBUS_REQUIRED
-		dbus-glib-1 >= $DBUS_GLIB_REQUIRED
-		gee-1.0     >= $GEE_REQUIRED],
-		[have_tracker_explorer=yes],
-		[have_tracker_explorer=no])
-
-   AC_SUBST([TRACKER_EXPLORER_CFLAGS])
-   AC_SUBST([TRACKER_EXPLORER_LIBS])
+   if test "x$have_app_requirements" != "xyes" -o \
+           "x$have_vala_requirements" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find tracker-explorer dependencies ($APP_REQUIREMENTS $VALA_REQUIREMENTS).])
+   else
+      have_tracker_explorer="yes"
+   fi
 else
    have_tracker_explorer="no  (disabled)"
 fi
 
-if test "x$enable_tracker_explorer" = "xyes"; then
-   if test "x$have_tracker_explorer" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-explorer dependencies (glib-2.0 >= $GLIB_REQUIRED, gtk+-2.0 >= $GTK_REQUIRED, dbus-1 >= $DBUS_REQUIRED, dbus-glib-1 >= $DBUS_GLIB_REQUIRED, gee-1.0 >= $GEE_REQUIRED).])
-   fi
-fi
-
 AM_CONDITIONAL(HAVE_TRACKER_EXPLORER, test "$have_tracker_explorer" = "yes")
 
+
 AC_ARG_ENABLE([tracker-search-bar],
 	      AS_HELP_STRING([--enable-tracker-search-bar],
 	                     [enable tracker-search-bar[[default=auto]]]),,
 	      [enable_tracker_search_bar=auto])
 
 if test "x$enable_tracker_search_bar" != "xno" ; then
-   PKG_CHECK_MODULES(TRACKER_SEARCH_BAR, [
-   		libgnomeui-2.0 
-   		libpanelapplet-2.0 
-		glib-2.0    >= $GLIB_REQUIRED
-		gtk+-2.0    >= $GTK_REQUIRED
-		dbus-1      >= $DBUS_REQUIRED
-		dbus-glib-1 >= $DBUS_GLIB_REQUIRED],
-		[have_tracker_search_bar=yes],
-		[have_tracker_search_bar=no])
-
-   AC_SUBST([TRACKER_SEARCH_BAR_CFLAGS])
-   AC_SUBST([TRACKER_SEARCH_BAR_LIBS])
+   if test "x$have_app_requirements" != "xyes" -o \
+           "x$have_applet_requirements" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find tracker-search-bar dependencies ($APP_REQUIREMENTS $APPLET_REQUIREMENTS).])
+   else
+      have_tracker_search_bar="yes"
+   fi
 else
    have_tracker_search_bar="no  (disabled)"
 fi
 
-if test "x$enable_tracker_search_bar" = "xyes"; then
-   if test "x$have_tracker_search_bar" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-search-bar dependencies (glib-2.0 >= $GLIB_REQUIRED, gtk+-2.0 >= $GTK_REQUIRED, dbus-1 >= $DBUS_REQUIRED, dbus-glib-1 >= $DBUS_GLIB_REQUIRED, gee-1.0 >= $GEE_REQUIRED, libpanelapplet-2.0 and libgnomeui-2.0).])
-   fi
-fi
-
 AM_CONDITIONAL(HAVE_TRACKER_SEARCH_BAR, test "$have_tracker_search_bar" = "yes")
 
 ##################################################################
@@ -842,27 +831,16 @@ AC_ARG_ENABLE(tracker-search-tool,
 	      [enable_tracker_search_tool=auto])
 
 if test "x$enable_tracker_search_tool" != "xno"; then
-   PKG_CHECK_MODULES(TRACKER_SEARCH_TOOL, [
-		glib-2.0    >= $GLIB_REQUIRED
-		gtk+-2.0    >= $GTK_REQUIRED
-		dbus-1      >= $DBUS_REQUIRED
-		dbus-glib-1 >= $DBUS_GLIB_REQUIRED
-		gee-1.0     >= $GEE_REQUIRED],
-		[have_tracker_search_tool=yes],
-		[have_tracker_search_tool=no])
-
-   AC_SUBST([TRACKER_SEARCH_TOOL_CFLAGS])
-   AC_SUBST([TRACKER_SEARCH_TOOL_LIBS])
+   if test "x$have_app_requirements" != "xyes" -o \
+           "x$have_vala_requirements" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find tracker-search-tool dependencies ($APP_REQUIREMENTS $VALA_REQUIREMENTS).])
+   else
+      have_tracker_search_tool="yes"
+   fi
 else
    have_tracker_search_tool="no  (disabled)"
 fi
 
-if test "x$enable_tracker_search_tool" = "xyes"; then
-   if test "x$have_tracker_search_tool" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-search-tool dependencies (glib-2.0 >= $GLIB_REQUIRED, gtk+-2.0 >= $GTK_REQUIRED, dbus-1 >= $DBUS_REQUIRED, dbus-glib-1 >= $DBUS_GLIB_REQUIRED, gee-1.0 >= $GEE_REQUIRED).])
-   fi
-fi
-
 AM_CONDITIONAL(HAVE_TRACKER_SEARCH_TOOL, test "$have_tracker_search_tool" = "yes")
 
 ##################################################################
@@ -875,33 +853,15 @@ AC_ARG_ENABLE([tracker-preferences],
               [enable_tracker_preferences=auto])
 
 if test "x$enable_tracker_preferences" != "xno" ; then
-   PKG_CHECK_MODULES(GLIB2, 
-   	             [glib-2.0 >= $GLIB_REQUIRED],
-		     [have_tracker_preferences=yes], 
-		     [have_tracker_preferences=no])
-
-   AC_SUBST([GLIB2_CFLAGS])
-   AC_SUBST([GLIB2_LIBS])
-
-   if test "$have_tracker_preferences" = "yes"; then
-      PKG_CHECK_MODULES(GTK2, 
-      			[gtk+-2.0 >= $GTK_REQUIRED],
-			[have_tracker_preferences=yes], 
-			[have_tracker_preferences=no])
-
-      AC_SUBST([GTK2_CFLAGS])
-      AC_SUBST([GTK2_LIBS])
+   if test "x$have_app_requirements" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find tracker-preferences dependencies ($APP_REQUIREMENTS).])
+   else
+      have_tracker_preferences="yes"
    fi
 else
    have_tracker_preferences="no  (disabled)"
 fi
 
-if test "x$enable_tracker_preferences" = "xyes"; then
-   if test "x$have_tracker_preferences" != "xyes"; then
-      AC_MSG_ERROR([Couldn't find tracker-preferences dependencies (GLib >= $GLIB_REQUIRED, GTK+ >= $GTK_REQUIRED).])
-   fi
-fi
-
 AM_CONDITIONAL(HAVE_TRACKER_PREFERENCES, test "$have_tracker_preferences" = "yes")
 
 ####################################################################
diff --git a/src/tracker-explorer/Makefile.am b/src/tracker-explorer/Makefile.am
index 433eec3..105cc11 100644
--- a/src/tracker-explorer/Makefile.am
+++ b/src/tracker-explorer/Makefile.am
@@ -18,14 +18,16 @@ tracker_explorer.vala.stamp: $(tracker_explorer_VALASOURCES)
 tracker_explorer_CFLAGS = \
 	-DTRACKER_UI_DIR=\"$(datadir)/tracker/\"		\
 	-DSRCDIR=\"$(abs_srcdir)/\"				\
+	$(TRACKER_APPS_CFLAGS)					\
+	$(TRACKER_VALA_CFLAGS)					\
 	$(WARN_CFLAGS)						\
 	$(GCOV_CFLAGS)						\
-	$(TRACKER_EXPLORER_CFLAGS)				\
 	$(NULL)
 
 tracker_explorer_LDADD = \
+	$(TRACKER_APPS_LIBS)					\
+	$(TRACKER_VALA_LIBS)					\
 	$(GCOV_LIBS)						\
-	$(TRACKER_EXPLORER_LIBS)				\
 	$(NULL)
 
 uidir = $(datadir)/tracker
diff --git a/src/tracker-preferences/Makefile.am b/src/tracker-preferences/Makefile.am
index 63dd32b..98e9889 100644
--- a/src/tracker-preferences/Makefile.am
+++ b/src/tracker-preferences/Makefile.am
@@ -17,12 +17,9 @@ INCLUDES = 								\
 	-DTRACKER_COMPILATION 						\
 	-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\"			\
 	-I$(top_srcdir)/src						\
+	$(TRACKER_APPS_CFLAGS)						\
 	$(WARN_CFLAGS)							\
-	$(GLIB_CFLAGS) 							\
-	$(GCOV_CFLAGS) 							\
-	$(GTK2_CFLAGS) 							\
-	$(DBUS_CFLAGS)							\
-	$(GMODULE_CFLAGS)
+	$(GCOV_CFLAGS)
 
 BUILT_SOURCES = tracker-preferences.vala.stamp
 
@@ -39,11 +36,8 @@ tracker_preferences_SOURCES = 						\
 tracker_preferences_LDADD = 						\
 	$(top_builddir)/src/libtracker-client/libtracker-client- TRACKER_API_VERSION@.la	\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la 	\
-	$(GTK2_LIBS) 							\
-	$(DBUS_LIBS) 							\
-	$(GCOV_LIBS) 							\
-	$(GLIB_LIBS)							\
-	$(GMODULE_LIBS)
+	$(TRACKER_APPS_LIBS)						\
+	$(GCOV_LIBS)
 
 MAINTAINERCLEANFILES =							\
 	tracker-preferences.vala.stamp					\
diff --git a/src/tracker-search-bar/Makefile.am b/src/tracker-search-bar/Makefile.am
index 0af6526..1e570c6 100644
--- a/src/tracker-search-bar/Makefile.am
+++ b/src/tracker-search-bar/Makefile.am
@@ -14,14 +14,16 @@ tracker_search_bar_CFLAGS = \
 	-DPKGDATADIR=\""$(pkgdatadir)"\"	 		\
 	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" 	\
 	-I$(top_srcdir)/src					\
+	$(TRACKER_APPS_CFLAGS)					\
+	$(TRACKER_APPLET_CFLAGS)				\
 	$(WARN_CFLAGS)						\
-	$(GCOV_CFLAGS)						\
-	$(TRACKER_SEARCH_BAR_CFLAGS)
+	$(GCOV_CFLAGS)
 
 tracker_search_bar_LDADD = 					\
 	$(top_builddir)/src/libtracker-client/libtracker-client- TRACKER_API_VERSION@.la \
-	$(GCOV_LIBS)						\
-	$(TRACKER_SEARCH_BAR_LIBS)
+	$(TRACKER_APPS_CFLAGS)					\
+	$(TRACKER_APPLET_CFLAGS)				\
+	$(GCOV_LIBS)
 
 uidir = $(datadir)/tracker
 ui_DATA = tracker-search-bar.ui
diff --git a/src/tracker-search-tool/Makefile.am b/src/tracker-search-tool/Makefile.am
index 6e760b9..35a9225 100644
--- a/src/tracker-search-tool/Makefile.am
+++ b/src/tracker-search-tool/Makefile.am
@@ -23,15 +23,17 @@ tracker_search_tool.gs.stamp: $(tracker_search_tool_VALASOURCES)
 tracker_search_tool_CFLAGS = \
 	-DTRACKER_UI_DIR=\"$(datadir)/tracker/\"		\
 	-DSRCDIR=\"$(abs_srcdir)/\"				\
+	$(TRACKER_APPS_CFLAGS)					\
+	$(TRACKER_VALA_CFLAGS)					\
 	$(WARN_CFLAGS)						\
 	$(GCOV_CFLAGS)						\
-	$(TRACKER_SEARCH_TOOL_CFLAGS)				\
 	-include$(top_srcdir)/config.h  			\
 	$(NULL)
 
 tracker_search_tool_LDADD = 					\
+	$(TRACKER_APPS_LIBS)					\
+	$(TRACKER_VALA_LIBS)					\
 	$(GCOV_LIBS)						\
-	$(TRACKER_SEARCH_TOOL_LIBS)				\
 	$(NULL)
 
 uidir = $(datadir)/tracker
diff --git a/src/tracker-status-icon/Makefile.am b/src/tracker-status-icon/Makefile.am
index fb999f3..e0bb6cc 100644
--- a/src/tracker-status-icon/Makefile.am
+++ b/src/tracker-status-icon/Makefile.am
@@ -7,15 +7,15 @@ INCLUDES =								\
 	-DTRACKER_LIBEXECDIR=\""$(libexecdir)"\" 			\
 	-DTRACKER_COMPILATION						\
 	-I$(top_srcdir)/src						\
+	$(TRACKER_APPS_CFLAGS)						\
 	$(WARN_CFLAGS)							\
-	$(TRACKER_STATUS_ICON_CFLAGS)					\
 	$(GCOV_CFLAGS)
 
 bin_PROGRAMS = tracker-status-icon
 
 tracker_status_icon_LDADD = 						\
 	$(top_builddir)/src/libtracker-miner/libtracker-miner.la 	\
-	$(TRACKER_STATUS_ICON_LIBS)					\
+	$(TRACKER_APPS_LIBS)						\
 	$(GCOV_LIBS)
 
 tracker_status_icon_SOURCES =						\



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