[gnome-contacts] Add --{en,dis}able-gst flag to configure



commit 9c05ebbe851df336fcc03016e63c3f412e7d3be4
Author: Priit Laes <plaes plaes org>
Date:   Sat Aug 18 13:25:07 2012 +0300

    Add --{en,dis}able-gst flag to configure
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682146

 configure.ac |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dda160e..5e08f12 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,11 +57,31 @@ gstreamers_modules="gdk-x11-3.0
 		    cheese-gtk >= 3.3.5
 		    cheese
                     "
-PKG_CHECK_MODULES(CONTACTS_GSTREAMER,
+
+AC_MSG_CHECKING([whether to enable gstreamer/cheese support])
+AC_ARG_ENABLE([gst],
+    AS_HELP_STRING([--enable-gst], [Whether to enable gstreamer and cheese support @<:@default=auto@:>@]),
+    [], [enable_gst=auto])
+AC_MSG_RESULT([$enable_gst])
+if test "$enable_gst" != "no"; then
+    PKG_CHECK_MODULES(CONTACTS_GSTREAMER,
                   [$gstreamers_modules],
-                  AM_CONDITIONAL(USE_GSTREAMER, true),
-                  AM_CONDITIONAL(USE_GSTREAMER, false))
+                  [have_gst=yes], [have_gst=no])
+    if test "$enable_gst" = "yes" -a "$have_gst" = "no"; then
+        AC_MSG_ERROR([GStreamer/Cheese support was requested but requirements were not met])
+    elif test "$have_gst" = "yes"; then
+        enable_gst=yes
+    else
+        enable_gst=no
+    fi
+fi
+
+if test "$enable_gst" = "yes"; then
+    AC_DEFINE([USE_GSTREAMER], 1,
+            [Define to enable gstreamer/cheese support])
+fi
 
+AM_CONDITIONAL(USE_GSTREAMER, test "$enable_gst" = "yes")
 CONTACTS_GSTREAMER_PACKAGES="--pkg gdk-x11-3.0 --pkg gstreamer-0.10 --pkg gstreamer-interfaces-0.10"
 AC_SUBST(CONTACTS_GSTREAMER_PACKAGES)
 



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