build: Add our version of VALA_CHECK_PACKAGES
authorJens Georg <mail@jensge.org>
Sat, 8 Oct 2011 08:24:06 +0000 (10:24 +0200)
committerJens Georg <mail@jensge.org>
Sat, 8 Oct 2011 08:24:06 +0000 (10:24 +0200)
configure.ac
m4/rygel.m4

index 9fd3ce2..3672339 100644 (file)
@@ -135,11 +135,7 @@ if test x$try_ui = xyes ; then
     dnl check for gtk
     PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED,
       [
-        if test x$enable_vala = xyes ; then
-                VALA_CHECK_PACKAGES([gtk+-3.0], [HAVE_GTK=yes])
-        else
-                HAVE_GTK=yes
-        fi
+        RYGEL_CHECK_PACKAGES([gtk+-3.0], [HAVE_GTK=yes])
       ],
       [
         AC_MSG_WARN([gtk $GTK_REQUIRED or greater not found.])
@@ -163,11 +159,7 @@ then
     PKG_CHECK_MODULES(LIBSQLITE3, sqlite3 >= $LIBSQLITE3_REQUIRED)
     PKG_CHECK_MODULES(GSTREAMER_TAG, gstreamer-tag-0.10 >= $GSTREAMER_TAG_REQUIRED);
     PKG_CHECK_MODULES(GSTREAMER_APP, gstreamer-app-0.10 >= $GSTREAMER_APP_REQUIRED);
-    if test x$enable_vala = xyes ; then
-        VALA_CHECK_PACKAGES([sqlite3
-                             gstreamer-tag-0.10
-                             gstreamer-app-0.10])
-    fi
+    RYGEL_CHECK_PACKAGES([sqlite3 gstreamer-tag-0.10 gstreamer-app-0.10])
 fi
 
 dnl Gettext
index e264ee7..11e7c77 100644 (file)
@@ -26,6 +26,22 @@ AC_DEFUN([RYGEL_ADD_VALAFLAGS],
     VALAFLAGS="${VALAFLAGS:+$VALAFLAGS }$1"
 ])
 
+# RYGEL_CHECK_PACKAGES(LIST-OF-PACKAGES,
+#   ACTION-IF-FOUND)
+# ---------------------------------------
+# Version of VALA_CHECK_PACKAGES that will only run if vala support is
+# enabled. Otherwise ACTION-IF-FOUND will be run.
+AC_DEFUN([RYGEL_CHECK_PACKAGES],
+[
+    AS_IF([test "x$enable_vala" = "xyes"],
+          [
+                VALA_CHECK_PACKAGES([$1],[$2])
+          ],
+          [
+                $2
+          ])
+])
+
 # _RYGEL_ADD_PLUGIN_INTERNAL(NAME-OF-PLUGIN,
 #   NAME-OF-PLUGIN-WITH-UNDERSCORES,
 #   NAME-OF-PLUGIN-FOR-HELP,