Re: Patch to specify out-of-tree gdk-pixbuf-csource for cross compiling



Owen Taylor <otaylor redhat com> writes:

> Michael Natterer <mitch gimp org> writes:
> 
> > > (snip)
> > 
> > Oh, I was not aware of that AC_CHECK_PROG() feature.
> > 
> > Would you have a look at the attached patch (I used AC_CHECK_PATH(),
> > because it feels somehow safer :-)
> 
> Looks fine. I might do something like:
> 
> AM_CONDITIONAL(CROSS_COMPILING, test $build = $host)
> 
> Then in the Makefile.am:
> 
> if CROSS_COMPILING
> pixbuf_csource=$(GDK_PIXBUF_CSOURCE)
> else
> pixbuf_csource=GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) $(pixbuf_dir)/gdk-pixbuf-csource
> endif
> 
> gtkstockpixbufs.h: $(pixbuf_csource) $(IMAGES)
> 	$(pixbuf_csource) \
> 	   --raw --build-list $(VARIABLES1) >$(srcdir)/gtkstockpixbufs.h
> 
> To reduce the interdependence between Makefile.am and configure.in, but
> what you have should work.

At your service :)

Are the following patches for glib-genarshal and gdk-pixbuf-csource OK?

ciao,
--mitch

Index: configure.in
===================================================================
RCS file: /cvs/gnome/glib/configure.in,v
retrieving revision 1.279.2.1
diff -u -p -r1.279.2.1 configure.in
--- configure.in	6 May 2002 16:06:36 -0000	1.279.2.1
+++ configure.in	7 May 2002 14:42:08 -0000
@@ -1582,6 +1582,19 @@ 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 ******************************************************************
+
+AM_CONDITIONAL(CROSS_COMPILING, test $build != $host)
+
+if test $CROSS_COMPILING; then
+  AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, no)
+  if test x$GLIB_GENMARSHAL = xno; then
+    AC_MSG_ERROR(Could not find a glib-genmarshal in your PATH)
+  fi
+fi
+
 dnl **************************
 dnl *** Checks for gtk-doc ***
 dnl **************************
Index: gobject/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gobject/Makefile.am,v
retrieving revision 1.48
diff -u -p -r1.48 Makefile.am
--- gobject/Makefile.am	5 Mar 2002 05:17:40 -0000	1.48
+++ gobject/Makefile.am	7 May 2002 14:42:08 -0000
@@ -148,22 +148,30 @@ $(libgobject_2_0_la_OBJECTS): $(gobject_
 # initial creation of the real stamp-* files
 gmarshal.h:	# never add deps here
 	test -f "$(srcdir)/$@" || touch $(srcdir)/$@
+
 # normal autogeneration rules
 # all autogenerated files need to be generated in the srcdir,
 # so old versions get remade and are not confused with newer
 # versions in the build dir. thus a development setup requires
 # srcdir to be writable, passing --disable-rebuilds to
 # ../configure will supress all autogeneration rules.
+
+if CROSS_COMPILING
+  glib_genmarshal=$(GLIB_GENMARSHAL)
+else
+  glib_genmarshal=./glib-genmarshal
+endif
+
 $(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal$(EXEEXT)
 	echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
 	&& echo "#define __G_MARSHAL_H__" >> xgen-gmh \
-	&& ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
+	&& $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
 	&& echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
 	&& (cmp -s xgen-gmh $(srcdir)/gmarshal.h || cp xgen-gmh $(srcdir)/gmarshal.h) \
 	&& rm -f xgen-gmh xgen-gmh~ \
 	&& echo timestamp > $@
 $(srcdir)/gmarshal.c: @REBUILD@ $(srcdir)/stamp-gmarshal.h
-	./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
+	$(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
 	&& cp xgen-gmc $(srcdir)/gmarshal.c \
 	&& rm -f xgen-gmc xgen-gmc~
 $(srcdir)/gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gtk+/configure.in,v
retrieving revision 1.271
diff -u -p -r1.271 configure.in
--- configure.in	2 Apr 2002 12:10:31 -0000	1.271
+++ configure.in	7 May 2002 14:45:06 -0000
@@ -850,6 +850,16 @@ fi
 
 AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
 
+dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
+
+AM_CONDITIONAL(CROSS_COMPILING, test $build != $host)
+
+if test $CROSS_COMPILING; then
+  AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
+  if test x$GDK_PIXBUF_CSOURCE = xno; then
+    AC_MSG_ERROR(Could not find a gdk-pixbuf-csource in your PATH)
+  fi
+fi
 
 GDK_PIXBUF_PACKAGES="gmodule-2.0 gobject-2.0"
 GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB"
Index: gtk/stock-icons/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/stock-icons/Makefile.am,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile.am
--- gtk/stock-icons/Makefile.am	29 Mar 2002 06:23:35 -0000	1.20
+++ gtk/stock-icons/Makefile.am	7 May 2002 14:45:06 -0000
@@ -257,20 +257,24 @@ VARIABLES6 = @STRIP_BEGIN@ 									\
 noinst_DATA = gtkstockpixbufs.h
 CLEANFILES = $(noinst_DATA)
 
-pixbuf_dir = $(top_builddir)/gdk-pixbuf
+if CROSS_COMPILING
+pixbuf_csource=$(GDK_PIXBUF_CSOURCE)
+else
+pixbuf_csource=GDK_PIXBUF_MODULEDIR=$(top_builddir)/gdk-pixbuf $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource
+endif
 
-gtkstockpixbufs.h: $(pixbuf_dir)/gdk-pixbuf-csource $(IMAGES)
-	GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
-	   $(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES1) >$(srcdir)/gtkstockpixbufs.h
-	GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
-	   $(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES2) >>$(srcdir)/gtkstockpixbufs.h
-	GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
-	   $(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES3) >>$(srcdir)/gtkstockpixbufs.h
-	GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
-	   $(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES4) >>$(srcdir)/gtkstockpixbufs.h
-	GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
-	   $(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES5) >>$(srcdir)/gtkstockpixbufs.h
-	GDK_PIXBUF_MODULEDIR=$(pixbuf_dir) \
-	   $(pixbuf_dir)/gdk-pixbuf-csource --raw --build-list $(VARIABLES6) >>$(srcdir)/gtkstockpixbufs.h
+gtkstockpixbufs.h: $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource $(IMAGES)
+	$(pixbuf_csource) \
+	   --raw --build-list $(VARIABLES1) >$(srcdir)/gtkstockpixbufs.h
+	$(pixbuf_csource) \
+	   --raw --build-list $(VARIABLES2) >>$(srcdir)/gtkstockpixbufs.h
+	$(pixbuf_csource) \
+	   --raw --build-list $(VARIABLES3) >>$(srcdir)/gtkstockpixbufs.h
+	$(pixbuf_csource) \
+	   --raw --build-list $(VARIABLES4) >>$(srcdir)/gtkstockpixbufs.h
+	$(pixbuf_csource) \
+	   --raw --build-list $(VARIABLES5) >>$(srcdir)/gtkstockpixbufs.h
+	$(pixbuf_csource) \
+	   --raw --build-list $(VARIABLES6) >>$(srcdir)/gtkstockpixbufs.h
 
 EXTRA_DIST = $(IMAGES) gtkstockpixbufs.h


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]