Commit 914099dc authored by Hib Eris's avatar Hib Eris

Build extract-strings tool for build system

This fixes cross compiling where build system != host system.

https://bugzilla.gnome.org/show_bug.cgi?id=699690
parent 7d5a90b7
......@@ -684,6 +684,12 @@ AM_PATH_GLIB_2_0(glib_required_version, :,
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]),
gobject gmodule-no-export)
PKG_PROG_PKG_CONFIG_FOR_BUILD
GLIB_CFLAGS_FOR_BUILD=`$PKG_CONFIG_FOR_BUILD --cflags glib-2.0 gobject-2.0 gmodule-no-export-2.0`
GLIB_LIBS_FOR_BUILD=`$PKG_CONFIG_FOR_BUILD --libs glib-2.0 gobject-2.0 gmodule-no-export-2.0`
AC_SUBST(GLIB_CFLAGS_FOR_BUILD)
AC_SUBST(GLIB_LIBS_FOR_BUILD)
dnl Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
dnl
gtk_save_LIBS=$LIBS
......
......@@ -1128,8 +1128,8 @@ template_headers = $(COMPOSITE_TEMPLATES:.ui=.ui.h)
MAINTAINERCLEANFILES += $(template_headers)
%.ui.h: %.ui extract-strings$(EXEEXT)
$(AM_V_GEN) ./extract-strings$(EXEEXT) $< > $@
%.ui.h: %.ui extract-strings$(BUILD_EXEEXT)
$(AM_V_GEN) ./extract-strings$(BUILD_EXEEXT) $< > $@
#
# rules to generate built sources
......@@ -1401,10 +1401,15 @@ endif
gtk_launch_LDADD = $(LDADDS)
gtk_launch_SOURCES = gtk-launch.c
noinst_PROGRAMS = extract-strings
extract_strings_SOURCES = extract-strings.c
extract_strings_LDADD = $(GLIB_LIBS)
# The extract_strings tool is a build utility that runs on the build system.
extract_strings_sources = extract-strings.c
extract_strings_cppflags =
extract_strings_cflags = $(GLIB_CFLAGS_FOR_BUILD)
extract_strings_ldadd = $(GLIB_LIBS_FOR_BUILD)
extract-strings$(BUILD_EXEEXT): $(extract_strings_sources)
@rm -f extract-strings$(BUILD_EXEEXT)
$(AM_V_CCLD)$(CC_FOR_BUILD) $(extract_strings_cppflags) $(CPPFLAGS_FOR_BUILD) $(extract_strings_cflags) $(CFLAGS_FOR_BUILD) $^ $(LDFLAGS_FOR_BUILD) $(extract_strings_ldadd) $(LIBS_FOR_BUILD) -o $@
EXTRA_DIST += $(extract_strings_sources)
.PHONY: files test test-debug
......
......@@ -57,6 +57,7 @@ pushdef([CPP], CPP_FOR_BUILD)dnl
pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
pushdef([LIBS], LIBS_FOR_BUILD)dnl
pushdef([host], build)dnl
pushdef([host_alias], build_alias)dnl
pushdef([host_cpu], build_cpu)dnl
......@@ -98,6 +99,7 @@ popdef([host_vendor])dnl
popdef([host_cpu])dnl
popdef([host_alias])dnl
popdef([host])dnl
popdef([LIBS])dnl
popdef([LDFLAGS])dnl
popdef([CPPFLAGS])dnl
popdef([CFLAGS])dnl
......
# PKG_PROG_PKG_CONFIG_FOR_BUILD([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG_FOR_BUILD],
[m4_pattern_allow([^PKG_CONFIG_FOR_BUILD$])
AC_ARG_VAR([PKG_CONFIG_FOR_BUILD], [path to build system's pkg-config utility])
if test "x$ac_cv_env_PKG_CONFIG_FOR_BUILD_set" != "xset"; then
AC_PATH_PROG([PKG_CONFIG_FOR_BUILD], [pkg-config])
fi
if test -n "$PKG_CONFIG_FOR_BUILD"; then
_pkg_for_build_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([build system's pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG_FOR_BUILD --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG_FOR_BUILD=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG_FOR_BUILD
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment