[gstreamermm] Clean up and simplify build system customizations



commit 0a2a16d28b75e721914f63bf96030d113d42471d
Author: Daniel Elstner <danielk openismus com>
Date:   Fri Sep 25 11:50:06 2009 +0200

    Clean up and simplify build system customizations
    
    * configure.ac (PATCH): Properly quote the AS_IF() macro arguments.
    (GSTREAMERMM_MODULES): Use m4_foreach() to reduce repetition.
    (ENABLE_GUI_EXAMPLES): Define an Automake conditional for the purpose
    of excluding the GUI example programs from the build if gtkmm is not
    available.  Remove the --enable-examples configure option, and always
    build the GUI examples if gtkmm is available at build time.
    (AC_CONFIG_FILES): Generate examples/Makefile unconditionally.
    Remove tools/generate_gst_wrap_init.pl from the list of output files.
    (GSTREAMERMM_WXXFLAGS): Remove -pedantic flag since it is too strict
    for the gstreamer header files.
    (GTHREAD_CFLAGS): Remove substitution variable for the thread-safety
    compiler flags, as gstreamer itself depends on gthread and therefore
    already includes the necessary flags in the pkg-config output.
    (MM_ARG_WITH_TAGFILE_DOC): Remove reference to giomm-2.4.tag, which
    does not exist.  Add tag file references for cairomm and pangomm.
    Tentatively remove gtkmm-2.4.tag reference because gtkmm symbols are
    not actually used in the documentation.  The mere presence of the
    gtkmm tags already confuses Doxygen, causing it to link to gtkmm for
    symbols in the Gst namespace.
    * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): As a temporary workaround,
    disable fatal warnings during distcheck.
    (SUBDIRS): Always recurse into tools/ and examples/.
    * examples/Makefile.am (noinst_PROGRAMS): Make the inclusion of the
    GUI examples depend on the ENABLE_GUI_EXAMPLES Automake conditional.
    (AM_CPPFLAGS): Expand $(GUI_EXAMPLES_CFLAGS) if the GUI examples are
    enabled, or $(GSTREAMERMM_CFLAGS) if not.
    (LDADD): Link with $(GSTREAMERMM_LIBS) by default, and override the
    global LDADD for the GUI programs to use $(GUI_EXAMPLES_LIBS).
    * gstreamer/gstreamermm/Makefile.am: Completely kill the build rules
    for patching the generated source code on the fly.  The single source
    file this was applied to turns out to be fixable by other means.
    * gstreamer/src/Makefile.am: Significantly simplify the convoluted
    logic of the custom rules and expressions for generating the gmmproc
    input files for the gstreamer plugins.
    ($(binding_outputdir)/gst_wrap_init.cc): Build gst_wrap_init.cc from
    the src/ subdirectory like the other generated source files.
    * gstreamer/src/element.ccg
    (Gst::ElementInterfaced_WeakNotify_gstreamermm_callback): Remove
    unused parameter name to avoid a compiler warning.
    * gstreamer/src/filelist.am (files_hg): Combine variable assignments.
    * gstreamer/src/taglist.hg (Gst::TagList): Call the special gmmproc
    macro _CUSTOM_STRUCT_PROTOTYPE to suppress the output of a typedef
    for the C struct.  This removes the need to patch the generated file.
    * gstreamer/gstreamermm/taglist.h.patch: Delete obsolete file.
    * tests/Makefile.am: Do not hard-code the libgstreamermm API version.
    (AM_CXXFLAGS): Build tests with $(GSTREAMERMM_WXXFLAGS), too.
    * tools/Makefile.am: Clean up and simplify.
    * tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: Add missing
    struct initializers to avoid a compiler warning.
    * tools/generate_gst_wrap_init.pl: Rename the configure input file
    generate_gst_wrap_init.pl.in to generate_gst_wrap_init.pl.  Remove
    the unnecessary she-bang line with the @PERL@ substitution, so that
    it is no longer necessary for this file to be generated.

 .gitignore                                         |    5 +-
 ChangeLog                                          |   58 +++++++++++++
 Makefile.am                                        |   10 +-
 configure.ac                                       |   75 ++++-------------
 examples/Makefile.am                               |   37 +++++----
 gstreamer/.gitignore                               |    6 --
 gstreamer/gstreamermm/Makefile.am                  |   32 +-------
 gstreamer/gstreamermm/private/.gitignore           |    4 +-
 gstreamer/gstreamermm/taglist.h.patch              |   14 ---
 gstreamer/src/Makefile.am                          |   88 ++++++++-----------
 gstreamer/src/element.ccg                          |    4 +-
 gstreamer/src/filelist.am                          |    5 +-
 gstreamer/src/taglist.hg                           |    5 +-
 tests/Makefile.am                                  |   41 ++++++---
 tools/Makefile.am                                  |   46 +++++-----
 .../extra_defs_gen/generate_plugin_gmmproc_file.cc |    2 +-
 ...t_wrap_init.pl.in => generate_gst_wrap_init.pl} |   16 ++--
 17 files changed, 208 insertions(+), 240 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 00cbd83..e07a714 100644
--- a/.gitignore
+++ b/.gitignore
@@ -192,13 +192,14 @@ gstreamer/gstreamermm/ringbuffer.h
 gstreamer/gstreamermm/ringbuffer.cc
 gstreamer/gstreamermm/segment.cc
 gstreamer/gstreamermm/segment.h
