From ce861bc43050c657c3baf7b655dc76fe554e46b0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 11 Jul 2017 11:39:59 +0100 Subject: [PATCH] Use newer glib-genmarshal to simplify build rules The glib-genmarshal tool from GLib 2.54 added various command line arguments that allow us to remove a bunch of as hoc manipulations of the generated marshaller source files. The marshal generator tool can now include an header in the source, and undef the G_ENABLE_DEBUG pre-processor symbol for us. It can also generate the prototypes of the marshallers in the C source, and avoid a 'missing-prototypes' compiler warning. --- gdk/Makefile.am | 1 + gtk/Makefile.am | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 6fbd478f18..d830cef1be 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -426,6 +426,7 @@ gdkmarshalers.c: gdkmarshalers.list $(AM_V_GEN) $(GLIB_GENMARSHAL) \ --prefix=_gdk_marshal \ --body \ + --prototypes \ $(srcdir)/gdkmarshalers.list > gdkmarshalers-c.tmp \ && mv gdkmarshalers-c.tmp gdkmarshalers.c \ || ( rm -f gdkmarshalers-c.tmp && exit 1 ) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index d204ba2267..826eeb4198 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1196,19 +1196,21 @@ gtkmarshalers.h: stamp-gtkmarshalers.h @true stamp-gtkmarshalers.h: gtkmarshalers.list $(AM_V_GEN) $(GLIB_GENMARSHAL) \ - --prefix=_gtk_marshal \ --header \ + --prefix=_gtk_marshal \ --valist-marshallers \ - $(srcdir)/gtkmarshalers.list >> xgen-gmlh \ + $(srcdir)/gtkmarshalers.list > xgen-gmlh \ && (cmp -s xgen-gmlh gtkmarshalers.h || cp xgen-gmlh gtkmarshalers.h) \ && rm -f xgen-gmlh \ && echo timestamp > $(@F) gtkmarshalers.c: gtkmarshalers.list - $(AM_V_GEN) (echo "#undef G_ENABLE_DEBUG"; \ - $(GLIB_GENMARSHAL) \ - --prefix=_gtk_marshal \ + $(AM_V_GEN) $(GLIB_GENMARSHAL) \ --body \ - --valist-marshallers $(srcdir)/gtkmarshalers.list) >> xgen-gmlc \ + --prefix=_gtk_marshal \ + --valist-marshallers \ + --include-header="gtkmarshalers.h" \ + -U G_ENABLE_DEBUG \ + $(srcdir)/gtkmarshalers.list > xgen-gmlc \ && cp xgen-gmlc gtkmarshalers.c \ && rm -f xgen-gmlc