summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-07-28 11:59:41 +0200
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-08-03 21:07:51 -0700
commitf77482f0618f954de1d080599ada058e9a3c24ff (patch)
tree80b4a5077035aabfcebc06e557e77e63c4d89b81
parent369629611609f20c89499c1f6b5562a4f3cca983 (diff)
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 <thomas.petazzoni@free-electrons.com>
-rwxr-xr-xconfigure.ac4
-rw-r--r--util/Makefile.am2
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 \