Similarly to the kernel. CROSS_COMPILE is optional, when specified it's
a prefix, eg. myarch-linux-gnu-
We still allow overriding CC, separately, or in addition to setting
CROSS_COMPILE.
There is also support for cross configuring, because at the moment all
the configure tests only need to build, they're not run.
---
Makefile | 3 +++
configure.sh | 2 ++
2 files changed, 5 insertions(+)
diff --git a/Makefile b/Makefile
index 2dbaa65..f5a35b6 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,9 @@ VERSION=1.2pre
INSTALL_PREFIX ?= $(DESTDIR)
INSTALL_PREFIX ?= $(HOME)
+CC := $(CROSS_COMPILE)$(CC)
+LD := $(CROSS_COMPILE)$(LD)
+
CFLAGS = -Wall -W -g -O2 -I. -Iinclude/ -Wimplicit -D_FORTIFY_SOURCE=2
-D_GNU_SOURCE
#CFLAGS += $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null >/dev/null
2>&1; then echo "-m32"; fi)
CFLAGS += -Wdeclaration-after-statement
diff --git a/configure.sh b/configure.sh
index 4be1e59..a02db7f 100755
--- a/configure.sh
+++ b/configure.sh
@@ -10,6 +10,8 @@ MISSING_DEFS=0
[ -z "$CC" ] && CC=cc
+CC=${CROSS_COMPILE}${CC}
+
echo "/* This file is auto-generated by configure.sh */" > config.h
TMP=$(mktemp)
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html