[rygel/wip/media-engine: 13/13] build: Enable building Rygel without GStreamer



commit 698d9bbdbcd7afbebbee2816abbd79724d7bdfda
Author: Jens Georg <jensg openismus com>
Date:   Thu Sep 27 13:10:57 2012 +0200

    build: Enable building Rygel without GStreamer
    
    If no GStreamer is available, build Rygel without a media engine and all
    Plugins that require GStreamer, such as:
    
    * test
    * gst-launch
    + media-export
    * tracker
    * playbin

 common.am                     |    5 +---
 configure.ac                  |   55 ++++++++++++++++++++++++++++++++---------
 m4/rygel.m4                   |   11 ++++++++
 src/Makefile.am               |    6 +++-
 src/media-engines/Makefile.am |    6 +++-
 5 files changed, 65 insertions(+), 18 deletions(-)
---
diff --git a/common.am b/common.am
index 9366323..dd136c1 100644
--- a/common.am
+++ b/common.am
@@ -58,13 +58,10 @@ RYGEL_COMMON_LIBS = \
 
 RYGEL_COMMON_SERVER_LIBS = \
 	$(top_builddir)/src/librygel-server/librygel-server-1.0.la \
-	$(RYGEL_COMMON_LIBS) \
-	$(GST_PBU_LIBS) \
-	$(LIBGUPNP_DLNA_LIBS)
+	$(RYGEL_COMMON_LIBS)
 
 RYGEL_COMMON_RENDERER_LIBS = \
 	$(top_builddir)/src/librygel-renderer/librygel-renderer-1.0.la \
-	$(LIBGSTREAMER_LIBS)
 	$(RYGEL_COMMON_LIBS)
 
 # Note: the -g needs to be at the end of VALAFLAGS to not break make dist
diff --git a/configure.ac b/configure.ac
index 7e25284..fe90657 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,39 +58,69 @@ VALAFLAGS="--target-glib=2.32 $VALAFLAGS"
 PKG_CHECK_MODULES(LIBGSSDP, gssdp-1.0 >= $GSSDP_REQUIRED)
 PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
 PKG_CHECK_MODULES(LIBGUPNP_AV, gupnp-av-1.0 >= $GUPNP_AV_REQUIRED)
-PKG_CHECK_MODULES(LIBGUPNP_DLNA, gupnp-dlna-1.0 >= $GUPNP_DLNA_REQUIRED)
-PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
-PKG_CHECK_MODULES(GSTREAMER_BASE, gstreamer-base-0.10 >= $GSTREAMER_REQUIRED)
-PKG_CHECK_MODULES(GST_PBU, gstreamer-pbutils-0.10 >= $GSTPBU_REQUIRED)
 PKG_CHECK_MODULES(LIBGIO, gio-2.0 >= $GIO_REQUIRED)
 PKG_CHECK_MODULES(GEE, gee-1.0 >= $GEE_REQUIRED)
 PKG_CHECK_MODULES(UUID, uuid >= $UUID_REQUIRED)
 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_REQUIRED)
 
+dnl Media engine to use
+AC_ARG_WITH([media_engine],
+            AS_HELP_STRING(
+                [--with-media-engine=@<:@gstreamer|none@:>@],
+                [Media Engine to use]),
+            [with_media_engine="$withval"],
+            [with_media_engine="gstreamer"])
+
+AS_IF([test "x$with_media_engine" = "xgstreamer"],
+      [
+        PKG_CHECK_MODULES(LIBGUPNP_DLNA, gupnp-dlna-1.0 >= $GUPNP_DLNA_REQUIRED)
+        PKG_CHECK_MODULES(LIBGSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED)
+        PKG_CHECK_MODULES(GSTREAMER_BASE, gstreamer-base-0.10 >= $GSTREAMER_REQUIRED)
+        PKG_CHECK_MODULES(GST_PBU, gstreamer-pbutils-0.10 >= $GSTPBU_REQUIRED)
+        enable_gstreamer="yes"
+      ],
+      [enable_gstreamer="no"])
+AM_CONDITIONAL([HAVE_GSTREAMER],[test "x$enable_gstreamer" = "xyes"])
+
 dnl Add plugins
-RYGEL_ADD_PLUGIN([test],[Test],[no])
-RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes])
 RYGEL_ADD_PLUGIN([external],[MediaServer2 DBus consumer],[yes])
 RYGEL_ADD_PLUGIN([mpris],[MPRIS2 DBus consumer],[yes])