+gstreamer/gstreamermm/streamvolume.cc
+gstreamer/gstreamermm/streamvolume.h
 gstreamer/gstreamermm/structure.cc
 gstreamer/gstreamermm/structure.h
 gstreamer/gstreamermm/systemclock.cc
 gstreamer/gstreamermm/systemclock.h
 gstreamer/gstreamermm/taglist.cc
 gstreamer/gstreamermm/taglist.h
-gstreamer/gstreamermm/taglist.h.orig
 gstreamer/gstreamermm/tagsetter.cc
 gstreamer/gstreamermm/tagsetter.h
 gstreamer/gstreamermm/task.cc
@@ -274,6 +275,7 @@ gstreamer/gstreamermm/xoverlay.cc
 gstreamer/gstreamermm/xoverlay.h
 gstreamer/gstreamermm/xvimagesink.cc
 gstreamer/gstreamermm/xvimagesink.h
+gstreamer/gstreamermm-*.pc
 gstreamer/gstreamermmconfig.h
 
 # Generated plug-in .hg and .ccg files (not included in commits).
@@ -424,4 +426,3 @@ tests/test-tagsetter
 # tools/
 /tools/extra_defs_gen/generate_defs_gst
 /tools/extra_defs_gen/generate_plugin_gmmproc_file
-/tools/generate_gst_wrap_init.pl
diff --git a/ChangeLog b/ChangeLog
index cf96ef5..8bd8a09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+2009-09-29  Daniel Elstner  <danielk openismus com>
+
+	Clean up and simplify build system customizations
+
+	* configure.ac (PATCH): Properly quote the AS_IF() macro arguments.
+	(GSTREAMERMM_MODULES): Use m4_foreach() to reduce repetition.
+	(ENABLE_GUI_EXAMPLES): Define an Automake conditional for the purpose
+	of excluding the GUI example programs from the build if gtkmm is not
+	available.  Remove the --enable-examples configure option, and always
+	build the GUI examples if gtkmm is available at build time.
+	(AC_CONFIG_FILES): Generate examples/Makefile unconditionally.
+	Remove tools/generate_gst_wrap_init.pl from the list of output files.
+	(GSTREAMERMM_WXXFLAGS): Remove -pedantic flag since it is too strict
+	for the gstreamer header files.
+	(GTHREAD_CFLAGS): Remove substitution variable for the thread-safety
+	compiler flags, as gstreamer itself depends on gthread and therefore
+	already includes the necessary flags in the pkg-config output.
+	(MM_ARG_WITH_TAGFILE_DOC): Remove reference to giomm-2.4.tag, which
+	does not exist.  Add tag file references for cairomm and pangomm.
+	Tentatively remove gtkmm-2.4.tag reference because gtkmm symbols are
+	not actually used in the documentation.  The mere presence of the
+	gtkmm tags already confuses Doxygen, causing it to link to gtkmm for
+	symbols in the Gst namespace.
+	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): As a temporary workaround,
+	disable fatal warnings during distcheck.
+	(SUBDIRS): Always recurse into tools/ and examples/.
+	* examples/Makefile.am (noinst_PROGRAMS): Make the inclusion of the
+	GUI examples depend on the ENABLE_GUI_EXAMPLES Automake conditional.
+	(AM_CPPFLAGS): Expand $(GUI_EXAMPLES_CFLAGS) if the GUI examples are
+	enabled, or $(GSTREAMERMM_CFLAGS) if not.
+	(LDADD): Link with $(GSTREAMERMM_LIBS) by default, and override the
+	global LDADD for the GUI programs to use $(GUI_EXAMPLES_LIBS).
+	* gstreamer/gstreamermm/Makefile.am: Completely kill the build rules
+	for patching the generated source code on the fly.  The single source
+	file this was applied to turns out to be fixable by other means.
+	* gstreamer/src/Makefile.am: Significantly simplify the convoluted
+	logic of the custom rules and expressions for generating the gmmproc
+	input files for the gstreamer plugins.
+	($(binding_outputdir)/gst_wrap_init.cc): Build gst_wrap_init.cc from
+	the src/ subdirectory like the other generated source files.
+	* gstreamer/src/element.ccg
+	(Gst::ElementInterfaced_WeakNotify_gstreamermm_callback): Remove
+	unused parameter name to avoid a compiler warning.
+	* gstreamer/src/filelist.am (files_hg): Combine variable assignments.
+	* gstreamer/src/taglist.hg (Gst::TagList): Call the special gmmproc
+	macro _CUSTOM_STRUCT_PROTOTYPE to suppress the output of a typedef
+	for the C struct.  This removes the need to patch the generated file.
+	* gstreamer/gstreamermm/taglist.h.patch: Delete obsolete file.
+	* tests/Makefile.am: Do not hard-code the libgstreamermm API version.
+	(AM_CXXFLAGS): Build tests with $(GSTREAMERMM_WXXFLAGS), too.
+	* tools/Makefile.am: Clean up and simplify.
+	* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: Add missing
+	struct initializers to avoid a compiler warning.
+	* tools/generate_gst_wrap_init.pl: Rename the configure input file
+	generate_gst_wrap_init.pl.in to generate_gst_wrap_init.pl.  Remove
+	the unnecessary she-bang line with the @PERL@ substitution, so that
+	it is no longer necessary for this file to be generated.
+
 2009-09-25  José Alburquerque  <jaalburqu svn gnome org>
 
 	Add Gst::StreamVolume interface.
