[gcr] Work around for gdbus-codegen bug
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr] Work around for gdbus-codegen bug
- Date: Sun, 23 Mar 2014 08:26:30 +0000 (UTC)
commit ace7c1570556c44d1292e74a187ce75e53a4a991
Author: Stef Walter <stefw redhat com>
Date: Sun Mar 23 09:12:50 2014 +0100
Work around for gdbus-codegen bug
https://bugzilla.gnome.org/show_bug.cgi?id=710133
Makefile.am | 6 +++++-
build/gdbus-unbreak-codegen | 36 ++++++++++++++++++++++++++++++++++++
gcr/Makefile.am | 2 +-
3 files changed, 42 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index af36e6a..aca4c6b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -108,10 +108,14 @@ EXTRA_DIST = \
build/enum-template.h \
build/g-ir-unbreak.xsl \
build/tap-driver \
- build/tap-gtester
+ build/tap-gtester \
+ build/gdbus-unbreak-codegen \
+ $(NULL)
TEST_SUPPRESSIONS = $(top_builddir)/build/valgrind-suppressions
+GDBUS_CODEGEN = $(top_srcdir)/build/gdbus-unbreak-codegen
+
V_SED = $(V_SED_$(V))
V_SED_ = $(V_SED_$(AM_DEFAULT_VERBOSITY))
V_SED_0 = @echo " SED " $@;
diff --git a/build/gdbus-unbreak-codegen b/build/gdbus-unbreak-codegen
new file mode 100755
index 0000000..7ea6c22
--- /dev/null
+++ b/build/gdbus-unbreak-codegen
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -uef
+
+generate_c_code=
+next_arg_is_name="no"
+
+for arg in "$@"; do
+ if [ "$next_arg_is_name" = "yes" ]; then
+ generate_c_code="$arg"
+ next_arg_is_name="no"
+ continue
+ fi
+ case "$arg" in
+ --generate-c-code)
+ next_arg_is_name="yes"
+ ;;
+ --generate-c-code=*)
+ generate_c_code="${arg#--generate-c-code=}"
+ ;;
+ esac
+done
+
+gdbus-codegen "$@"
+
+if [ -n "$generate_c_code" ]; then
+ # HACK: This is a work around for gdbus-codegen crashing when
+ # we build with GLIB_VERSION_MAX_ALLOWED. See:
+ # https://bugzilla.gnome.org/show_bug.cgi?id=710133
+ sed -e '1i\
+#ifdef GLIB_VERSION_MAX_ALLOWED\
+#undef GLIB_VERSION_MAX_ALLOWED\
+#endif' \
+ "$generate_c_code.c" > "$generate_c_code.$$"
+ mv "$generate_c_code.$$" "$generate_c_code.c"
+fi
diff --git a/gcr/Makefile.am b/gcr/Makefile.am
index 1bfc1bc..2be0658 100644
--- a/gcr/Makefile.am
+++ b/gcr/Makefile.am
@@ -157,7 +157,7 @@ DBUS_XML_DEFINITIONS = \
gcr/org.gnome.keyring.Prompter.xml
gcr/gcr-dbus-generated.c: $(DBUS_XML_DEFINITIONS)
- $(AM_V_GEN) gdbus-codegen --interface-prefix org.gnome.keyring.internal. \
+ $(AM_V_GEN) $(GDBUS_CODEGEN) --interface-prefix org.gnome.keyring.internal. \
--generate-c-code gcr/gcr-dbus-generated --c-namespace GcrDBus $^
$(AM_V_GEN) sed -i -e 's/gcr_dbus/_gcr_dbus/g' gcr/gcr-dbus-generated.[ch]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]