[banshee] build: Rework build configuration for GStreamer backends



commit 0d79eeeb47c5d94df33750dfa99419dd34b26e48
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Fri Nov 1 14:24:09 2013 +0100

    build: Rework build configuration for GStreamer backends
    
    Using a PLAYBACK_BACKEND variable in SUBDIRS is incorrect, as it
    always causes one of the backends to be omitted from the source tarball,
    thus breaking "make distcheck".
    
    The two GStreamer backends can now be built conditionnaly, with the
    appropriate --enable-gst-sharp and/or --disable-gst-native configure
    option.
    
    By default, only the native backend is built, as was the case before.
    You can choose to build both backends, or none if you want Banshee to be
    very silent...
    
    An indication whether the native backend will be built is added to the
    configure output, for clarity.

 build/m4/banshee/gstreamer-sharp.m4                |    9 ++---
 build/m4/banshee/gstreamer.m4                      |   36 +++++++++++--------
 build/m4/banshee/libbanshee.m4                     |    3 --
 configure.ac                                       |   13 ++++---
 src/Backends/Banshee.GStreamer/Makefile.am         |    6 +++-
 .../Banshee.GStreamer/libbanshee/Makefile.am       |    9 +++--
 src/Backends/Banshee.GStreamerSharp/Makefile.am    |    6 +++-
 src/Backends/Makefile.am                           |    3 +-
 8 files changed, 50 insertions(+), 35 deletions(-)
---
diff --git a/build/m4/banshee/gstreamer-sharp.m4 b/build/m4/banshee/gstreamer-sharp.m4
index 7fd14f3..7ebdc30 100644
--- a/build/m4/banshee/gstreamer-sharp.m4
+++ b/build/m4/banshee/gstreamer-sharp.m4
@@ -5,12 +5,9 @@ AC_DEFUN([BANSHEE_CHECK_GSTREAMER_SHARP],
        if test "x$enable_gst_sharp" = "xyes"; then
                PKG_CHECK_MODULES(GST_SHARP, gstreamer-sharp-0.10)
                AC_SUBST(GST_SHARP_LIBS)
-
-               PLAYBACK_BACKEND="Banshee.GStreamerSharp"
-               AC_SUBST(PLAYBACK_BACKEND)
-
-               dnl Clutter support is not available in Gst# backend (and was opt-in in the unmanaged one)
-               AM_CONDITIONAL(HAVE_CLUTTER, false)
+               AM_CONDITIONAL(ENABLE_GST_SHARP, true)
+       else
+               AM_CONDITIONAL(ENABLE_GST_SHARP, false)
        fi
 ])
 
diff --git a/build/m4/banshee/gstreamer.m4 b/build/m4/banshee/gstreamer.m4
index ec1f280..3b18fd5 100644
--- a/build/m4/banshee/gstreamer.m4
+++ b/build/m4/banshee/gstreamer.m4
@@ -1,21 +1,27 @@
 AC_DEFUN([BANSHEE_CHECK_GSTREAMER],
 [
-       BANSHEE_CHECK_LIBBANSHEE
+       AC_ARG_ENABLE(gst_native, AC_HELP_STRING([--disable-gst-native], [Disable GStreamer native backend]), 
, enable_gst_native="yes")
 
-       GSTREAMER_REQUIRED_VERSION=1.0.0
-       AC_SUBST(GSTREAMER_REQUIRED_VERSION)
+       if test "x$enable_gst_native" = "xyes"; then
+               BANSHEE_CHECK_LIBBANSHEE
 
-       PKG_CHECK_MODULES(GST,
-               gstreamer-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-base-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-controller-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-plugins-base-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-audio-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-fft-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-pbutils-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-tag-1.0 >= $GSTREAMER_REQUIRED_VERSION
-               gstreamer-video-1.0 >= $GSTREAMER_REQUIRED_VERSION)
+               GSTREAMER_REQUIRED_VERSION=1.0.0
+               
+               PKG_CHECK_MODULES(GST,
+                       gstreamer-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-base-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-controller-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-plugins-base-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-audio-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-fft-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-pbutils-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-tag-1.0 >= $GSTREAMER_REQUIRED_VERSION
+                       gstreamer-video-1.0 >= $GSTREAMER_REQUIRED_VERSION)
 
-       AC_SUBST(GST_CFLAGS)
-       AC_SUBST(GST_LIBS)
+               AC_SUBST(GST_CFLAGS)
+               AC_SUBST(GST_LIBS)
+               AM_CONDITIONAL(ENABLE_GST_NATIVE, true)
+       else
+               AM_CONDITIONAL(ENABLE_GST_NATIVE, false)
+       fi
 ])
diff --git a/build/m4/banshee/libbanshee.m4 b/build/m4/banshee/libbanshee.m4
index f660e1c..12fc44e 100644
--- a/build/m4/banshee/libbanshee.m4
+++ b/build/m4/banshee/libbanshee.m4
@@ -29,9 +29,6 @@ AC_DEFUN([BANSHEE_CHECK_LIBBANSHEE],
 
        AM_CONDITIONAL(HAVE_CLUTTER, test "x$enable_clutter" = "xyes")
 
-       PLAYBACK_BACKEND="Banshee.GStreamer"
-       AC_SUBST(PLAYBACK_BACKEND)
-
        AC_SUBST(LIBBANSHEE_CFLAGS)
        AC_SUBST(LIBBANSHEE_LIBS)
 ])
