[gstreamermm] Check for the existence of plug-ins in the configure stage.



commit c9d9b1464cd6a02d91e5f0d96f742a46036f41d2
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Wed Sep 30 01:50:34 2009 -0400

    	Check for the existence of plug-ins in the configure stage.
    
    	* configure.ac:
    	* gstreamer/src/Makefile.am:
    	* gstreamer/src/filelist.am: Move the check for the existence of
    	plug-ins from the build stage to the configure stage as originally
    	suggest in the clean up commit by Daniel.  I had been completing that
    	but could not check it in soon enough before the other commits.

 ChangeLog                 |   11 +++++
 configure.ac              |  105 +++++++++++++++++++++++++++++++++++++++++++++
 gstreamer/src/Makefile.am |   12 +-----
 gstreamer/src/filelist.am |   66 ----------------------------
 4 files changed, 117 insertions(+), 77 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 173af7e..64fc924 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-09-30  José Alburquerque  <jaalburqu svn gnome org>
+
+	Check for the existence of plug-ins in the configure stage.
+
+	* configure.ac:
+	* gstreamer/src/Makefile.am:
+	* gstreamer/src/filelist.am: Move the check for the existence of
+	plug-ins from the build stage to the configure stage as originally
+	suggest in the clean up commit by Daniel.  I had been completing that
+	but could not check it in soon enough before the other commits.
+
 2009-09-29  Daniel Elstner  <daniel kitta gmail com>
 
 	Move plugin definition map into src/filelist.am
diff --git a/configure.ac b/configure.ac
index 349b80f..805a5d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,111 @@ MM_ARG_ENABLE_WARNINGS([GSTREAMERMM_WXXFLAGS],
                        [-Wall], [-Wall -Wextra],
                        [G GSTREAMER])
 