-RYGEL_ADD_PLUGIN([playbin],[GStreamer playbin],[yes])
 RYGEL_ADD_PLUGIN([mediathek],[ZDF Mediathek],[no])
-RYGEL_ADD_PLUGIN([media-export],[MediaExport],[yes])
-RYGEL_ADD_PLUGIN([gst-launch],[GStreamer launchline],[no])
+AS_IF([test "x$with_media_engine" = "xgstreamer"],
+      [
+        RYGEL_ADD_PLUGIN([test],[Test],[no])
+        RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes])
+        RYGEL_ADD_PLUGIN([playbin],[GStreamer playbin],[yes])
+        RYGEL_ADD_PLUGIN([media-export],[MediaExport],[yes])
+        RYGEL_ADD_PLUGIN([gst-launch],[GStreamer launchline],[no])
+      ],
+      [
+        RYGEL_DISABLE_PLUGIN([test])
+        RYGEL_DISABLE_PLUGIN([tracker])
+        RYGEL_DISABLE_PLUGIN([playbin])
+        RYGEL_DISABLE_PLUGIN([media-export])
+        RYGEL_DISABLE_PLUGIN([gst-launch])
+      ])
 
 dnl Explicitly add stamp files for targets that are not plugins
+RYGEL_ADD_STAMP([src/librygel-core/librygel_core_1_0_la_vala.stamp])
+RYGEL_ADD_STAMP([src/librygel-server/librygel_server_1_0_la_vala.stamp])
+RYGEL_ADD_STAMP([src/librygel-renderer/librygel_renderer_1_0_la_vala.stamp])
 RYGEL_ADD_STAMP([src/rygel/rygel_vala.stamp])
 RYGEL_ADD_STAMP([src/ui/rygel_preferences_vala.stamp])
 
 RYGEL_CHECK_VALA([$VALA_REQUIRED],
                  [gupnp-1.0
                   gupnp-av-1.0
-                  gupnp-dlna-1.0
-                  gstreamer-0.10
-                  gstreamer-pbutils-0.10
                   gio-2.0
                   gee-1.0
                   posix])
 
+AS_IF([test "x$with_media_engine" = "xgstreamer"],
+      [
+        RYGEL_CHECK_PACKAGES([gupnp-dlna-1.0 gstreamer-0.10 gstreamer-pbutils-0.10])
+      ])
+
 dnl Debugging
 AC_ARG_ENABLE(debug,
 	AS_HELP_STRING([--enable-debug],[enable debugging]),,
@@ -279,6 +309,7 @@ echo "
         VALAFLAGS:              ${VALAFLAGS}
         uninstalled:            ${enable_uninstalled}
         preferences ui:         ${HAVE_GTK}
+        Media Engine:           ${with_media_engine}
     Plugins:
         test:                   ${enable_test_plugin}
         tracker:                ${enable_tracker_plugin}
diff --git a/m4/rygel.m4 b/m4/rygel.m4
index 11e7c77..d291433 100644
--- a/m4/rygel.m4
+++ b/m4/rygel.m4
@@ -73,6 +73,17 @@ AC_DEFUN([RYGEL_ADD_PLUGIN],
         [$3])
 ])
 
+AC_DEFUN([_RYGEL_DISABLE_PLUGIN_INTERNAL],
+[
+    AM_CONDITIONAL(m4_toupper(build_$1_plugin), false)
+    enable_$1_plugin="n/a"
+])
+
+AC_DEFUN([RYGEL_DISABLE_PLUGIN],
+[
+    _RYGEL_DISABLE_PLUGIN_INTERNAL(m4_translit([$1],[-],[_]))
+])
+
 AC_DEFUN([RYGEL_CHECK_VALA],
 [
     AC_ARG_ENABLE([vala],
diff --git a/src/Makefile.am b/src/Makefile.am
index 754e42d..c3737aa 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,8 @@
-SUBDIRS = librygel-core librygel-renderer librygel-server librygel-renderer-gst
+SUBDIRS = librygel-core librygel-renderer librygel-server
+
+if HAVE_GSTREAMER
+SUBDIRS += librygel-renderer-gst
+endif
 
 SUBDIRS += rygel media-engines plugins
 
diff --git a/src/media-engines/Makefile.am b/src/media-engines/Makefile.am
index 7d0d842..9cf45e9 100644
--- a/src/media-engines/Makefile.am
+++ b/src/media-engines/Makefile.am
@@ -1 +1,5 @@
-SUBDIRS=gstreamer
+SUBDIRS=
+
+if HAVE_GSTREAMER
+SUBDIRS += gstreamer
+endif



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