[CRIU] [PATCH] zdtm: autodetect the target machine

Alexander Kartashov alekskartashov at parallels.com
Wed Jan 23 09:22:05 EST 2013


Andrew Vagin pointed out that the static testsuite compilation
may run as standalone so the variable ARCH won't be available.

This patch enables test/zdtm/live/static/Makefile to detect
the target machine automatically if the variable ARCH isn't defined.

Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 test/zdtm/live/static/Makefile |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
index 194930b..23bc605 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -1,3 +1,22 @@
+ifeq ($(ARCH),)
+
+MACH := $(shell uname -m | sed -e s/i.86/i386/)
+
+ifeq ($(MACH),i386)
+	ARCH := x86
+endif
+
+ifeq ($(MACH),x86_64)
+	ARCH := x86
+endif
+
+ifeq ($(findstring arm,$(MACH)),arm)
+	ARCH := arm
+endif
+
+endif
+
+
 LIBDIR	= ../../lib
 LIB	= $(LIBDIR)/libzdtmtst.a
 override CPPFLAGS += -I$(LIBDIR) -iquote $(LIBDIR)/arch/$(ARCH)/include
-- 
1.7.10.4



More information about the CRIU mailing list