diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2010-09-14 10:14:49 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2010-09-15 15:29:38 -0700 |
commit | 9fa6bdc8c4af3f8ad6835bd24802f0268f531c5b (patch) | |
tree | 1fced87c9fa620759c9f329ee1e377503221c5b1 | |
parent | 02b6638f05d94ca908fd3d65551bc0bc4a2ab592 (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>
Reviewed-by: Joe Kain <jkain@nvidia.com>
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | xts5/src/bin/mc/Makefile.am | 6 |
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 |