Fix the build of the native gtk-update-icon-cache when cross-compiling.

As a noinst_PROGRAMS, the libtool generated for cross-compiling will be
used, which will mess up the linking. Create a all-local target instead.
Also ensure that building uses always a native version of the tool by
specifying a GTK_UPDATE_ICON_CACHE automake variable.
Finally "config.h" has been created to work for the target platform and
causes problem when cross-compiling. So we temporarily generate a basic
config.h which contains only the strict minimum.
This commit is contained in:
Jehan 2014-08-13 07:11:23 +00:00
parent 651d9e90e7
commit 4376b4f705
5 changed files with 22 additions and 23 deletions

View File

@ -936,7 +936,9 @@ AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
AS_IF([test "x$enable_gtk2_dependency" = xyes],
[AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
if test x$GTK_UPDATE_ICON_CACHE = xno; then
REBUILD_PNGS=#
AC_MSG_ERROR([
*** --enable-gtk2-dependency has been set but no existing
*** `gtk-update-icon-cache` has been found in the path.])
fi],
[test "x$cross_compiling" = xyes],
@ -954,22 +956,23 @@ AS_IF([test "x$enable_gtk2_dependency" = xyes],
NATIVE_GDKPIXBUF_CFLAGS=`$PKG_CONFIG_FOR_BUILD --cflags gdk-pixbuf-2.0`
NATIVE_GDKPIXBUF_LIBS=`$PKG_CONFIG_FOR_BUILD --libs gdk-pixbuf-2.0`
# This is the native gtk-update-icon-cache which will be used at
# build time, NOT the one installed on the target host.
GTK_UPDATE_ICON_CACHE="`cd $srcdir && pwd`/gtk/native/native-update-icon-cache$BUILD_EXEEXT"
AC_SUBST(NATIVE_GDKPIXBUF_CFLAGS)
AC_SUBST(NATIVE_GDKPIXBUF_LIBS)]
AC_SUBST(NATIVE_GDKPIXBUF_LIBS)
AC_SUBST(GTK_UPDATE_ICON_CACHE)],
[# In native compiling case, the gtk-update-icon-cache installed
# is the same as the one used during build.
GTK_UPDATE_ICON_CACHE="`cd $srcdir && pwd`/gtk/gtk/gtk-update-icon-cache$EXEEXT"
AC_SUBST(GTK_UPDATE_ICON_CACHE)]
)
AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$enable_gtk2_dependency" = xyes])
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
test "x$REBUILD_PNGS" = "x#" ; then
AC_MSG_ERROR([
*** gtkbuiltincache.h is not in the tree, and cannot be built
*** because you don't have libpng, or (when cross-compiling) you
*** don't have a prebuilt gtk-update-icon-cache on the build system.])
fi
########################################
# Windowing system checks
########################################

View File

@ -165,7 +165,7 @@ dist_appsicon32_DATA = data/32x32/gtk3-demo.png
dist_appsicon48_DATA = data/48x48/gtk3-demo.png
dist_appsicon256_DATA = data/256x256/gtk3-demo.png
update_icon_cache = gtk-update-icon-cache --ignore-theme-index --force
update_icon_cache = $(GTK_UPDATE_ICON_CACHE) --ignore-theme-index --force
install-data-hook: install-update-icon-cache
uninstall-hook: uninstall-update-icon-cache

View File

@ -45,7 +45,7 @@ dist_appsicon32_DATA = data/32x32/gtk3-widget-factory.png
dist_appsicon48_DATA = data/48x48/gtk3-widget-factory.png
dist_appsicon256_DATA = data/256x256/gtk3-widget-factory.png
update_icon_cache = gtk-update-icon-cache --ignore-theme-index --force
update_icon_cache = $(GTK_UPDATE_ICON_CACHE) --ignore-theme-index --force
install-data-hook: install-update-icon-cache
uninstall-hook: uninstall-update-icon-cache

View File

@ -1704,16 +1704,6 @@ files:
echo $$p; \
done
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$(EXEEXT)
endif
endif
gsettings_SCHEMAS = \
org.gtk.Settings.FileChooser.gschema.xml \
org.gtk.Settings.ColorChooser.gschema.xml \

View File

@ -4,9 +4,15 @@ CPP = @CPP_FOR_BUILD@
AM_CPPFLAGS = @CPPFLAGS_FOR_BUILD@
AM_LDFLAGS = @LDFLAGS_FOR_BUILD@
native-update-icon-cache$(BUILD_EXEEXT): $(srcdir)/../updateiconcache.c
echo '#define GETTEXT_PACKAGE "gtk30"' > $(srcdir)/config.h
$(AM_V_CCLD)$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) -I. -I$(srcdir)/../.. $(NATIVE_GDKPIXBUF_CFLAGS) $(CFLAGS_FOR_BUILD) $^ $(LDFLAGS_FOR_BUILD) $(NATIVE_GDKPIXBUF_LIBS) $(LIBS_FOR_BUILD) -o $@
rm -f $(srcdir)/config.h
if CROSS_COMPILING
if !USE_EXTERNAL_ICON_CACHE
noinst_PROGRAMS = native-update-icon-cache
all-local: native-update-icon-cache$(BUILD_EXEEXT)
native_update_icon_cache_CFLAGS = $(NATIVE_GDKPIXBUF_CFLAGS)
native_update_icon_cache_LDADD = $(NATIVE_GDKPIXBUF_LIBS)
native_update_icon_cache_SOURCES = $(srcdir)/../updateiconcache.c