[0.11] gst-plugins-bad: gst-project-maker: Create tools, pass make distcheck
Wim Taymans
wtay at kemper.freedesktop.org
Tue Feb 21 01:06:35 PST 2012
Module: gst-plugins-bad
Branch: 0.11
Commit: e8af6da24aada3b985dc98e096b600e0c7346a2c
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=e8af6da24aada3b985dc98e096b600e0c7346a2c
Author: David Schleef <ds at schleef.org>
Date: Mon Feb 20 11:42:23 2012 -0800
gst-project-maker: Create tools, pass make distcheck
Create a tools directory for an application. Add source code
stubs to allow the project to compile and pass make distcheck.
Add notes in source code to tell the user how to create plugin
or app code using the other -maker scripts.
---
tools/gst-project-maker | 86 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 76 insertions(+), 10 deletions(-)
diff --git a/tools/gst-project-maker b/tools/gst-project-maker
index c2acc08..c75fae6 100755
--- a/tools/gst-project-maker
+++ b/tools/gst-project-maker
@@ -46,6 +46,12 @@ NAME=$(echo $name | sed -e 's/\(.*\)/\U\1/')
Prefix=$(echo $prefix | sed -e 's/_\(.\)/\U\1/g' -e 's/^\(.\)/\U\1/')
Name=$(echo $name | sed -e 's/_\(.\)/\U\1/g' -e 's/^\(.\)/\U\1/')
+if [ "$prefix" != "gst" ] ; then
+ cmdline_prefix="--prefix $prefix"
+else
+ cmdline_prefix=""
+fi
+
GST_IS_REPLACE=${PREFIX}_IS_${NAME}
GST_REPLACE=${PREFIX}_${NAME}
GST_TYPE_REPLACE=${PREFIX}_TYPE_${NAME}
@@ -134,6 +140,7 @@ AM_MAINTAINER_MODE([enable])
dnl check for tools (compiler etc.)
AC_PROG_CC
+AM_PROG_CC_C_O
dnl required version of libtool
LT_PREREQ([2.2.6])
@@ -197,12 +204,12 @@ dnl set proper LDFLAGS for plugins
GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
AC_SUBST(GST_PLUGIN_LDFLAGS)
-AC_CONFIG_FILES([Makefile plugins/Makefile])
+AC_CONFIG_FILES([Makefile plugins/Makefile tools/Makefile])
AC_OUTPUT
EOF
cat >$basedir/Makefile.am <<EOF
-SUBDIRS = plugins
+SUBDIRS = plugins tools
EXTRA_DIST = autogen.sh
@@ -217,7 +224,7 @@ cat >$basedir/plugins/Makefile.am <<EOF
plugin_LTLIBRARIES = lib$gstreplace.la
# sources used to compile this plug-in
-lib${gstreplace}_la_SOURCES = ${gstreplace}.c
+lib${gstreplace}_la_SOURCES = ${gstreplace}plugin.c ${gstreplace}.c ${gstreplace}.h
# compiler and linker flags used to compile this plugin, set in configure.ac
lib${gstreplace}_la_CFLAGS = \$(GST_CFLAGS)
@@ -279,14 +286,13 @@ cat <<EOF
#endif
#include <gst/gst.h>
+#include "gstreplace.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
-#if 0
- gst_element_register (replace, "replace", GST_RANK_NONE,
- GST_TYPE_REPLACE_TEMPLATE);
-#endif
+ gst_element_register (plugin, "replace", GST_RANK_NONE,
+ GST_TYPE_REPLACE);
return TRUE;
}
@@ -316,9 +322,69 @@ generate | sed \
-e "s/GstReplace/$GstReplace/g" \
-e "s/gst_replace/$gst_replace/g" \
-e "s/gstreplace/$gstreplace/g" \
- -e "s/replace/$replace/g" >$basedir/plugins/$gstreplace.c
+ -e "s/replace/$replace/g" >$basedir/plugins/${gstreplace}plugin.c
+
+gst-indent $basedir/plugins/${gstreplace}plugin.c
+rm -f $basedir/plugins/${gstreplace}plugin.c~
+
+cat >$basedir/plugins/${gstreplace}.c <<EOF
+/* This file should be replaced by element source generated by
+ * gst-element-maker, or by your own source code. To generate suitable
+ * element source using gst-element-maker, run:
+ *
+ * gst-element-maker $cmdline_prefix $replace BASE_CLASS
+ *
+ * Where BASE_CLASS is replaced by one of the base class templates,
+ * such as basesrc, basetransform, audiofilter, videofilter2, etc.
+ * Then copy the resulting $gstreplace.c file over this file, and
+ * $gstreplace.h over $gstreplace.h.
+ */
+/* The rest of this file is shim code to allow the project to compile */
+EOF
-gst-indent $basedir/plugins/$gstreplace.c
-rm -f $basedir/plugins/$gstreplace.c~
+cat >$basedir/plugins/${gstreplace}.h <<EOF
+/* This file should be replaced by element header generated by
+ * gst-element-maker, or by your own source code. To generate suitable
+ * element header using gst-element-maker, run:
+ *
+ * gst-element-maker $cmdline_prefix $replace BASE_CLASS
+ *
+ * Where BASE_CLASS is replaced by one of the base class templates,
+ * such as basesrc, basetransform, audiofilter, videofilter2, etc.
+ * Then copy the resulting $gstreplace.h file over this file, and
+ * $gstreplace.c over $gstreplace.c.
+ */
+/* The rest of this file is shim code to allow the project to compile */
+#define ${GST_TYPE_REPLACE} G_TYPE_NONE
+EOF
+
+
+mkdir -p $basedir/tools
+
+cat >$basedir/tools/Makefile.am <<EOF
+bin_PROGRAMS = ${gst__replace}
+
+# sources used to compile this plug-in
+${gst_replace}_SOURCES = ${gstreplace}.c
+
+# compiler and linker flags used to compile the program, set in configure.ac
+${gst_replace}_CFLAGS = \$(GST_CFLAGS)
+${gst_replace}_LDADD = \$(GST_LIBS)
+
+EOF
+
+cat >$basedir/tools/${gstreplace}.c <<EOF
+/* This file should be replaced by application source generated by
+ * gst-app-maker, or by your own source code. To generate suitable
+ * app source using gst-app-maker, run:
+ *
+ * gst-app-maker $cmdline_prefix $replace
+ *
+ * Then copy the resulting $gstreplace.c file over this file.
+ */
+/* The rest of this file is shim code to allow the project to compile */
+#include <stdio.h>
+int main (void) { printf ("FIXME\n"); return 0; }
+EOF
More information about the gstreamer-commits
mailing list