-if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
- AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
- if test x$GTK_UPDATE_ICON_CACHE = xno; then
- REBUILD_PNGS=#
- fi
-fi
+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=#
+ fi],
+
+ [test "x$cross_compiling" = xyes],
+ [# If no GTK+2 dependency and cross compiling, we need to find a host gdk-pixbuf.
+ # pkg.m4 blocks all variable starting with PKG, so allow this one
+ m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
+
+ AS_IF([test x$PKG_CONFIG_FOR_BUILD = x],
+ [AC_MSG_ERROR([You must define PKG_CONFIG_FOR_BUILD when cross compiling])])