diff --git a/Makefile.am b/Makefile.am
index 5f8c39f..c48cfe3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,20 +14,20 @@
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}
-DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=fatal
+# TODO: Fix warnings and switch back to fatal warnings mode.
+DISTCHECK_CONFIGURE_FLAGS = --enable-warnings=max
 
 if MAINTAINER_MODE
-src_subdirs = tools gstreamer/src
+src_subdirs = gstreamer/src
 else
-src_subdirs = tools
+src_subdirs =
 endif
 if ENABLE_DOCUMENTATION
 doc_subdirs = docs
 else
 doc_subdirs =
 endif
-SUBDIRS = $(src_subdirs) gstreamer/gstreamermm tests @EXAMPLE_SUBDIR@ \
-	  $(doc_subdirs)
+SUBDIRS = tools $(src_subdirs) gstreamer/gstreamermm tests examples $(doc_subdirs)
 
 gstreamermm_includedir = $(includedir)/$(GSTREAMERMM_MODULE_NAME)
 gstreamermm_include_HEADERS = gstreamer/gstreamermm.h
diff --git a/configure.ac b/configure.ac
index 6eef403..dfe6e0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,85 +41,42 @@ AC_PROG_LIBTOOL
 
 # Check for the patch command in maintainer mode for patching generated .hg
 # files like taglist.hg.
-AS_IF([test "x$USE_MAINTAINER_MODE" != xno], AC_CHECK_PROGS([PATCH], [patch], [patch]))
-
+AS_IF([test "x$USE_MAINTAINER_MODE" != xno], [AC_CHECK_PROGS([PATCH], [patch], [patch])])
 
 # Check for m4 and sed which are used for plug-in .hg and .ccg file generation.
 AC_CHECK_PROGS([M4], [gm4 m4], [m4])
 AC_PROG_SED
 
-min_glibmm_version='2.21.1'
-min_gtkmm_version='2.12.0'
-min_gstreamer_version='0.10.24'
-min_libxmlpp_version='2.14.0'
-
 # The format below is used so that the requirements appear nicely in the .pc
 # file.
 AC_SUBST([GSTREAMERMM_MODULES],
-         ["\
-glibmm-2.4 >= $min_glibmm_version \
-giomm-2.4 >= $min_glibmm_version \
-libxml++-2.6 >= $min_libxmlpp_version \
-gstreamer-0.10 >= $min_gstreamer_version \
-gstreamer-base-0.10 >= $min_gstreamer_version \
-gstreamer-controller-0.10 >= $min_gstreamer_version \
-gstreamer-dataprotocol-0.10 >= $min_gstreamer_version \
-gstreamer-net-0.10 >= $min_gstreamer_version \
-gstreamer-plugins-base-0.10 >= $min_gstreamer_version \
-gstreamer-audio-0.10 >= $min_gstreamer_version \
-gstreamer-cdda-0.10 >= $min_gstreamer_version \
-gstreamer-interfaces-0.10 >= $min_gstreamer_version \
-gstreamer-netbuffer-0.10 >= $min_gstreamer_version \
-gstreamer-rtp-0.10 >= $min_gstreamer_version \
-gstreamer-video-0.10 >= $min_gstreamer_version"
-])
-
+         ['giomm-2.4 >= 2.21.1 libxml++-2.6 >= 2.14[]m4_foreach([gstmm_mod],
+         [[], [-base], [-controller], [-dataprotocol], [-net], [-plugins-base],
+              [-audio], [-cdda], [-interfaces], [-netbuffer], [-rtp], [-video]],
+         [ gstreamer[]m4_defn([gstmm_mod])[]-0.10 >= 0.10.24])'])
 PKG_CHECK_MODULES([GSTREAMERMM], [$GSTREAMERMM_MODULES])
 
-MM_PKG_CONFIG_SUBST([GTHREAD_CFLAGS], [--cflags-only-other gthread-2.0])
+PKG_CHECK_MODULES([GUI_EXAMPLES], [$GSTREAMERMM_MODULES gtkmm-2.4 >= 2.12],
+                  [gstreamermm_enable_gui_examples=yes], [gstreamermm_enable_gui_examples=no])
+AS_IF([test "x$gstreamermm_enable_gui_examples" != xyes],
+      [AC_MSG_WARN([gtkmm not available: GUI examples will not be built.])])
+AM_CONDITIONAL([ENABLE_GUI_EXAMPLES], [test "x$gstreamermm_enable_gui_examples" = xyes])
+
 MM_PKG_CONFIG_SUBST([GMMPROC_DIR], [--variable=gmmprocdir glibmm-2.4])
 
 MM_ARG_ENABLE_DOCUMENTATION
 MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
 MM_ARG_WITH_TAGFILE_DOC([libsigc++-2.0.tag], [sigc++-2.0])
 MM_ARG_WITH_TAGFILE_DOC([glibmm-2.4.tag], [glibmm-2.4])
-MM_ARG_WITH_TAGFILE_DOC([giomm-2.4.tag], [giomm-2.4])
+MM_ARG_WITH_TAGFILE_DOC([cairomm-1.0.tag], [cairomm-1.0])
+MM_ARG_WITH_TAGFILE_DOC([pangomm-1.4.tag], [pangomm-1.4])
 
 AC_LANG([C++])
 MM_ARG_ENABLE_WARNINGS([GSTREAMERMM_WXXFLAGS],
-                       [-Wall],
-                       [-pedantic -Wall -Wextra],
+                       [-Wall], [-Wall -Wextra],
                        [G GSTREAMER])
 
 #########################################################################
