From 88196dd792adc997eb71fa3c5b9b25c8c21e5b57 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 28 Jul 2009 11:59:41 +0200 Subject: [PATCH] Fix compilation of host tools in cross-compilation case At 36e9f0d351afbf7fd2595990b2d39e7c551f6420, a fix was added to use the host gcc instead of the target gcc when cross-compiling libXt. This fix works, but is not solve the whole problem: the CFLAGS and LDFLAGS used with the host compilers are the one defined for the target compiler (and the flags for both compilers might be very different). This new fix let libXt obey to CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD environment variables, and use them to compile the host tools in util/. Signed-off-by: Thomas Petazzoni --- configure.ac | 4 ++++ util/Makefile.am | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index 043ab5f..cb00a41 100755 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,10 @@ if test x"$CC_FOR_BUILD" = x; then fi fi AC_SUBST([CC_FOR_BUILD]) +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} +AC_SUBST(CFLAGS_FOR_BUILD) +LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}} +AC_SUBST(LDFLAGS_FOR_BUILD) PKG_CHECK_MODULES(XT, sm x11 xproto kbproto) diff --git a/util/Makefile.am b/util/Makefile.am index 0d3ff01..37b78d2 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -5,6 +5,8 @@ noinst_PROGRAMS = makestrs endif CC = @CC_FOR_BUILD@ +CFLAGS = @CFLAGS_FOR_BUILD@ +LDFLAGS = @LDFLAGS_FOR_BUILD@ EXTRA_DIST = \ Shell.ht \ -- 1.6.0.4