summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common-modified/Makefile.am3
-rw-r--r--common-modified/glib-gen.mak44
-rw-r--r--gst-libs/gst/farsight/Makefile.am2
-rw-r--r--gst/fsrtpconference/Makefile.am2
-rw-r--r--transmitters/rawudp/Makefile.am2
5 files changed, 49 insertions, 4 deletions
diff --git a/common-modified/Makefile.am b/common-modified/Makefile.am
index c89e0d77..9350faf0 100644
--- a/common-modified/Makefile.am
+++ b/common-modified/Makefile.am
@@ -1,2 +1,3 @@
EXTRA_DIST = \
- gtk-doc-plugins.mak
+ gtk-doc-plugins.mak \
+ glib-gen.mak
diff --git a/common-modified/glib-gen.mak b/common-modified/glib-gen.mak
new file mode 100644
index 00000000..068b945f
--- /dev/null
+++ b/common-modified/glib-gen.mak
@@ -0,0 +1,44 @@
+# these are the variables your Makefile.am should set
+# the example is based on the colorbalance interface
+
+#glib_enum_headers=$(colorbalance_headers)
+#glib_enum_define=GST_COLOR_BALANCE
+#glib_enum_prefix=gst_color_balance
+
+enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\")
+
+# these are all the rules generating the relevant files
+%-marshal.h: %-marshal.list Makefile
+ glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $< > $*-marshal.h.tmp
+ mv $*-marshal.h.tmp $*-marshal.h
+
+%-marshal.c: %-marshal.list Makefile
+ echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp
+ glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $< >> $*-marshal.c.tmp
+ mv $*-marshal.c.tmp $*-marshal.c
+
+%-enum-types.h: $(glib_enum_headers) Makefile
+ glib-mkenums \
+ --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
+ --fprod "\n/* enumerations from \"@filename@\" */\n" \
+ --vhead "GType @enum_name@_get_type (void);\n#define $(glib_enum_define)_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
+ --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \
+ $^ > $@
+
+%-enum-types.c: $(glib_enum_headers) Makefile
+ @if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi
+ glib-mkenums \
+ --fhead "#include \"$*-enum-types.h\"\n$(enum_headers)" \
+ --fprod "\n/* enumerations from \"@filename@\" */" \
+ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
+ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
+ $^ > $@
+
+# a hack rule to make sure .Plo files exist because they get include'd
+# from Makefile's
+.deps/%-marshal.Plo:
+ touch $@
+
+.deps/%-enum-types.Plo:
+ touch $@
diff --git a/gst-libs/gst/farsight/Makefile.am b/gst-libs/gst/farsight/Makefile.am
index 77be44b7..32ff5be2 100644
--- a/gst-libs/gst/farsight/Makefile.am
+++ b/gst-libs/gst/farsight/Makefile.am
@@ -84,4 +84,4 @@ glib_enum_headers=$(public_headers)
glib_enum_define=FS
glib_enum_prefix=_fs
-include $(top_srcdir)/common/glib-gen.mak
+include $(top_srcdir)/common-modified/glib-gen.mak
diff --git a/gst/fsrtpconference/Makefile.am b/gst/fsrtpconference/Makefile.am
index 64143d5c..278e2b2b 100644
--- a/gst/fsrtpconference/Makefile.am
+++ b/gst/fsrtpconference/Makefile.am
@@ -85,4 +85,4 @@ fs-rtp-marshal.list: $(libfsrtpconference_la_SOURCES) Makefile.am
glib_enum_define=FS_RTP
glib_enum_prefix=_fs_rtp
-include $(top_srcdir)/common/glib-gen.mak
+include $(top_srcdir)/common-modified/glib-gen.mak
diff --git a/transmitters/rawudp/Makefile.am b/transmitters/rawudp/Makefile.am
index 45d98688..f29291ac 100644
--- a/transmitters/rawudp/Makefile.am
+++ b/transmitters/rawudp/Makefile.am
@@ -57,5 +57,5 @@ fs-rawudp-marshal.list: $(librawudp_transmitter_la_SOURCES) Makefile.am
glib_enum_define=FS_RAWUDP
glib_enum_prefix=_fs_rawudp
-include $(top_srcdir)/common/glib-gen.mak
+include $(top_srcdir)/common-modified/glib-gen.mak