-#  Examples
-#########################################################################
-
-AC_ARG_ENABLE(examples,
-  [AC_HELP_STRING([--enable-examples],
-    [enable compilation of example programs [default=yes]])],
-  [enable_examples=$enableval], [enable_examples=yes])
-
-if test "x$enable_examples" = "xyes"; then
-
-# Extra dependencies needed for the examples. Use --enable-examples=no to build
-# the library without this.
-PKG_CHECK_MODULES(GSTREAMERMM_EXAMPLES, gtkmm-2.4 >= ${min_gtkmm_version})
-AC_SUBST(GSTREAMERMM_EXAMPLES_CFLAGS)
-AC_SUBST(GSTREAMERMM_EXAMPLES_LIBS)
-
-MM_ARG_WITH_TAGFILE_DOC([gtkmm-2.4.tag], [gtkmm-2.4])
-
-EXAMPLE_SUBDIR="examples"
-AC_CONFIG_FILES([
-    examples/Makefile
-    ])
-AC_SUBST(EXAMPLE_SUBDIR)
-else
-EXAMPLE_SUBDIR=""
-fi
-
-#########################################################################
 #  Plug-in definitions
 #########################################################################
 
@@ -195,17 +152,17 @@ ximagesink=XImageSink \
 xvimagesink=XvImageSink \
 "
 
-AC_SUBST(GSTREAMERMM_PLUGIN_DEFS)
+AC_SUBST([GSTREAMERMM_PLUGIN_DEFS])
 
 #########################################################################
 
 AC_CONFIG_FILES([Makefile
                  tools/Makefile
-                 tools/generate_gst_wrap_init.pl
                  gstreamer/${GSTREAMERMM_MODULE_NAME}.pc:gstreamer/gstreamermm.pc.in
                  gstreamer/${GSTREAMERMM_MODULE_NAME}-uninstalled.pc:gstreamer/gstreamermm-uninstalled.pc.in
                  gstreamer/src/Makefile
                  gstreamer/gstreamermm/Makefile
+                 examples/Makefile
                  tests/Makefile
                  docs/Makefile
                  docs/reference/Doxyfile])
diff --git a/examples/Makefile.am b/examples/Makefile.am
index de78b05..70daff6 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -15,34 +15,37 @@
 
 AUTOMAKE_OPTIONS = subdir-objects
 
+if ENABLE_GUI_EXAMPLES
+optional_examples = media_player_gtkmm/example ogg_player_gtkmm/example
+examples_cppflags = $(GUI_EXAMPLES_CFLAGS)
+else
+optional_examples =
+examples_cppflags = $(GSTREAMERMM_CFLAGS)
+endif
+
 noinst_PROGRAMS =			\
 	element_link/example		\
-	media_player_gtkmm/example	\
 	ogg_player/example		\
-	ogg_player_gtkmm/example	\
 	optiongroup/example		\
-	typefind/example
-
-gstreamermm_includes = -I$(top_builddir)/gstreamer \
-		      $(if $(srcdir:.=),-I$(top_srcdir)/gstreamer) \
-		      $(GSTREAMERMM_EXAMPLES_CFLAGS) $(GSTREAMERMM_CFLAGS)
-local_cppflags       = -I$(top_builddir) $(gstreamermm_includes)
-
-AM_CPPFLAGS          = $(local_cppflags) $(GTHREAD_CFLAGS)
-AM_CXXFLAGS          = $(GSTREAMERMM_WXXFLAGS)
+	typefind/example		\
+	$(optional_examples)
 
+gstreamermm_includes = -I$(top_builddir)/gstreamer $(if $(srcdir:.=),-I$(top_srcdir)/gstreamer)
 local_libgstreamermm = $(top_builddir)/gstreamer/gstreamermm/libgstreamermm-$(GSTREAMERMM_API_VERSION).la
 
-LDADD                = $(GSTREAMERMM_EXAMPLES_LIBS) $(GSTREAMERMM_LIBS) \
-		       $(local_libgstreamermm)
+AM_CPPFLAGS = -I$(top_builddir) $(gstreamermm_includes) $(examples_cppflags)
+AM_CXXFLAGS = $(GSTREAMERMM_WXXFLAGS)
+LDADD = $(GSTREAMERMM_LIBS) $(local_libgstreamermm)
 
 element_link_example_SOURCES 		= element_link/element_link.cc
 media_player_gtkmm_example_SOURCES 	= media_player_gtkmm/main.cc \
-				  	  media_player_gtkmm/player_window.cc \
-				  	  media_player_gtkmm/player_window.h
+					  media_player_gtkmm/player_window.cc \
+					  media_player_gtkmm/player_window.h
+media_player_gtkmm_example_LDADD 	= $(GUI_EXAMPLES_LIBS) $(local_libgstreamermm)
 ogg_player_example_SOURCES		= ogg_player/main.cc
 ogg_player_gtkmm_example_SOURCES	= ogg_player_gtkmm/main.cc \
-				  	  ogg_player_gtkmm/player_window.cc \
-				  	  ogg_player_gtkmm/player_window.h
+					  ogg_player_gtkmm/player_window.cc \
+					  ogg_player_gtkmm/player_window.h
+ogg_player_gtkmm_example_LDADD		= $(GUI_EXAMPLES_LIBS) $(local_libgstreamermm)
 optiongroup_example_SOURCES		= optiongroup/main.cc
 typefind_example_SOURCES		= typefind/main.cc
