[PATCH 04/18] user-cr: cross-compile: Enable proper cross compilation

Matt Helsley matthltc at us.ibm.com
Thu Mar 17 10:27:36 PDT 2011


Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
---
 Makefile      |    7 +++++++
 test/Makefile |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 0932519..d4558be 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,13 @@
 
 KERNELSRC ?= ../linux
 
+# Prefix CC, AS, LD, AR for cross compilation
+CROSS_COMPILE ?=
+CC := $(CROSS_COMPILE)gcc
+LD := $(CROSS_COMPILE)ld
+AS := $(CROSS_COMPILE)as
+AR := $(CROSS_COMPILE)ar
+
 CKPT_INCLUDE = -I./include
 CKPT_HEADERS = include/linux/checkpoint.h \
 		include/linux/checkpoint_hdr.h \
diff --git a/test/Makefile b/test/Makefile
index 898e426..92482f2 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,6 @@
 # handle cross-compilation
+# Prefix CC, AS, LD, AR for cross compilation
+CROSS_COMPILE ?=
 AR  := ${CROSS_COMPILE}ar
 AS  := ${CROSS_COMPILE}as
 CC  := ${CROSS_COMPILE}gcc
-- 
1.6.3.3



More information about the Containers mailing list