diff --git a/configure.ac b/configure.ac
index 1a433ee..6c5bc8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,13 +53,15 @@ SHAMROCK_EXPAND_DATADIR
 
 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.22)
 
+dnl Clutter support is not available in Gst# backend and is opt-in in the unmanaged one
+dnl so we set a default value here for simplicity
+AM_CONDITIONAL(HAVE_CLUTTER, false)
+
 dnl For the new media backend using gstreamer# (disabled by default for now)
 BANSHEE_CHECK_GSTREAMER_SHARP
 
-if test "x$enable_gst_sharp" != "xyes"; then
-       dnl Default media backend, libbanshee/native dependencies
-       BANSHEE_CHECK_GSTREAMER
-fi
+dnl Default media backend, libbanshee/native dependencies
+BANSHEE_CHECK_GSTREAMER
 
 dnl User help
 SHAMROCK_CHECK_GNOME_DOC_UTILS(0.17.3)
@@ -338,7 +340,8 @@ ${PACKAGE}-${VERSION}
     Mono Runtime:          ${MONO}
     Gtk#:                  ${gtk_sharp_version}
 
-  Video/Graphics:
+  Media/Graphics:
+    GStreamer C backend:   ${enable_gst_native}
     Clutter:               ${enable_clutter}
 
   Operating System/Desktop Environment:
diff --git a/src/Backends/Banshee.GStreamer/Makefile.am b/src/Backends/Banshee.GStreamer/Makefile.am
index 6c44757..40b28aa 100644
--- a/src/Backends/Banshee.GStreamer/Makefile.am
+++ b/src/Backends/Banshee.GStreamer/Makefile.am
@@ -14,7 +14,11 @@ SOURCES =  \
 RESOURCES = Banshee.GStreamer.addin.xml
 INSTALL_DIR = $(BACKENDS_INSTALL_DIR)
 
+if ENABLE_GST_NATIVE
 include $(top_srcdir)/build/build.mk
+module_SCRIPTS += Banshee.GStreamer.dll.config
+else
+include $(top_srcdir)/build/build.dist.mk
+endif
 
 EXTRA_DIST += Banshee.GStreamer.dll.config
-module_SCRIPTS += Banshee.GStreamer.dll.config
diff --git a/src/Backends/Banshee.GStreamer/libbanshee/Makefile.am 
b/src/Backends/Banshee.GStreamer/libbanshee/Makefile.am
index a05c492..7719b87 100644
--- a/src/Backends/Banshee.GStreamer/libbanshee/Makefile.am
+++ b/src/Backends/Banshee.GStreamer/libbanshee/Makefile.am
@@ -7,7 +7,12 @@ INCLUDES = \
        $(GST_CFLAGS) 
 
 bansheelibdir = $(pkglibdir)
-bansheelib_LTLIBRARIES = libbanshee.la
+
+bansheelib_LTLIBRARIES = 
+if ENABLE_GST_NATIVE
+bansheelib_LTLIBRARIES += libbanshee.la
+all: $(top_builddir)/bin/libbanshee.so
+endif
 
 libbanshee_la_LDFLAGS = -avoid-version -module
 libbanshee_la_SOURCES =  \
@@ -54,8 +59,6 @@ libbanshee_la_LIBADD = \
        $(LIBBANSHEE_LIBS) \
        $(GST_LIBS)
 
-all: $(top_builddir)/bin/libbanshee.so
-
 $(top_builddir)/bin/libbanshee.so: libbanshee.la
        mkdir -p $(top_builddir)/bin
        cp -f .libs/libbanshee.so $@
diff --git a/src/Backends/Banshee.GStreamerSharp/Makefile.am b/src/Backends/Banshee.GStreamerSharp/Makefile.am
index a884bbe..507d814 100644
--- a/src/Backends/Banshee.GStreamerSharp/Makefile.am
+++ b/src/Backends/Banshee.GStreamerSharp/Makefile.am
@@ -15,7 +15,11 @@ SOURCES =  \
 
 RESOURCES = Banshee.GStreamerSharp.addin.xml
 
+if ENABLE_GST_SHARP
 include $(top_srcdir)/build/build.mk
-EXTRA_DIST += Banshee.GStreamerSharp.dll.config
 module_SCRIPTS += Banshee.GStreamerSharp.dll.config
+else
+include $(top_srcdir)/build/build.dist.mk
+endif
 
+EXTRA_DIST += Banshee.GStreamerSharp.dll.config
diff --git a/src/Backends/Makefile.am b/src/Backends/Makefile.am
index 13d6130..eecf2c3 100644
--- a/src/Backends/Makefile.am
+++ b/src/Backends/Makefile.am
@@ -1,7 +1,8 @@
 SUBDIRS = \
        Banshee.Gio \
        Banshee.Gnome \
-       $(PLAYBACK_BACKEND) \
+       Banshee.GStreamer \
+       Banshee.GStreamerSharp \
        Banshee.Unix \
        Banshee.Osx \
        Banshee.Windows


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