diff --git a/gstreamer/gstreamermm/Makefile.am b/gstreamer/gstreamermm/Makefile.am
index af6c4ea..fc11c86 100644
--- a/gstreamer/gstreamermm/Makefile.am
+++ b/gstreamer/gstreamermm/Makefile.am
@@ -19,39 +19,9 @@ include $(srcdir)/../src/filelist.am
 include $(srcdir)/filelist.am
 include $(top_srcdir)/build/compile-binding.am
 
-stampdir = $(srcdir)/.stamps
-patched_stamps = $(patched_hg:%.hg=$(stampdir)/stamp-%)
-
-generate_gst_wrap_init_in = $(top_builddir)/tools/generate_gst_wrap_init.pl.in
-generate_gst_wrap_init = $(PERL) -- $(top_builddir)/tools/generate_gst_wrap_init.pl
-generate_gst_wrap_init_flags = --namespace=Gst --parent_dir=gstreamermm
-
-gst_wrap_init.cc: $(generate_gst_wrap_init_in) $(files_hg:%=$(srcdir)/../src/%)
-	$(AM_V_GEN)$(generate_gst_wrap_init) $(generate_gst_wrap_init_flags) \
-		$(files_hg:%=$(srcdir)/../src/%) > $@
-
-$(stampdir):
-	@(test -d $(stampdir) || $(MKDIR_P) $(stampdir))
-	
-# This is to patch generated .h files in $(gensrc_destdir) (e.g. taglist.h).
-$(stampdir)/stamp-%: $(stampdir) $(srcdir)/%.h
-	$(PATCH) -Ns $(srcdir)/$*.h $(srcdir)/$*.h.patch || true
-	rm -f $(srcdir)/$*.h.rej $(srcdir)/$*.h.orig
-	@echo 'timestamp' > $@
-
-# Patch the generated .hg files that need to be patched but only in maintainer
-# mode
-if MAINTAINER_MODE
-BUILT_SOURCES = $(patched_stamps)
-endif
-
-# Distribute the patch files for the generated .hg files that need to be
-# patched.
-EXTRA_DIST = $(patched_hg:%.hg=%.h.patch)
-
 local_cppflags = $(binding_includes) $(binding_cppflags) -DGSTREAMERMM_BUILD=1
 
-AM_CPPFLAGS = $(local_cppflags) $(GTHREAD_CFLAGS) $(GSTREAMERMM_CFLAGS)
+AM_CPPFLAGS = $(local_cppflags) $(GSTREAMERMM_CFLAGS)
 AM_CXXFLAGS = $(GSTREAMERMM_WXXFLAGS)
 
 libgstreamermm_ GSTREAMERMM_API_VERSION@_la_SOURCES = $(binding_sources)
