gtk+2.0 (2.20.1-2) 001_static-linking-dont-query-immodules.patch

Summary

 configure.in              |    1 +
 modules/input/Makefile.am |   17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

    
download this patch

Patch contents

Description: Don't query immodules for the local tree when cross-compiling or
             when --disable-shared was given
Bug: http://bugzilla.gnome.org/show_bug.cgi?id=346531

Index: b/configure.in
===================================================================
--- a/configure.in	2010-04-10 14:52:05.069943955 +0200
+++ b/configure.in	2010-04-10 14:52:06.769944806 +0200
@@ -162,6 +162,7 @@
 dnl Initialize libtool
 AC_PROG_CC
 AM_DISABLE_STATIC
+AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = yes])
 
 dnl 
 dnl Check for a working C++ compiler, but do not bail out, if none is found.
Index: b/modules/input/Makefile.am
===================================================================
--- a/modules/input/Makefile.am	2010-04-10 14:52:05.089945386 +0200
+++ b/modules/input/Makefile.am	2010-04-10 14:52:06.769944806 +0200
@@ -178,8 +178,12 @@
 if CROSS_COMPILING
 RUN_QUERY_IMMODULES_TEST=false
 else
+if ENABLE_STATIC
+RUN_QUERY_IMMODULES_TEST=false
+else
 RUN_QUERY_IMMODULES_TEST=test -z "$(DESTDIR)"
 endif
+endif
 
 # Running this if cross compiling or if DESTDIR is set is going to
 # not work at all, so skip it.
@@ -240,7 +244,18 @@
 included-modules: $(noinst_LTLIBRARIES)
 
 gtk.immodules: Makefile.am $(module_LTLIBRARIES)
-	$(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules
+	@if $(RUN_QUERY_IMMODULES_TEST) ; then \
+	  echo "$(top_builddir)/gtk/gtk-query-immodules-2.0 > gtk.immodules" ; \
+	$(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules; \
+	else \
+	  echo "***" ; \
+	  echo "*** Warning: gtk.immodules not built" ; \
+	  echo "***" ; \
+	  echo "*** Generate this file manually on host" ; \
+	  echo "*** system using gtk-query-immodules-2.0" ; \
+	  echo "***" ; \
+	  touch gtk.immodules; \
+        fi
 
 CLEANFILES = gtk.immodules