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



commit 0842111b4096c64c8f80ebed3e66867cf7c07c13
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
    * playbin

 common.am                           |    5 +--
 configure.ac                        |   55 ++++++++++++++++++++++------
 doc/reference/Makefile.am           |    6 +++-
 examples/Makefile.am                |   26 +++++++++-----
 examples/standalone-renderer.c      |    1 +
 m4/rygel.m4                         |   11 ++++++
 src/Makefile.am                     |    6 +++-
 src/media-engines/Makefile.am       |    6 +++-
 tests/Makefile.am                   |   66 ++++++++++++++++++-----------------
 tests/rygel-http-response-test.vala |    2 -
 10 files changed, 122 insertions(+), 62 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..4e73b43 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])
+RYGEL_ADD_PLUGIN([tracker],[Tracker],[yes])
+
+AS_IF([test "x$with_media_engine" = "xgstreamer"],
+      [
+        RYGEL_ADD_PLUGIN([test],[Test],[no])
+        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([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/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 9072c1e..f24e141 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -1 +1,5 @@
-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
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 1f696a5..7768b5e 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,25 +1,33 @@
 include ../common.am
 
 AM_CFLAGS += \
-	-I$(top_builddir)/src/librygel-renderer \
-	-I$(top_srcdir)/src/librygel-renderer \
 	-I$(top_builddir)/src/librygel-server \
 	-I$(top_srcdir)/src/librygel-server \
 	-I$(top_builddir)/src/rygel \
-	-I$(top_srcdir)/src/rygel \
+	-I$(top_srcdir)/src/rygel
+
+noinst_PROGRAMS = standalone-server
+standalone_server_SOURCES = standalone-server.c
+standalone_server_LDADD = \
+	$(top_builddir)/src/librygel-server/librygel-server-1.0.la \
+	$(RYGEL_COMMON_LIBS)
+
+if HAVE_GSTREAMER
+AM_CFLAGS += \
+	-I$(top_builddir)/src/librygel-renderer-gst \
+	-I$(top_srcdir)/src/librygel-renderer-gst \
+	-I$(top_builddir)/src/librygel-renderer \
+	-I$(top_srcdir)/src/librygel-renderer \
 	$(LIBGSTREAMER_CFLAGS)
 
-noinst_PROGRAMS = standalone-renderer standalone-server
+noinst_PROGRAMS += standalone-renderer
 standalone_renderer_SOURCES = standalone-renderer.c
 standalone_renderer_LDADD = \
 	$(top_builddir)/src/librygel-renderer/librygel-renderer-1.0.la \
+	$(top_builddir)/src/librygel-renderer-gst/librygel-renderer-gst-1.0.la \
 	$(LIBGSTREAMER_LIBS) \
 	$(RYGEL_COMMON_LIBS)
-
-standalone_server_SOURCES = standalone-server.c
-standalone_server_LDADD = \
-	$(top_builddir)/src/librygel-server/librygel-server-1.0.la \
-	$(RYGEL_COMMON_LIBS)
+endif
 
 EXTRA_DIST = service/wrap-dbus \
 service/sysv/rygel \
diff --git a/examples/standalone-renderer.c b/examples/standalone-renderer.c
index 61bb3a7..65ce498 100644
--- a/examples/standalone-renderer.c
+++ b/examples/standalone-renderer.c
@@ -37,6 +37,7 @@
  */
 
 #include "rygel-renderer.h"
+#include "rygel-renderer-gst.h"
 #include "rygel-core.h"
 
 int main(int argc, char *argv[])
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
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0f7095b..65ca376 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,7 +26,7 @@ LDADD = $(LIBGUPNP_LIBS) \
 	$(LIBGUPNP_DLNA_LIBS) \
 	$(COVERAGE_LIBS)
 
-AM_VALAFLAGS = --disable-warnings --thread \
+AM_VALAFLAGS = --disable-warnings \
 	       --pkg gupnp-1.0 --pkg gupnp-av-1.0 --pkg dbus-glib-1 \
                --pkg gconf-2.0 --pkg gstreamer-0.10 --pkg gstreamer-base-0.10 \
                --pkg gio-2.0 --pkg gee-1.0 --pkg gstreamer-pbutils-0.10 \
@@ -42,10 +42,8 @@ check_PROGRAMS = rygel-http-item-uri-test \
 		 rygel-http-post-test \
 		 rygel-searchable-container-test \
 		 rygel-item-creator-test \
-		 rygel-playbin-renderer-test \
 		 rygel-user-config-test \
-		 rygel-regression \
-		 rygel-environment-test
+		 rygel-regression
 
 TESTS = $(check_PROGRAMS)
 
@@ -99,33 +97,6 @@ rygel_item_creator_test_SOURCES = rygel-item-creator-test.vala \
 				  rygel-search-expression.vala \
 				  rygel-media-engine.vala
 
-
-rygel_playbin_renderer_test_SOURCES = rygel-playbin-renderer-test.vala
-
-rygel_playbin_renderer_test_VALAFLAGS = \
-	$(AM_VALAFLAGS) \
-	--pkg rygel-renderer-gst-1.0 \
-	--pkg rygel-renderer-1.0 \
-	--pkg rygel-core-1.0 \
-	--vapidir $(top_builddir)/src/librygel-renderer \
-	--vapidir $(top_builddir)/src/librygel-renderer-gst \
-	--vapidir $(top_builddir)/src/librygel-core
-
-rygel_playbin_renderer_test_LDADD = \
-	$(top_builddir)/src/librygel-renderer/librygel-renderer-1.0.la \
-	$(top_builddir)/src/librygel-renderer-gst/librygel-renderer-gst-1.0.la \
-	$(top_builddir)/src/librygel-core/librygel-core-1.0.la \
-	$(LDADD)
-
-rygel_playbin_renderer_test_CFLAGS = \
-	$(AM_CFLAGS) \
-	-I$(top_builddir)/src/librygel-renderer \
-	-I$(top_srcdir)/src/librygel-renderer \
-	-I$(top_builddir)/src/librygel-renderer-gst \
-	-I$(top_srcdir)/src/librygel-renderer-gst \
-	-I$(top_builddir)/src/librygel-core \
-	-I$(top_srcdir)/src/librygel-core
-
 rygel_user_config_test_SOURCES = rygel-configuration.vala \
 				 rygel-user-config.vala \
 				 rygel-user-config-test.vala
@@ -138,7 +109,6 @@ rygel_user_config_test_CFLAGS = \
 	$(AM_CFLAGS) \
 	-DSYS_CONFIG_DIR='"$(sysconfigdir)"'
 
-
 rygel_regression_SOURCES = \
 	rygel-regression.vala
 
@@ -161,10 +131,42 @@ rygel_regression_LDADD = \
 	$(top_builddir)/src/librygel-server/librygel-server-1.0.la \
 	$(top_builddir)/src/librygel-core/librygel-core-1.0.la
 
+if HAVE_GSTREAMER
+check_PROGRAMS += \
+	rygel-playbin-renderer-test \
+	rygel-environment-test
+
+rygel_playbin_renderer_test_SOURCES = rygel-playbin-renderer-test.vala
+
+rygel_playbin_renderer_test_VALAFLAGS = \
+	$(AM_VALAFLAGS) \
+	--pkg rygel-renderer-gst-1.0 \
+	--pkg rygel-renderer-1.0 \
+	--pkg rygel-core-1.0 \
+	--vapidir $(top_builddir)/src/librygel-renderer \
+	--vapidir $(top_builddir)/src/librygel-renderer-gst \
+	--vapidir $(top_builddir)/src/librygel-core
+
+rygel_playbin_renderer_test_LDADD = \
+	$(top_builddir)/src/librygel-renderer/librygel-renderer-1.0.la \
+	$(top_builddir)/src/librygel-renderer-gst/librygel-renderer-gst-1.0.la \
+	$(top_builddir)/src/librygel-core/librygel-core-1.0.la \
+	$(LDADD)
+
+rygel_playbin_renderer_test_CFLAGS = \
+	$(AM_CFLAGS) \
+	-I$(top_builddir)/src/librygel-renderer \
+	-I$(top_srcdir)/src/librygel-renderer \
+	-I$(top_builddir)/src/librygel-renderer-gst \
+	-I$(top_srcdir)/src/librygel-renderer-gst \
+	-I$(top_builddir)/src/librygel-core \
+	-I$(top_srcdir)/src/librygel-core
+
 rygel_environment_test_SOURCES = rygel-environment-test.vala
 rygel_environment_test_CFLAGS = $(AM_CFLAGS)
 rygel_environment_test_LDADD = $(LDADD)
 rygel_environment_test_VALAFLAGS = $(AM_VALAFLAGS) --pkg gstreamer-0.10
+endif
 
 if ALWAYS_TEST
 all-local: check
diff --git a/tests/rygel-http-response-test.vala b/tests/rygel-http-response-test.vala
index 9f36384..d9e0c35 100644
--- a/tests/rygel-http-response-test.vala
+++ b/tests/rygel-http-response-test.vala
@@ -49,8 +49,6 @@ public class Rygel.HTTPResponseTest : GLib.Object {
     private Error error;
 
     public static int main (string[] args) {
-        Gst.init (ref args);
-
         try {
             var test = new HTTPResponseTest.complete ();
             test.run ();



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