diff --git a/gstreamer/gstreamermm/private/.gitignore b/gstreamer/gstreamermm/private/.gitignore
index 51ad2f7..4294d85 100644
--- a/gstreamer/gstreamermm/private/.gitignore
+++ b/gstreamer/gstreamermm/private/.gitignore
@@ -1,2 +1,2 @@
-*_p.h
-!miniobject_p.h
+/*_p.h
+!/miniobject_p.h
diff --git a/gstreamer/src/Makefile.am b/gstreamer/src/Makefile.am
index 565cf0b..a6f1ad9 100644
--- a/gstreamer/src/Makefile.am
+++ b/gstreamer/src/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright 2009 The gstreamermm Development Team
+## Copyright 2009 The gstreamermm Development Team
 ##
 ## This library is free software: you can redistribute it and/or modify it
 ## under the terms of the GNU Lesser General Public License as published
@@ -13,67 +13,53 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-binding_name     = gstreamermm
-wrap_init_flags  = --namespace=Gst --parent_dir=gstreamermm
-codegen_srcdir   = $(top_srcdir)/tools
-extradefs_srcdir = $(codegen_srcdir)/extra_defs_gen
-m4_srcdir  	 = $(codegen_srcdir)/m4
-
-# The generate_plugin_gmmproc_file utility
-generate_plugin_gmmproc_file_source = $(extradefs_srcdir)/generate_plugin_gmmproc_file.cc
-generate_plugin_gmmproc_file_path = $(extradefs_srcdir)/generate_plugin_gmmproc_file
-generate_plugin_gmmproc_file_args = --namespace=Gst --main-defs=gst --target=gstreamermm
-run_generate_plugin_gmmproc_file = $(generate_plugin_gmmproc_file_path) $(generate_plugin_gmmproc_file_args)
+binding_name    = gstreamermm
+wrap_init_flags = --namespace=Gst --parent_dir=gstreamermm
+codegen_srcdir  = $(top_srcdir)/tools
 
 include $(srcdir)/filelist.am
 include $(top_srcdir)/tools/m4/filelist.am
 include $(top_srcdir)/build/generate-binding.am
 
-if MAINTAINER_MODE
-generate_plugin_dep = $(generate_plugin_gmmproc_file_source)
-endif
+other_built_sources  += $(binding_outputdir)/gst_wrap_init.cc
+MAINTAINERCLEANFILES += $(addprefix $(srcdir)/,$(plugins_ccg) $(plugins_hg))
+
+generate_plugin_gmmproc_file = \
+	$(top_builddir)/tools/extra_defs_gen/generate_plugin_gmmproc_file$(EXEEXT) \
+	--namespace=Gst --main-defs=gst --target=gstreamermm
+generate_plugin_dependencies = \
+	$(codegen_srcdir)/extra_defs_gen/generate_plugin_gmmproc_file.cc \
+	$(addprefix $(codegen_m4_srcdir)/,$(files_plugin_m4))
+
+generate_gst_wrap_init = $(top_srcdir)/tools/generate_gst_wrap_init.pl
 
-# The source file from which the license header may be extracted and placed in
-# plug-in generated .hg and .ccg files (use a file that probably will not
-# change because it will be a plug-in generation dependency):
-license_header_source_file = $(srcdir)/../gstreamermm/version.h
+target_plugin     = $(patsubst %element,%,$(basename $(notdir $@)))
+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) \
+	 $(binding_relfiles_hg) >$@
 
 # 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.
-$(plugins_ccg): $(generate_plugin_dep) $(files_plugin_m4:%=$(m4_srcdir)/%) \
-	$(license_header_source_file)
-	$(eval list_delim = $$(patsubst $$@,+,$$(plugins_ccg)))
-	$(eval prev_mems = $$(shell echo "$$(list_delim)" | cut -d'+' -f 1))
-	$(eval pos = $$(shell expr `echo "$$(prev_mems)" | wc -w` + 1))
-	$(eval plugin_def = $$(word $$(pos),$$(GSTREAMERMM_PLUGIN_DEFS)))
-	$(eval plugin_name = $$(shell echo "$$(plugin_def)" | cut -d'=' -f 1))
-	$(eval cppname = $$(subst $$(plugin_name)=,,$$(plugin_def)))
-if MAINTAINER_MODE
-	@if $(run_generate_plugin_gmmproc_file) --confirm-existence \
-		$(plugin_name); then true; else \
-		echo "The $(plugin_name) gstreamer plugin is not installed.  Aborting build. If you built gst-plugins-base from source code then you might need to install the appropriate -dev or --devel packages or enable experimenal plugins before rebuilding gst-plugins-base."; \
-		false; \
-	fi
-endif
-	$(AM_V_at)$(SED) -n '1,/^$$/p' $(license_header_source_file) > \
-		$(srcdir)/$@
-	$(AM_V_GEN)$(run_generate_plugin_gmmproc_file) --ccg $(plugin_name) \
-		$(cppname) | $(M4) -I $(m4_srcdir) >> $(srcdir)/$@
+# TODO: The confirm-existence check should probably run at configure time.
+# 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) >$@
 
 # This is to generate plugin .hg files.  The generated .hg file is piped
 # through m4 using the macros in tools/m4/ctocpp_base.m4 which then produces
 # the final .hg file.
-$(plugins_hg): %.hg: $(generate_plugin_dep) \
-	$(files_plugin_m4:%=$(m4_srcdir)/%) $(license_header_source_file) %.ccg
-	$(eval list_delim = $$(patsubst $$@,+,$$(plugins_hg)))
-	$(eval prev_mems = $$(shell echo "$$(list_delim)" | cut -d'+' -f 1))
-	$(eval pos = $$(shell expr `echo "$$(prev_mems)" | wc -w` + 1))
-	$(eval plugin_def = $$(word $$(pos),$$(GSTREAMERMM_PLUGIN_DEFS)))
-	$(eval plugin_name = $$(shell echo "$$(plugin_def)" | cut -d'=' -f 1))
-	$(eval cppname = $$(subst $$(plugin_name)=,,$$(plugin_def)))
-	$(AM_V_at)$(SED) -n '1,/^$$/p' $(license_header_source_file) > $(srcdir)/$@
-	$(AM_V_GEN)$(run_generate_plugin_gmmproc_file) --hg $(plugin_name) \
-		$(cppname) | $(M4) -I $(m4_srcdir) >> $(srcdir)/$@
-
-MAINTAINERCLEANFILES += $(plugins_hg) $(plugins_ccg)
+$(addprefix $(srcdir)/,$(plugins_hg)): %.hg: %.ccg $(generate_plugin_dependencies)
+	$(AM_V_GEN)$(generate_plugin_gmmproc_file) --hg $(target_plugin_def) \
+	 | $(M4) -I $(codegen_m4_srcdir) >$@
diff --git a/gstreamer/src/element.ccg b/gstreamer/src/element.ccg
index 9478624..d93613a 100644
--- a/gstreamer/src/element.ccg
+++ b/gstreamer/src/element.ccg
@@ -41,9 +41,9 @@ _PINCLUDE(gstreamermm/private/object_p.h)
 namespace Gst
 {
 
-void ElementInterfaced_WeakNotify_gstreamermm_callback(void* data, GObject* where_the_object_was)
+void ElementInterfaced_WeakNotify_gstreamermm_callback(void* data, GObject*)
 {
-  delete (Gst::Element*) data;
+  delete static_cast<Gst::Element*>(data);
 }
 
 namespace Enums
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 3049458..f6eb5be 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -149,9 +149,8 @@ files_hg  =                     \
         videoorientation.hg     \
         videosink.hg            \
         xml.hg                  \
-        xoverlay.hg
-
-files_hg += $(plugins_hg)
+        xoverlay.hg             \
+        $(plugins_hg)
 
 files_ccg = $(files_hg:.hg=.ccg)
 
diff --git a/gstreamer/src/taglist.hg b/gstreamer/src/taglist.hg
index 22767d6..d607c04 100644
--- a/gstreamer/src/taglist.hg
+++ b/gstreamer/src/taglist.hg
@@ -241,7 +241,7 @@ TAG_LANGUAGE_CODE,
  */
 TAG_IMAGE,
 
-/** Image that is meant for preview purposes, e.g. small icon-sized version
+/** Image that is meant for preview purposes, e.g.\ small icon-sized version
  * (buffer) (buffer caps should specify the content type).
  * Since 0.10.7.
  */
