diff mbox

[Autotest] client test - perfmon: Patch the source code of perfmon to remove the -Werror switch

Message ID 20100527093028.7588.38561.stgit@dhcp-91-198.nay.redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cao, Chen May 27, 2010, 9:32 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/perfmon/perfmon.py b/client/tests/perfmon/perfmon.py
index ec1145f..39c6fb2 100644
--- a/client/tests/perfmon/perfmon.py
+++ b/client/tests/perfmon/perfmon.py
@@ -10,6 +10,14 @@  class perfmon(test.test):
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
+        # Apply the patch to remove the -Werror switch,
+        # because there are warnings while compiling,
+        # if the compiler sticks to the rules, the source building
+        # will fail, although it seems that fedora and rhel ignore
+        # these warnings.
+        p1 = 'patch -p1 < ../remove-werror-switch.patch'
+        utils.system(p1)
+
         utils.system('make')
 
 
diff --git a/client/tests/perfmon/remove-werror-switch.patch b/client/tests/perfmon/remove-werror-switch.patch
new file mode 100644
index 0000000..6a5062c
--- /dev/null
+++ b/client/tests/perfmon/remove-werror-switch.patch
@@ -0,0 +1,55 @@ 
+diff --git a/Makefile b/Makefile
+index 6ba6fba..884274d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,6 +28,7 @@ TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
+ include config.mk
+ 
+ DIRS=tests
++PATCHNAME=remove-libpfm-werror.patch
+ 
+ all:  libpfm
+ 	@echo Compiling for \'$(ARCH)\' target
+@@ -36,6 +37,7 @@ all:  libpfm
+ libpfm:
+ 	@echo Compiling $(LIBPFM)
+ 	@tar zxf $(LIBPFM).tar.gz
++	@(cd $(LIBPFM) && patch -p1 < ../$(PATCHNAME) && cd ..)
+ 	@ln -sf $(LIBPFM) libpfm
+ 	@$(MAKE) -C $(LIBPFM) lib
+ clean: 
+diff --git a/config.mk b/config.mk
+index a110111..7321f2d 100644
+--- a/config.mk
++++ b/config.mk
+@@ -163,7 +163,7 @@ INSTALL=install
+ LN=ln -sf
+ PFMINCDIR=$(TOPDIR)/libpfm/include
+ PFMLIBDIR=$(TOPDIR)/libpfm/lib
+-DBG?=-g -Wall -Werror
++DBG?=-g -Wall
+ # gcc/mips64 bug
+ ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
+ OPTIM?=-O
+diff --git a/remove-libpfm-werror.patch b/remove-libpfm-werror.patch
+new file mode 100644
+index 0000000..252aaa0
+--- /dev/null
++++ b/remove-libpfm-werror.patch
+@@ -0,0 +1,13 @@
++diff --git a/config.mk b/config.mk
++index 8c76f59..bbf1fc0 100644
++--- a/config.mk
+++++ b/config.mk
++@@ -164,7 +164,7 @@ INSTALL=install
++ LN=ln -sf
++ PFMINCDIR=$(TOPDIR)/include
++ PFMLIBDIR=$(TOPDIR)/lib
++-DBG?=-g -Wall -Werror
+++DBG?=-g -Wall
++ # gcc/mips64 bug
++ ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
++ OPTIM?=-O
+-- 
+1.7.0.4
+