Make a bunch of client tests cross compiling for arm platform.

Signed-off-by: "Olof Johansson" <ol...@chromium.org>

M: client/tests/interbench/interbench.py
A: client/tests/interbench/makefile.patch
M: client/tests/memory_api/memory_api.py
M: client/tests/fsfuzzer/fsfuzzer.py
A: client/tests/fsfuzzer/makefile.patch
M: client/tests/tiobench/tiobench.py
M: client/tests/tiobench/makefile.patch
M: client/tests/rmaptest/rmaptest.py
M: client/tests/lmbench/lmbench.py
A: client/tests/lmbench/0003-makefile.patch
M: client/tests/fsstress/fsstress.py
A: client/tests/fsstress/makefile.patch
M: client/tests/linus_stress/linus_stress.py
M: client/tests/iozone/iozone.py
A: client/tests/iozone/makefile.patch
A: client/tests/signaltest/src/Makefile
M: client/tests/bash_shared_mapping/bash_shared_mapping.py
A: client/tests/bash_shared_mapping/makefile.patch

Index: client/tests/interbench/interbench.py
===================================================================
--- client/tests/interbench/interbench.py (revision 5228)
+++ client/tests/interbench/interbench.py (working copy)
@@ -14,6 +14,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make()


Index: client/tests/interbench/makefile.patch
===================================================================
--- client/tests/interbench/makefile.patch (revision 0)
+++ client/tests/interbench/makefile.patch (revision 0)
@@ -0,0 +1,8 @@
+--- interbench-0.30/Makefile.orig 2011-02-07 19:56:51.000000000 -0800
++++ interbench-0.30/Makefile 2011-02-07 19:57:15.000000000 -0800
+@@ -1,4 +1,4 @@
+-CC=gcc
++CC ?= gcc
+ CFLAGS=-W -Wall -g -O2 -s -pipe
+ LDFLAGS=-lrt -lm
+
Index: client/tests/memory_api/memory_api.py
===================================================================
--- client/tests/memory_api/memory_api.py (revision 5228)
+++ client/tests/memory_api/memory_api.py (working copy)
@@ -6,11 +6,14 @@
     version = 1

     def setup(self):