@@ -301,6 +301,8 @@ TAG_GEO_LOCATION_ELEVATION
 std::ostream& operator<<(std::ostream& stream, Tag tag);
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
+// TODO: This should have been made const.
+// Why is this external at all?
 extern const char* _tag_strings[];
 #endif
 
@@ -322,6 +324,7 @@ extern const char* _tag_strings[];
  */
 class TagList : public Structure
 {
+  _CUSTOM_STRUCT_PROTOTYPE
   _CLASS_BOXEDTYPE_EXTRA(TagList, GstTagList, gst_tag_list_new, gst_tag_list_copy, gst_tag_list_free)
   _IGNORE(gst_tag_list_copy, gst_tag_list_free)
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 633ac64..b8d79ae 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,21 +1,36 @@
-INCLUDES	= -I$(top_builddir)/gstreamer -I$(top_srcdir)/gstreamer \
-		  @GSTREAMERMM_CFLAGS@
+## Copyright 2009 The gstreamermm Development Team
+##
+## This library is free software: you can redistribute it and/or modify it
+## under the terms of the GNU Lesser General Public License as published
+## by the Free Software Foundation, either version 2.1 of the License,
+## or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public License
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-LDADD 		= $(top_builddir)/gstreamer/gstreamermm/libgstreamermm-0.10.la \
-		  $(GSTREAMERMM_LIBS)
+gstreamermm_includes = -I$(top_builddir)/gstreamer $(if $(srcdir:.=),-I$(top_srcdir)/gstreamer)
+local_libgstreamermm = $(top_builddir)/gstreamer/gstreamermm/libgstreamermm-$(GSTREAMERMM_API_VERSION).la
 
+AM_CPPFLAGS = -I$(top_builddir) $(gstreamermm_includes) $(GSTREAMERMM_CFLAGS)
+AM_CXXFLAGS = $(GSTREAMERMM_WXXFLAGS)
+LDADD = $(GSTREAMERMM_LIBS) $(local_libgstreamermm)
 
-check_PROGRAMS  = test-caps test-create-element test-pipeline-add-element \
-                  test-link-elements test-create-bin test-miniobject-wrap \
-                  test-message-wrap test-event-wrap test-query-wrap \
-		  test-structure test-caps-structures test-interface \
-		  test-create-bus test-taglist test-tagsetter test-pad \
-		  test-ghost-pad test-init-check test-init \
-		  test-init-check-noargs test-init-noargs test-iterator \
-		  test-property-caps test-plugin-gen test-plugin-signals
+check_PROGRAMS = test-caps test-create-element test-pipeline-add-element \
+                 test-link-elements test-create-bin test-miniobject-wrap \
+                 test-message-wrap test-event-wrap test-query-wrap \
+                 test-structure test-caps-structures test-interface \
+                 test-create-bus test-taglist test-tagsetter test-pad \
+                 test-ghost-pad test-init-check test-init \
+                 test-init-check-noargs test-init-noargs test-iterator \
+                 test-property-caps test-plugin-gen test-plugin-signals
 
 # Include run of test programs in check:
-TESTS 		= $(check_PROGRAMS)
+TESTS = $(check_PROGRAMS)
 
 test_caps_SOURCES			= test-caps.cc
 test_create_element_SOURCES		= test-create-element.cc
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c05e697..142fc88 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -17,40 +17,40 @@ AUTOMAKE_OPTIONS = subdir-objects
 
 include $(srcdir)/m4/filelist.am
 
-lib_LTLIBRARIES	= extra_defs_gen/libgstreamermm_get_plugin_defs-0.10.la
-extra_defs_gen_libgstreamermm_get_plugin_defs_0_10_la_SOURCES = \
-			extra_defs_gen/get_plugin_defs.cc
-extra_defs_gen_libgstreamermm_get_plugin_defs_0_10_la_LIBADD = \
-			$(GSTREAMERMM_LIBS) -lglibmm_generate_extra_defs-2.4
+lib_LTLIBRARIES	= extra_defs_gen/libgstreamermm_get_plugin_defs- GSTREAMERMM_API_VERSION@.la
 
-defs_includedir   = $(includedir)/gstreamermm-0.10/gstreamermm_get_plugin_defs
+extra_defs_gen_libgstreamermm_get_plugin_defs_ GSTREAMERMM_API_VERSION@_la_SOURCES = \
+	extra_defs_gen/get_plugin_defs.cc
+extra_defs_gen_libgstreamermm_get_plugin_defs_ GSTREAMERMM_API_VERSION@_la_LIBADD = \
+	$(GSTREAMERMM_LIBS) -lglibmm_generate_extra_defs-2.4
+extra_defs_gen_libgstreamermm_get_plugin_defs_ GSTREAMERMM_API_VERSION@_la_LDFLAGS = \
+	-no-undefined -version-info $(GSTREAMERMM_SO_VERSION)
+
+defs_includedir = $(includedir)/$(GSTREAMERMM_MODULE_NAME)/gstreamermm_get_plugin_defs
 defs_include_HEADERS = extra_defs_gen/get_plugin_defs.h
-defs_ldflags 	  = $(no_undefined) -version-info $(LIBGSTREAMERMM_SO_VERSION)
 
 #TODO: Should these go into $(datadir)/$(PACKAGE_TARNAME)/ instead as in gtkmm?
 plugingen_bindir = $(libdir)/$(GSTREAMERMM_MODULE_NAME)/gen
 plugingen_m4dir  = $(plugingen_bindir)/m4
-dist_plugingen_m4_DATA = $(files_codegen_m4:%=m4/%) $(files_plugin_m4:%=m4/%)
-
-noinst_PROGRAMS = extra_defs_gen/generate_defs_gst
-
-extra_defs_gen_generate_defs_gst_SOURCES = extra_defs_gen/generate_defs_gst.cc
-extra_defs_gen_generate_defs_gst_LDADD   = $(GSTREAMERMM_LIBS) \
-			-lglibmm_generate_extra_defs-2.4 \
-			extra_defs_gen/libgstreamermm_get_plugin_defs-0.10.la
+dist_plugingen_m4_DATA = $(addprefix m4/,$(files_codegen_m4) $(files_plugin_m4))
 
 # Build and install the generate_plugin_gmmproc_file utility executable so that
 # other gstreamermm modules can also generate plug-ins.
+plugingen_bin_PROGRAMS = extra_defs_gen/generate_plugin_gmmproc_file
+
+noinst_PROGRAMS = extra_defs_gen/generate_defs_gst
+
+local_lib = extra_defs_gen/libgstreamermm_get_plugin_defs-$(GSTREAMERMM_API_VERSION).la
 
 extra_defs_gen_generate_plugin_gmmproc_file_SOURCES = \
-			extra_defs_gen/generate_plugin_gmmproc_file.cc
-extra_defs_gen_generate_plugin_gmmproc_file_LDADD = \
-			extra_defs_gen/libgstreamermm_get_plugin_defs-0.10.la
-extra_defs_gen_generate_plugin_gmmproc_file_PROGRAMS = \
-			extra_defs_gen/generate_plugin_gmmproc_file
-extra_defs_gen_generate_plugin_gmmproc_filedir = $(plugingen_bindir)
-
-AM_CPPFLAGS = -I$(top_builddir) $(GTHREAD_CFLAGS) $(GSTREAMERMM_CFLAGS)
+	extra_defs_gen/generate_plugin_gmmproc_file.cc
+extra_defs_gen_generate_plugin_gmmproc_file_LDADD = $(local_lib)
+
+extra_defs_gen_generate_defs_gst_SOURCES = extra_defs_gen/generate_defs_gst.cc
+extra_defs_gen_generate_defs_gst_LDADD = \
+	$(GSTREAMERMM_LIBS) -lglibmm_generate_extra_defs-2.4 $(local_lib)
+
+AM_CPPFLAGS = -I$(top_builddir) $(GSTREAMERMM_CFLAGS)
 AM_CXXFLAGS = $(GSTREAMERMM_WXXFLAGS)
 
 # Instruct GNU make to delete the targets of a rule after it failed, in
diff --git a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
index bd6a854..cbd0d82 100644
--- a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
+++ b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
@@ -680,7 +680,7 @@ int main(int argc, char* argv[])
     {"namespace", 'n', 0, G_OPTION_ARG_STRING, &nmspace, "The namespace of the plugin.", "namespace" },
     {"main-defs", 'm', 0, G_OPTION_ARG_STRING, &defsFile, "The main defs file without .defs extension.", "def" },
     {"target", 't', 0, G_OPTION_ARG_STRING, &target, "The .h and .cc target directory.", "directory" },
-    { 0 }
+    { 0, '\0', 0, G_OPTION_ARG_NONE, 0, 0, 0 }
   };
 
   GOptionContext* gContext =
