Some system call test program depends cpu architecture.
We cannot compile these, and there is a case to fail in a test even if
We compile it.
This check cpu architecture and build check in Makefile.
This didn't check all syscall and test cases.

Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
---
 Makefile                                           |   10 +++++++++-
 testcases/kernel/syscalls/fallocate/Makefile       |    6 ++++++
 testcases/kernel/syscalls/set_thread_area/Makefile |    6 ++++++
 testcases/kernel/syscalls/sgetmask/Makefile        |    6 ++++++
 4 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 4cf124b..5243290 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,13 @@
 # See toplevel INSTALL for build info

+ifndef ARCH
+# copy from Makefile in linux kernel
+ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+       -e s/arm.*/arm/ -e s/sa110/arm/ \
+       -e s/s390x/s390/ -e s/parisc64/parisc/ \
+       -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+       -e s/sh[234].*/sh/ )
+endif
 ifdef CROSS_COMPILE
 CROSS_COMPILER = $(CROSS_COMPILE)
 endif
@@ -12,7 +20,7 @@ endif
 HAS_NUMA=$(shell sh tools/scripts/numa_test.sh)

 export CFLAGS += -Wall $(CROSS_CFLAGS)
-export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA
+export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA ARCH

 -include config.mk

diff --git a/testcases/kernel/syscalls/fallocate/Makefile 
b/testcases/kernel/syscalls/fallocate/Makefile
index d6016be..e16c722 100644
--- a/testcases/kernel/syscalls/fallocate/Makefile
+++ b/testcases/kernel/syscalls/fallocate/Makefile
@@ -20,8 +20,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp

+# This system call is suported in i386, x86_64 and ppc only.
+ifneq (,$(findstring $(ARCH), i386 x86_64 ppc))
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
+else
+SRCS    =
+TARGETS =
+endif

 all: $(TARGETS)

diff --git a/testcases/kernel/syscalls/set_thread_area/Makefile 
b/testcases/kernel/syscalls/set_thread_area/Makefile
index b5289a9..6342839 100644
--- a/testcases/kernel/syscalls/set_thread_area/Makefile
+++ b/testcases/kernel/syscalls/set_thread_area/Makefile
@@ -19,8 +19,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp

+# This system call is supported in i386 and x86_64 only.
+ifneq (,$(findstring $(ARCH), i386 x86_64))
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
+else
+SRCS    =
+TARGETS =
+endif

 all: $(TARGETS)

diff --git a/testcases/kernel/syscalls/sgetmask/Makefile 
b/testcases/kernel/syscalls/sgetmask/Makefile
index b5289a9..f684be8 100644
--- a/testcases/kernel/syscalls/sgetmask/Makefile
+++ b/testcases/kernel/syscalls/sgetmask/Makefile
@@ -19,8 +19,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp

+# This system call does not support x86_64.
+ifeq (,$(findstring $(ARCH),x86_64))
 SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS))
+else
+SRCS    =
+TARGETS =
+endif

 all: $(TARGETS)

-- 
1.6.3.1


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to