-        utils.system("gcc %s -o %s" %
-                      (os.path.join(self.bindir, "memory_api.c"),
+        os.mkdir(self.tmpdir)
+        utils.system("%s %s -o %s" %
+                      (utils.get_cc(),
+                       os.path.join(self.bindir, "memory_api.c"),
                        os.path.join(self.tmpdir, "memory_api")))
-        utils.system("gcc %s -o %s" %
-                      (os.path.join(self.bindir, "mremaps.c"),
+        utils.system("%s %s -o %s" %
+                      (utils.get_cc(),
+                       os.path.join(self.bindir, "mremaps.c"),
                        os.path.join(self.tmpdir, "mremaps")))


Index: client/tests/fsfuzzer/fsfuzzer.py
===================================================================
--- client/tests/fsfuzzer/fsfuzzer.py (revision 5228)
+++ client/tests/fsfuzzer/fsfuzzer.py (working copy)
@@ -14,7 +14,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
-
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make()


Index: client/tests/fsfuzzer/makefile.patch
===================================================================
--- client/tests/fsfuzzer/makefile.patch (revision 0)
+++ client/tests/fsfuzzer/makefile.patch (revision 0)
@@ -0,0 +1,11 @@
+--- fsfuzzer-0.6/Makefile.orig 2011-02-07 19:48:48.000000000 -0800
++++ fsfuzzer-0.6/Makefile 2011-02-07 19:48:57.000000000 -0800
+@@ -15,7 +15,7 @@
+ CFLAGS=-g -W -Wall -Wundef
+ LIBS=
+ all:
+- gcc $(CFLAGS) mangle.c -o mangle $(LIBS)
++ $(CC) $(CFLAGS) mangle.c -o mangle $(LIBS)
+
+ clean:
+ rm -f mangle *.o
Index: client/tests/tiobench/tiobench.py
===================================================================
--- client/tests/tiobench/tiobench.py (revision 5228)
+++ client/tests/tiobench/tiobench.py (working copy)
@@ -10,7 +10,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
-
+        utils.system('patch -p1 < ../makefile.patch')
         utils.system('make')


Index: client/tests/tiobench/makefile.patch
===================================================================
--- client/tests/tiobench/makefile.patch (revision 0)
+++ client/tests/tiobench/makefile.patch (revision 0)
@@ -0,0 +1,19 @@
+--- tiobench-0.3.3/Makefile.orig 2011-02-07 20:32:53.000000000 -0800
++++ tiobench-0.3.3/Makefile 2011-02-07 20:33:02.000000000 -0800
+@@ -1,6 +1,6 @@
+ # Makefile for tiotest
+
+-CC=gcc
++CC?=gcc
+ #CFLAGS=-O3 -fomit-frame-pointer -Wall
+ CFLAGS=-O2 -Wall
+
+@@ -14,7 +14,7 @@ CFLAGS=-O2 -Wall
+
+ #DEFINES=
+
+-LINK=gcc
++LINK=$(CC)
+ EXE=tiotest
+ PROJECT=tiobench
+ # do it once instead of each time referenced
Index: client/tests/rmaptest/rmaptest.py
===================================================================
--- client/tests/rmaptest/rmaptest.py (revision 5228)
+++ client/tests/rmaptest/rmaptest.py (working copy)
@@ -21,7 +21,7 @@

     def setup(self):
         os.chdir(self.srcdir)
-        utils.system('gcc -Wall -o rmaptest rmap-test.c')
+        utils.system(utils.get_cc() + ' -Wall -o rmaptest rmap-test.c')


     def execute(self, args = ''):
Index: client/tests/lmbench/lmbench.py
===================================================================
--- client/tests/lmbench/lmbench.py (revision 5228)
+++ client/tests/lmbench/lmbench.py (working copy)
@@ -30,8 +30,10 @@
         os.chdir(self.srcdir)
         p1 = 'patch -p1 < ../0001-Fix-build-issues-with-lmbench.patch'
         p2 = 'patch -p1 <
../0002-Changing-shebangs-on-lmbench-scripts.patch'
+        p3 = 'patch -p1 < ../0003-makefile.patch'
         utils.system(p1)
         utils.system(p2)
+        utils.system(p3)

         # build lmbench
         utils.make()
Index: client/tests/lmbench/0003-makefile.patch
===================================================================
--- client/tests/lmbench/0003-makefile.patch (revision 0)
+++ client/tests/lmbench/0003-makefile.patch (revision 0)
@@ -0,0 +1,14 @@
+--- lmbench3/src/Makefile.orig 2011-02-07 20:17:46.000000000 -0800
++++ lmbench3/src/Makefile 2011-02-07 20:18:02.000000000 -0800
+@@ -34,9 +34,9 @@
+ # I finally know why Larry Wall's Makefile says "Grrrr".
+ SHELL=/bin/sh
+
+-CC=`../scripts/compiler`
++CC ?= `../scripts/compiler`
+ MAKE=`../scripts/make`
+-AR=ar
++AR ?= ar
+ ARCREATE=cr
+
+ # base of installation location
Index: client/tests/fsstress/fsstress.py
===================================================================
--- client/tests/fsstress/fsstress.py (revision 5228)
+++ client/tests/fsstress/fsstress.py (working copy)
@@ -16,6 +16,7 @@

         os.chdir(self.srcdir)
         utils.system('patch -p1 < ../fsstress-ltp.patch')
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make('fsstress')


Index: client/tests/fsstress/makefile.patch
===================================================================
--- client/tests/fsstress/makefile.patch (revision 0)
+++ client/tests/fsstress/makefile.patch (revision 0)
@@ -0,0 +1,9 @@
+--- ext3-tools/Makefile.orig 2011-02-07 15:52:18.000000000 -0800
++++ ext3-tools/Makefile 2011-02-07 15:52:23.000000000 -0800
+@@ -1,5 +1,5 @@
+
+-CC = gcc
++CC ?= gcc
+ CFLAGS += -O -Wall -g -DAIO
+ CXXFLAGS+= -O -Wall -g
+
Index: client/tests/linus_stress/linus_stress.py
===================================================================
--- client/tests/linus_stress/linus_stress.py (revision 5228)
+++ client/tests/linus_stress/linus_stress.py (working copy)
@@ -10,7 +10,7 @@
         os.chdir(self.bindir)
         utils.system('cp linus_stress.c src/')
         os.chdir(self.srcdir)
-        utils.system('cc linus_stress.c -D_POSIX_C_SOURCE=200112 -o
linus_stress')
+        utils.system(utils.get_cc() + ' linus_stress.c
-D_POSIX_C_SOURCE=200112 -o linus_stress')


     def initialize(self):
Index: client/tests/iozone/iozone.py
===================================================================
--- client/tests/iozone/iozone.py (revision 5228)
+++ client/tests/iozone/iozone.py (working copy)
@@ -34,6 +34,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(os.path.join(self.srcdir, 'src/current'))
+        utils.system('patch -p3 < ../../../makefile.patch')

         arch = utils.get_current_kernel_arch()
         if (arch == 'ppc'):
Index: client/tests/iozone/makefile.patch
===================================================================
--- client/tests/iozone/makefile.patch (revision 0)
+++ client/tests/iozone/makefile.patch (revision 0)
@@ -0,0 +1,15 @@
+--- iozone3_347/src/current/makefile.orig 2011-02-07 20:00:02.000000000
-0800
++++ iozone3_347/src/current/makefile 2011-02-07 20:01:03.000000000 -0800
+@@ -9,9 +9,9 @@
+ # convex, FreeBSD, OpenBSD, OSFV3, OSFV4, OSFV5, SCO
+ # SCO_Unixware_gcc,NetBSD,TRU64, Mac OS X
+
+-CC = cc
+-C89 = c89
+-GCC = gcc
++CC ?= cc
++C89 ?= c89
++GCC ?= gcc
+ CCS = /usr/ccs/bin/cc
+ NACC = /opt/ansic/bin/cc
+ CFLAGS =
Index: client/tests/signaltest/src/Makefile
===================================================================
--- client/tests/signaltest/src/Makefile (revision 5228)
+++ client/tests/signaltest/src/Makefile (working copy)
@@ -1,10 +1,11 @@

+CC ?= $(CROSS_COMPILE)gcc
 TARGET=signaltest
 FLAGS= -Wall -O2
 LIBS = -lpthread -lrt

 all: signaltest.c
- $(CROSS_COMPILE)gcc $(FLAGS) $^ -o $(TARGET) $(LIBS)
+ $(CC) $(FLAGS) $^ -o $(TARGET) $(LIBS)

 clean:
  rm -f $(TARGET) *.o .depend *.*~
Index: client/tests/bash_shared_mapping/bash_shared_mapping.py
===================================================================
--- client/tests/bash_shared_mapping/bash_shared_mapping.py (revision 5228)
+++ client/tests/bash_shared_mapping/bash_shared_mapping.py (working copy)
@@ -10,6 +10,7 @@
         utils.extract_tarball_to_dir(self.tarball, self.srcdir)

         os.chdir(self.srcdir)
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make('bash-shared-mapping usemem')


Index: client/tests/bash_shared_mapping/makefile.patch
===================================================================
--- client/tests/bash_shared_mapping/makefile.patch (revision 0)
+++ client/tests/bash_shared_mapping/makefile.patch (revision 0)
@@ -0,0 +1,8 @@
+--- ext3-tools/Makefile.orig 2011-02-07 15:52:18.000000000 -0800
++++ ext3-tools/Makefile 2011-02-07 15:52:23.000000000 -0800
+@@ -1,5 +1,5 @@
+
+-CC = gcc
++CC ?= gcc
+ CFLAGS += -O -Wall -g -DAIO
+ CXXFLAGS+= -O -Wall -g


-- 
Eric Li
李咏竹
Google Kirkland
Index: client/tests/interbench/interbench.py
===================================================================
--- client/tests/interbench/interbench.py       (revision 5228)
+++ client/tests/interbench/interbench.py       (working copy)
@@ -14,6 +14,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make()
 
 
Index: client/tests/interbench/makefile.patch
===================================================================
--- client/tests/interbench/makefile.patch      (revision 0)
+++ client/tests/interbench/makefile.patch      (revision 0)
@@ -0,0 +1,8 @@
+--- interbench-0.30/Makefile.orig      2011-02-07 19:56:51.000000000 -0800
++++ interbench-0.30/Makefile   2011-02-07 19:57:15.000000000 -0800
+@@ -1,4 +1,4 @@
+-CC=gcc
++CC ?= gcc
+ CFLAGS=-W -Wall -g -O2 -s -pipe
+ LDFLAGS=-lrt -lm
+ 
Index: client/tests/memory_api/memory_api.py
===================================================================
--- client/tests/memory_api/memory_api.py       (revision 5228)
+++ client/tests/memory_api/memory_api.py       (working copy)
@@ -6,11 +6,14 @@
     version = 1
 
     def setup(self):
-        utils.system("gcc %s -o %s" %
-                      (os.path.join(self.bindir, "memory_api.c"),
+        os.mkdir(self.tmpdir)
+        utils.system("%s %s -o %s" %
+                      (utils.get_cc(),
+                       os.path.join(self.bindir, "memory_api.c"),
                        os.path.join(self.tmpdir, "memory_api")))
-        utils.system("gcc %s -o %s" %
-                      (os.path.join(self.bindir, "mremaps.c"),
+        utils.system("%s %s -o %s" %
+                      (utils.get_cc(),
+                       os.path.join(self.bindir, "mremaps.c"),
                        os.path.join(self.tmpdir, "mremaps")))
 
 
Index: client/tests/fsfuzzer/fsfuzzer.py
===================================================================
--- client/tests/fsfuzzer/fsfuzzer.py   (revision 5228)
+++ client/tests/fsfuzzer/fsfuzzer.py   (working copy)
@@ -14,7 +14,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
-
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make()
 
 
Index: client/tests/fsfuzzer/makefile.patch
===================================================================
--- client/tests/fsfuzzer/makefile.patch        (revision 0)
+++ client/tests/fsfuzzer/makefile.patch        (revision 0)
@@ -0,0 +1,11 @@
+--- fsfuzzer-0.6/Makefile.orig 2011-02-07 19:48:48.000000000 -0800
++++ fsfuzzer-0.6/Makefile      2011-02-07 19:48:57.000000000 -0800
+@@ -15,7 +15,7 @@
+ CFLAGS=-g -W -Wall -Wundef
+ LIBS=
+ all:
+-      gcc $(CFLAGS) mangle.c -o mangle $(LIBS)
++      $(CC) $(CFLAGS) mangle.c -o mangle $(LIBS)
+ 
+ clean:
+       rm -f mangle *.o
Index: client/tests/tiobench/tiobench.py
===================================================================
--- client/tests/tiobench/tiobench.py   (revision 5228)
+++ client/tests/tiobench/tiobench.py   (working copy)
@@ -10,7 +10,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
-
+        utils.system('patch -p1 < ../makefile.patch')
         utils.system('make')
 
 
Index: client/tests/tiobench/makefile.patch
===================================================================
--- client/tests/tiobench/makefile.patch        (revision 0)
+++ client/tests/tiobench/makefile.patch        (revision 0)
@@ -0,0 +1,19 @@
+--- tiobench-0.3.3/Makefile.orig       2011-02-07 20:32:53.000000000 -0800
++++ tiobench-0.3.3/Makefile    2011-02-07 20:33:02.000000000 -0800
+@@ -1,6 +1,6 @@
+ # Makefile for tiotest
+ 
+-CC=gcc
++CC?=gcc
+ #CFLAGS=-O3 -fomit-frame-pointer -Wall
+ CFLAGS=-O2 -Wall
+ 
+@@ -14,7 +14,7 @@ CFLAGS=-O2 -Wall
+ 
+ #DEFINES=
+ 
+-LINK=gcc
++LINK=$(CC)
+ EXE=tiotest
+ PROJECT=tiobench
+ # do it once instead of each time referenced
Index: client/tests/rmaptest/rmaptest.py
===================================================================
--- client/tests/rmaptest/rmaptest.py   (revision 5228)
+++ client/tests/rmaptest/rmaptest.py   (working copy)
@@ -21,7 +21,7 @@
 
     def setup(self):
         os.chdir(self.srcdir)
-        utils.system('gcc -Wall -o rmaptest rmap-test.c')
+        utils.system(utils.get_cc() + ' -Wall -o rmaptest rmap-test.c')
 
 
     def execute(self, args = ''):
Index: client/tests/lmbench/lmbench.py
===================================================================
--- client/tests/lmbench/lmbench.py     (revision 5228)
+++ client/tests/lmbench/lmbench.py     (working copy)
@@ -30,8 +30,10 @@
         os.chdir(self.srcdir)
         p1 = 'patch -p1 < ../0001-Fix-build-issues-with-lmbench.patch'
         p2 = 'patch -p1 < ../0002-Changing-shebangs-on-lmbench-scripts.patch'
+        p3 = 'patch -p1 < ../0003-makefile.patch'
         utils.system(p1)
         utils.system(p2)
+        utils.system(p3)
 
         # build lmbench
         utils.make()
Index: client/tests/lmbench/0003-makefile.patch
===================================================================
--- client/tests/lmbench/0003-makefile.patch    (revision 0)
+++ client/tests/lmbench/0003-makefile.patch    (revision 0)
@@ -0,0 +1,14 @@
+--- lmbench3/src/Makefile.orig 2011-02-07 20:17:46.000000000 -0800
++++ lmbench3/src/Makefile      2011-02-07 20:18:02.000000000 -0800
+@@ -34,9 +34,9 @@
+ # I finally know why Larry Wall's Makefile says "Grrrr".
+ SHELL=/bin/sh
+ 
+-CC=`../scripts/compiler`
++CC ?= `../scripts/compiler`
+ MAKE=`../scripts/make`
+-AR=ar
++AR ?= ar
+ ARCREATE=cr
+ 
+ # base of installation location
Index: client/tests/fsstress/fsstress.py
===================================================================
--- client/tests/fsstress/fsstress.py   (revision 5228)
+++ client/tests/fsstress/fsstress.py   (working copy)
@@ -16,6 +16,7 @@
 
         os.chdir(self.srcdir)
         utils.system('patch -p1 < ../fsstress-ltp.patch')
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make('fsstress')
 
 
Index: client/tests/fsstress/makefile.patch
===================================================================
--- client/tests/fsstress/makefile.patch        (revision 0)
+++ client/tests/fsstress/makefile.patch        (revision 0)
@@ -0,0 +1,9 @@
+--- ext3-tools/Makefile.orig   2011-02-07 15:52:18.000000000 -0800
++++ ext3-tools/Makefile        2011-02-07 15:52:23.000000000 -0800
+@@ -1,5 +1,5 @@
+ 
+-CC    =       gcc
++CC    ?=      gcc
+ CFLAGS        +=      -O -Wall -g -DAIO
+ CXXFLAGS+=    -O -Wall -g
+ 
Index: client/tests/linus_stress/linus_stress.py
===================================================================
--- client/tests/linus_stress/linus_stress.py   (revision 5228)
+++ client/tests/linus_stress/linus_stress.py   (working copy)
@@ -10,7 +10,7 @@
         os.chdir(self.bindir)
         utils.system('cp linus_stress.c src/')
         os.chdir(self.srcdir)
-        utils.system('cc linus_stress.c -D_POSIX_C_SOURCE=200112 -o 
linus_stress')
+        utils.system(utils.get_cc() + ' linus_stress.c 
-D_POSIX_C_SOURCE=200112 -o linus_stress')
 
 
     def initialize(self):
Index: client/tests/iozone/iozone.py
===================================================================
--- client/tests/iozone/iozone.py       (revision 5228)
+++ client/tests/iozone/iozone.py       (working copy)
@@ -34,6 +34,7 @@
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(os.path.join(self.srcdir, 'src/current'))
+        utils.system('patch -p3 < ../../../makefile.patch')
 
         arch = utils.get_current_kernel_arch()
         if (arch == 'ppc'):
Index: client/tests/iozone/makefile.patch
===================================================================
--- client/tests/iozone/makefile.patch  (revision 0)
+++ client/tests/iozone/makefile.patch  (revision 0)
@@ -0,0 +1,15 @@
+--- iozone3_347/src/current/makefile.orig      2011-02-07 20:00:02.000000000 
-0800
++++ iozone3_347/src/current/makefile   2011-02-07 20:01:03.000000000 -0800
+@@ -9,9 +9,9 @@
+ #             convex, FreeBSD, OpenBSD, OSFV3, OSFV4, OSFV5, SCO
+ #             SCO_Unixware_gcc,NetBSD,TRU64, Mac OS X
+ 
+-CC    = cc
+-C89   = c89
+-GCC   = gcc
++CC    ?= cc
++C89   ?= c89
++GCC   ?= gcc
+ CCS   = /usr/ccs/bin/cc
+ NACC  = /opt/ansic/bin/cc
+ CFLAGS        =
Index: client/tests/signaltest/src/Makefile
===================================================================
--- client/tests/signaltest/src/Makefile        (revision 5228)
+++ client/tests/signaltest/src/Makefile        (working copy)
@@ -1,10 +1,11 @@
 
+CC ?= $(CROSS_COMPILE)gcc
 TARGET=signaltest
 FLAGS= -Wall -O2 
 LIBS = -lpthread -lrt
 
 all: signaltest.c
-       $(CROSS_COMPILE)gcc $(FLAGS) $^ -o $(TARGET) $(LIBS)
+       $(CC) $(FLAGS) $^ -o $(TARGET) $(LIBS)
 
 clean:
        rm -f $(TARGET) *.o .depend *.*~
Index: client/tests/bash_shared_mapping/bash_shared_mapping.py
===================================================================
--- client/tests/bash_shared_mapping/bash_shared_mapping.py     (revision 5228)
+++ client/tests/bash_shared_mapping/bash_shared_mapping.py     (working copy)
@@ -10,6 +10,7 @@
         utils.extract_tarball_to_dir(self.tarball, self.srcdir)
 
         os.chdir(self.srcdir)
+        utils.system('patch -p1 < ../makefile.patch')
         utils.make('bash-shared-mapping usemem')
 
 
Index: client/tests/bash_shared_mapping/makefile.patch
===================================================================
--- client/tests/bash_shared_mapping/makefile.patch     (revision 0)
+++ client/tests/bash_shared_mapping/makefile.patch     (revision 0)
@@ -0,0 +1,8 @@
+--- ext3-tools/Makefile.orig   2011-02-07 15:52:18.000000000 -0800
++++ ext3-tools/Makefile        2011-02-07 15:52:23.000000000 -0800
+@@ -1,5 +1,5 @@
+ 
+-CC    =       gcc
++CC    ?=      gcc
+ CFLAGS        +=      -O -Wall -g -DAIO
+ CXXFLAGS+=    -O -Wall -g
_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to