diff --git a/tools/generate_gst_wrap_init.pl.in b/tools/generate_gst_wrap_init.pl
similarity index 99%
rename from tools/generate_gst_wrap_init.pl.in
rename to tools/generate_gst_wrap_init.pl
index 84219d7..870f0af 100644
--- a/tools/generate_gst_wrap_init.pl.in
+++ b/tools/generate_gst_wrap_init.pl
@@ -1,7 +1,4 @@
-#! @PERL@
-#
-# @configure_input@
-#
+package main;
 
 use strict;
 
@@ -162,7 +159,7 @@ foreach $i (sort keys %objects)
   {
     print "#ifndef G_OS_WIN32\n"
   }
-  
+
   print "GType $basenames{$i}_get_type(void);\n";
 
   if( $win32_nowrap{$i} eq 1 )
@@ -203,7 +200,7 @@ foreach $i (sort keys %objects)
   {
     print "#ifndef G_OS_WIN32\n"
   }
-  
+
   my $namespace_declarations = "";
   my $namespace_close = "";
   foreach ( @{$namespaces{$i}} )
@@ -213,7 +210,7 @@ foreach $i (sort keys %objects)
   }
 
   print "${namespace_declarations} class ${i}_Class { public: static Gst::MiniObject* wrap_new(GstMiniObject*); }; ${namespace_close}\n";
-  
+
   if( $win32_nowrap{$i} eq 1 )
   {
     print "#endif //G_OS_WIN32\n"
@@ -275,7 +272,7 @@ foreach $i (sort keys %objects)
   {
     print "#ifndef G_OS_WIN32\n"
   }
-  
+
   my $namespace_prefix = "";
   foreach( @{$namespaces{$i}} )
   {
@@ -311,7 +308,7 @@ foreach $i (sort keys %objects)
   {
     print "#ifndef G_OS_WIN32\n"
   }
-  
+
   my $namespace_prefix = "";
   foreach( @{$namespaces{$i}} )
   {
@@ -340,4 +337,3 @@ $namespace_whole_close
 EOF
 
 exit 0;
-



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