[Cbe-oss-dev] [PATCH] libspe: fix non-POSIX shellisms in Makefile

Jeremy Kerr jk at ozlabs.org
Wed May 2 14:39:26 EST 2007


Testing should be done with =, not ==, and the two uses of == in
make.defines are unnecessary.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

 Makefile     |    8 ++++----
 make.defines |    5 ++---
 2 files changed, 6 insertions(+), 7 deletions(-)

Index: libspe2/Makefile
===================================================================
--- libspe2.orig/Makefile
+++ libspe2/Makefile
@@ -106,10 +106,10 @@ SPEC	 ?= $(PACKAGE).spec
 RPMBUILD ?= rpmbuild
 
 checkenv:
-	@if [ ""x == "$(PACKAGE)"x \
-	  -o ""x == "$(SOURCEFILES)"x \
-	  -o ""x == "$(SPEC)"x ] ; then \
-	  	echo "inconsistant make file" false; fi
+	@if [ ""x = "$(PACKAGE)"x \
+	  -o ""x = "$(SOURCEFILES)"x \
+	  -o ""x = "$(SPEC)"x ] ; then \
+		echo "inconsistant make file" false; fi
 
 $(PWD)/.rpmmacros:
 	mkdir -p $(SOURCES) $(RPMS) $(SRPMS) $(BUILD)
Index: libspe2/make.defines
===================================================================
--- libspe2.orig/make.defines
+++ libspe2/make.defines
@@ -18,10 +18,9 @@
 #*
 
 
-X86 = $(shell if [ "`uname -m | grep  ppc`" == "" ] ; then echo 1 ; fi)
+X86 = $(shell if ! uname -m | grep ppc ; then echo 1 ; fi)
 
-CROSS_COMPILE = $(shell if [ "`cat /proc/cpuinfo | grep Broadband`" == "" ] ; \
-		  then echo 1 ; fi)
+CROSS_COMPILE = $(shell if ! grep Broadband /proc/cpuinfo ; then echo 1 ; fi)
 
 ifeq "$(X86)"  "1"
     CROSS	?= /opt/cell/bin/ppu-



More information about the cbe-oss-dev mailing list