Re: Patch to specify out-of-tree gdk-pixbuf-csource for cross compiling
- From: Owen Taylor <otaylor redhat com>
- To: Michael Natterer <mitch gimp org>
- Cc: gtk-devel-list gnome org
- Subject: Re: Patch to specify out-of-tree gdk-pixbuf-csource for cross compiling
- Date: Tue, 7 May 2002 10:18:45 -0400 (EDT)
Michael Natterer <mitch gimp org> writes:
> Owen Taylor <otaylor redhat com> writes:
>
> > Michael Natterer <mitch gimp org> writes:
> >
> > > Owen Taylor <otaylor redhat com> writes:
> > >
> > > > Michael Natterer <mitch gimp org> writes:
> > > >
> > > > > Hi,
> > > > >
> > > > > The attached patch adds the configure option --with-gdk-pixbuf-csource
> > > > > so gtk/stock-icons/Makefile.am does not try to execute an exacutable
> > > > > which was built for the target platform in the case of cross
> > > > > compilation.
> > > > >
> > > > > If you feel this is the right way to solve the problem, I'll
> > > > > create a similar patch for GLib's glib-genmarshal.
> > > >
> > > > Can we figure out some way of doing it so that the same configure
> > > > option could be passed to GLib, Pango, and GTK+ ... or maybe it could
> > > > just figure it out from the values of $build and $host?
> > > >
> > > > (That is, if $build != $host, look for gdk-pixbuf-csource,
> > > > glib-genmarshal in the path.)
> > >
> > > Good point, as this is always needed for cross-compilation we
> > > can well do it automatically.
> > >
> > > What about
> > >
> > > --with-gdk-pixbuf-csource=[PATH/auto] If the built
> > > gdk-pixbuf-csource cannot be used to generate stock pixbufs, try to
> > > find one (auto), or use the binary specified by PATH [default=auto]
> > >
> > > so cross-compiling people can still specify the exact location if
> > > they have, in addition to cross-fu, some weird setup they may need.
> >
> > Well, if we went to using the path when cross compiling, we'd
> > presumably use AC_CHECK_PROG() so someone could just set
> > GDK_PIXBUF_CSOURCE before running configure .. and that would be
> > more compatible with the way other programs can be overridden.
>
> 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.
Regards,
Owen
> 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 13:26:12 -0000
> @@ -850,6 +850,17 @@ 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
> +
> +if test $build != $host; then
> + AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
> + if test x$GDK_PIXBUF_CSOURCE = x; then
> + AC_MSG_ERROR(Could not find a gdk-pixbuf-csource in your PATH)
> + fi
> +else
> + GDK_PIXBUF_CSOURCE='GDK_PIXBUF_MODULEDIR=$(top_builddir)/gdk-pixbuf $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource'
> + AC_SUBST(GDK_PIXBUF_CSOURCE)
> +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 13:26:12 -0000
> @@ -257,20 +257,18 @@ VARIABLES6 = @STRIP_BEGIN@ \
> noinst_DATA = gtkstockpixbufs.h
> CLEANFILES = $(noinst_DATA)
>
> -pixbuf_dir = $(top_builddir)/gdk-pixbuf
> -
> -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: $(pixbuf_csource) $(IMAGES)
> + @GDK_PIXBUF_CSOURCE@ \
> + --raw --build-list $(VARIABLES1) >$(srcdir)/gtkstockpixbufs.h
> + @GDK_PIXBUF_CSOURCE@ \
> + --raw --build-list $(VARIABLES2) >>$(srcdir)/gtkstockpixbufs.h
> + @GDK_PIXBUF_CSOURCE@ \
> + --raw --build-list $(VARIABLES3) >>$(srcdir)/gtkstockpixbufs.h
> + @GDK_PIXBUF_CSOURCE@ \
> + --raw --build-list $(VARIABLES4) >>$(srcdir)/gtkstockpixbufs.h
> + @GDK_PIXBUF_CSOURCE@ \
> + --raw --build-list $(VARIABLES5) >>$(srcdir)/gtkstockpixbufs.h
> + @GDK_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]