summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2010-09-14 10:14:49 -0700
committerAaron Plattner <aplattner@nvidia.com>2010-09-14 10:14:49 -0700
commit558500b48e66337074738fa567af0b58c192aaa1 (patch)
tree1fced87c9fa620759c9f329ee1e377503221c5b1
parent8685f742c654a6c35a20e599f0bd639c06c06bb0 (diff)
Build mc using the build architecture compiler
When cross-compiling, we need to use the build compiler instead of the host compiler because mc is run during the build step to generate .c files from .m files. Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--configure.ac15
-rw-r--r--xts5/src/bin/mc/Makefile.am6
2 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6f51fc05..5e625785 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,21 @@ AC_PROG_LIBTOOL
AC_PROG_CC
AM_PROG_CC_C_O
+# Set up the build system compiler, if we're cross-compiling. This is used for
+# building tools like mc that are executed during the build.
+if test x"$CC_FOR_BUILD" = x; then
+ if test x"$cross_compiling" = xyes; then
+ AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
+ else
+ CC_FOR_BUILD="$CC"
+ 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([XTS], [x11 xext xi xtst])
PKG_CHECK_MODULES([XT], [x11 xext xt xtst])
dnl PKG_CHECK_MODULES([XAW], [x11 xext xt xtst xaw7])
diff --git a/xts5/src/bin/mc/Makefile.am b/xts5/src/bin/mc/Makefile.am
index a83f80a1..068cc660 100644
--- a/xts5/src/bin/mc/Makefile.am
+++ b/xts5/src/bin/mc/Makefile.am
@@ -1,5 +1,11 @@
include ../../../common.mk
+# Override the compiler to use the one for the build machine, for cross
+# compiles.
+CC = @CC_FOR_BUILD@
+CFLAGS = @CFLAGS_FOR_BUILD@
+LDFLAGS = @LDFLAGS_FOR_BUILD@
+
AM_CFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/src/tet3/inc \
-I$(top_srcdir)/xts5/include