build: support cross-compilation by natively building gtk-update-icon-cache

When cross-compiling, instead of depending on a natively built GTK+ (which means
building Glib, ATK, Pango, gdk-pixbuf, libX11...) for gtk-update-icon-cache,
find the host compiler and gdk-pixbuf, and build another gtk-update-icon-cache
with that.

This uses AX_PROG_CC_FOR_BUILD from autostars to find the host compiler, and
assumes that you'd set PKG_CONFIG_FOR_BUILD to a host pkg-config binary.

https://bugzilla.gnome.org/show_bug.cgi?id=691301
This commit is contained in:
Ross Burton
2013-01-07 12:49:27 +00:00
parent befde1f7de
commit 53083ea7b4
4 changed files with 177 additions and 11 deletions

View File

@ -16,7 +16,7 @@ else
GTK_PRINT_PREVIEW_COMMAND="evince --unlink-tempfile --preview --print-settings %s %f"
endif
SUBDIRS = a11y . tests
SUBDIRS = a11y native . tests
if HAVE_PAPI_CUPS
GTK_PRINT_BACKENDS=file,papi,cups
@ -1654,12 +1654,20 @@ stamp-icons: $(STOCK_ICONS)
if USE_EXTERNAL_ICON_CACHE
gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
else
if CROSS_COMPILING
gtk_update_icon_cache_program = ./native/native-update-icon-cache
else
gtk_update_icon_cache_program = ./gtk-update-icon-cache
endif
endif
gtkbuiltincache.h: @REBUILD@ stamp-icons
if !USE_EXTERNAL_ICON_CACHE
$(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
if CROSS_COMPILING
$(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) -C native/
else
$(AM_V_at) $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT)
endif
endif
$(AM_V_GEN) $(gtk_update_icon_cache_program) --quiet --force --ignore-theme-index \
--source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \

12
gtk/native/Makefile.am Normal file
View File

@ -0,0 +1,12 @@
CC = @CC_FOR_BUILD@
CFLAGS = @CFLAGS_FOR_BUILD@
CPP = @CPP_FOR_BUILD@
CPPFLAGS = @CPPFLAGS_FOR_BUILD@
LDFLAGS = @LDFLAGS_FOR_BUILD@
if CROSS_COMPILING
noinst_PROGRAMS = native-update-icon-cache
native_update_icon_cache_CFLAGS = $(NATIVE_GDKPIXBUF_CFLAGS)
native_update_icon_cache_LDADD = $(NATIVE_GDKPIXBUF_LIBS)
native_update_icon_cache_SOURCES = $(srcdir)/../updateiconcache.c
endif