From: Robert Schwebel <r.schwebel@pengutronix.de>
Subject: [patch] fix cross compilation in glib-2.25.7

When we try to cross compile, the build system compiles
glib-compile-schemas for the "host" system, but tries to run it later on
the "build" machine.

We make it possible to overwrite the call to the binary during
configure, similar to what GLIB_GENMARSHAL does.

Signed-of-by: Robert Schwebel <r.schwebel@pengutronix.de>

---
 configure.in          |   13 ++++++++++---
 gio/tests/Makefile.am |    2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

Index: glib-2.25.7/configure.in
===================================================================
--- glib-2.25.7.orig/configure.in
+++ glib-2.25.7/configure.in
@@ -2731,9 +2731,10 @@ int error = EILSEQ;
 ], have_eilseq=yes, have_eilseq=no);
 AC_MSG_RESULT($have_eilseq)
 
-dnl ******************************************************************
-dnl *** Look for glib-genmarshal in PATH if we are cross-compiling ***
-dnl ******************************************************************
+dnl ****************************************************************
+dnl *** Look for glib-genmarshal and glib-compile-schemas in PATH **
+dnl *** if we are cross-compiling                                 **
+dnl ****************************************************************
 
 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
 
@@ -2742,6 +2743,12 @@ if test $cross_compiling = yes; then
   if test x$GLIB_GENMARSHAL = xno; then
     AC_MSG_ERROR(Could not find a glib-genmarshal in your PATH)
   fi
+  AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas, no)
+  if test x$GLIB_COMPILE_SCHEMAS = xno; then
+    AC_MSG_ERROR(Could not find a glib-compile-schemas in your PATH)
+  fi
+else
+  AC_SUBST(GLIB_COMPILE_SCHEMAS,"\$(top_builddir)/gio/glib-compile-schemas")
 fi
 
 dnl **************************
Index: glib-2.25.7/gio/tests/Makefile.am
===================================================================
--- glib-2.25.7.orig/gio/tests/Makefile.am
+++ glib-2.25.7/gio/tests/Makefile.am
@@ -288,7 +288,7 @@ test.mo: de.po
 	cp -f test.mo de/LC_MESSAGES
 
 gschemas.compiled:
-	$(top_builddir)/gio/glib-compile-schemas --targetdir=$(abs_builddir) $(srcdir)
+	$(GLIB_COMPILE_SCHEMAS) --targetdir=$(abs_builddir) $(srcdir)
 
 DISTCLEANFILES =                                        \
 	applications/mimeinfo.cache                     \