+#########################################################################
+#  Plug-in processing
+#########################################################################
+
+# Check for programs used to verify that the plug-ins exist in maintainer
+# mode:
+if test "x$USE_MAINTAINER_MODE" != "xno"; then
+  AC_CHECK_PROG([GST_INSPECT], [gst-inspect], [gst-inspect])
+  AC_CHECK_PROG([HEAD], [head], [head])
+  AC_CHECK_PROG([CUT], [cut], [cut])
+  AC_PROG_GREP
+fi
+
+# To add a plugin, add the plugin definition, in the form of
+# "plugin=CppClassName" to the space-separated list of definitions below.
+# (Where "plugin" is the plugin name as recognized by gst-inspect and
+# "CppClassName" is the desired name of the C++ class.)
+#
+# Also add the target .hg file name to the plugins_hg variable in the
+# gstreamer/src/fileslist.am.  (That must be the same as "CppClassName" - all
+# in lowercase with a .hg extension).  Make sure that the order of both lists
+# correspond.
+
+# TODO: Include appsink and appsrc plug-ins in list below if they indeed are
+# plug-ins (see gst-plugins-base docs for details) and when they don't cause
+# gstreamermm initialization errors.
+
+GSTREAMERMM_PLUGIN_DEFS="                       \
+	adder=Adder				\
+	alsamixer=AlsaMixer			\
+	alsasink=AlsaSink			\
+	alsasrc=AlsaSrc				\
+	audioconvert=AudioConvert		\
+	audioresample=AudioResample		\
+	audiotestsrc=AudioTestSrc		\
+	capsfilter=CapsFilter			\
+	cdparanoiasrc=CdParanoiaSrc		\
+	clockoverlay=ClockOverlay		\
+	decodebin2=DecodeBin2			\
+	decodebin=DecodeBin			\
+	fakesink=FakeSink			\
+	fakesrc=FakeSrc				\
+	fdsink=FdSink				\
+	fdsrc=FdSrc				\
+	ffmpegcolorspace=FfmpegColorSpace	\
+	filesink=FileSink			\
+	filesrc=FileSrc				\
+	gdpdepay=GDPDepay			\
+	gdppay=GDPPay				\
+	giosink=GioSink				\
+	giosrc=GioSrc				\
+	giostreamsink=GioStreamSink		\
+	giostreamsrc=GioStreamSrc		\
+	identity=Identity			\
+	multifdsink=MultiFdSink			\
+	multiqueue=MultiQueue			\
+	oggdemux=OggDemux			\
+	oggmux=OggMux				\
+	playbin2=PlayBin2			\
+	playbin=PlayBin				\
+	queue=Queue				\
+	tcpclientsink=TCPClientSink		\
+	tcpclientsrc=TCPClientSrc		\
+	tcpserversink=TcpServerSink		\
+	tcpserversrc=TCPServerSrc		\
+	tee=Tee					\
+	textoverlay=TextOverlay			\
+	textrender=TextRender			\
+	theoradec=TheoraDec			\
+	theoraenc=TheoraEnc			\
+	theoraparse=TheoraParse			\
+	timeoverlay=TimeOverlay			\
+	typefind=TypeFindElement		\
+	uridecodebin=UriDecodeBin		\
+	videorate=VideoRate			\
+	videoscale=VideoScale			\
+	videotestsrc=VideoTestSrc		\
+	volume=Volume				\
+	vorbisdec=VorbisDec			\
+	vorbisenc=VorbisEnc			\
+	vorbisparse=VorbisParse			\
+	vorbistag=VorbisTag			\
+	ximagesink=XImageSink			\
+	xvimagesink=XvImageSink                 \
+"
+
+# Check for the existence of plug-ins in maintainer mode:
+if test "x$USE_MAINTAINER_MODE" != "xno"; then
+  # Go through all the "plug-in defs", extracting the plug-in name.  Ensure
+  # that the plug-ins exist.  If they don't report it:
+  for plugin_def in $GSTREAMERMM_PLUGIN_DEFS; do
+    plugin_name=[`echo $plugin_def | $CUT -d'=' -f 1`]
+    if test -n "`$GST_INSPECT $plugin_name | $HEAD -1 | $GREP 'No such element'`"; then
+    AC_MSG_ERROR([The gstreamer plug-in '$plugin_name' does not exist. \
+If you built gst-plugins-base from source code then you might need to \
+install the appropriate -dev or -devel packages or enable experimental \
+plugins before rebuilding gst-plugins-base.])
+    fi;
+  done
+fi
+
+AC_SUBST([GSTREAMERMM_PLUGIN_DEFS])
+
+#########################################################################
+
 AC_CONFIG_FILES([Makefile
                  tools/Makefile
                  gstreamer/${GSTREAMERMM_MODULE_NAME}.pc:gstreamer/gstreamermm.pc.in
diff --git a/gstreamer/src/Makefile.am b/gstreamer/src/Makefile.am
index 0f96c35..360c4dd 100644
--- a/gstreamer/src/Makefile.am
+++ b/gstreamer/src/Makefile.am
@@ -34,7 +34,7 @@ generate_plugin_dependencies = \
 generate_gst_wrap_init = $(top_srcdir)/tools/generate_gst_wrap_init.pl
 
 target_plugin     = $(patsubst %element,%,$(basename $(notdir $@)))
-target_plugin_def = $(subst =, ,$(filter $(target_plugin)=%,$(plugin_type_map)))
+target_plugin_def = $(subst =, ,$(filter $(target_plugin)=%,$(GSTREAMERMM_PLUGIN_DEFS)))
 
 $(binding_outputdir)/gst_wrap_init.cc: $(generate_gst_wrap_init) $(binding_relfiles_hg)
 	$(AM_V_GEN)$(PERL) -- $(generate_gst_wrap_init) $(wrap_init_flags) \
@@ -43,18 +43,8 @@ $(binding_outputdir)/gst_wrap_init.cc: $(generate_gst_wrap_init) $(binding_relfi
 # This is to generate plugin .ccg files.  The generated .ccg file is piped
 # through m4 using the macros in tools/m4/ctocpp_base.m4 which then produces
 # the final .ccg file.
-# TODO: The confirm-existence check should probably run at configure time.  Hm,
-# probably not possible as the required test program isn't available at that
-# point.  Also, even if this stays in the makefile, why the need for a separate
-# invocation of generate_plugin_gmmproc_file, when it could be done with just
-# one step?
 $(addprefix $(srcdir)/,$(plugins_ccg)): $(generate_plugin_dependencies)
 	@plugin='$(firstword $(target_plugin_def))'; \
-	 $(generate_plugin_gmmproc_file) --confirm-existence "$$plugin" || \
-	 (echo "The $$plugin gstreamer plugin is not installed. Aborting build."; \
-	  echo 'If you built gst-plugins-base from source code then you might need to'; \
-	  echo 'install the appropriate -dev or -devel packages or enable experimental'; \
-	  echo 'plugins before rebuilding gst-plugins-base.'; exit 1) >&2
 	$(AM_V_GEN)$(generate_plugin_gmmproc_file) --ccg $(target_plugin_def) \
 	 | $(M4) -I $(codegen_m4_srcdir) >$@
 
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index b2e8369..d8d4039 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -153,69 +153,3 @@ files_hg  =                     \
         $(plugins_hg)
 
 files_ccg = $(files_hg:.hg=.ccg)
-
-# To add a plugin, add the plugin definition, in the form of
-# "plugin=CppClassName" to the space-separated list of definitions below.
-# (Where "plugin" is the plugin name as recognized by gst-inspect and
-# "CppClassName" is the desired name of the C++ class.)
-#
-# TODO: Include appsink and appsrc plug-ins in list below if they indeed are
-# plug-ins (see gst-plugins-base docs for details) and when they don't cause
-# gstreamermm initialization errors.
-plugin_type_map =				\
-	adder=Adder				\
-	alsamixer=AlsaMixer			\
-	alsasink=AlsaSink			\
-	alsasrc=AlsaSrc				\
-	audioconvert=AudioConvert		\
-	audioresample=AudioResample		\
-	audiotestsrc=AudioTestSrc		\
-	capsfilter=CapsFilter			\
-	cdparanoiasrc=CdParanoiaSrc		\
-	clockoverlay=ClockOverlay		\
-	decodebin2=DecodeBin2			\
-	decodebin=DecodeBin			\
-	fakesink=FakeSink			\
-	fakesrc=FakeSrc				\
-	fdsink=FdSink				\
-	fdsrc=FdSrc				\
-	ffmpegcolorspace=FfmpegColorSpace	\
-	filesink=FileSink			\
-	filesrc=FileSrc				\
-	gdpdepay=GDPDepay			\
-	gdppay=GDPPay				\
-	giosink=GioSink				\
-	giosrc=GioSrc				\
-	giostreamsink=GioStreamSink		\
-	giostreamsrc=GioStreamSrc		\
-	identity=Identity			\
-	multifdsink=MultiFdSink			\
-	multiqueue=MultiQueue			\
-	oggdemux=OggDemux			\
-	oggmux=OggMux				\
-	playbin2=PlayBin2			\
-	playbin=PlayBin				\
-	queue=Queue				\
-	tcpclientsink=TCPClientSink		\
-	tcpclientsrc=TCPClientSrc		\
-	tcpserversink=TcpServerSink		\
-	tcpserversrc=TCPServerSrc		\
-	tee=Tee					\
-	textoverlay=TextOverlay			\
-	textrender=TextRender			\
-	theoradec=TheoraDec			\
-	theoraenc=TheoraEnc			\
-	theoraparse=TheoraParse			\
-	timeoverlay=TimeOverlay			\
-	typefind=TypeFindElement		\
-	uridecodebin=UriDecodeBin		\
-	videorate=VideoRate			\
-	videoscale=VideoScale			\
-	videotestsrc=VideoTestSrc		\
-	volume=Volume				\
-	vorbisdec=VorbisDec			\
-	vorbisenc=VorbisEnc			\
-	vorbisparse=VorbisParse			\
-	vorbistag=VorbisTag			\
-	ximagesink=XImageSink			\
-	xvimagesink=XvImageSink



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