linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.4.23, 2.6.0-test11] avoid the use of unportable "expr length"
@ 2003-12-09 13:31 Martin Schaffner
  0 siblings, 0 replies; only message in thread
From: Martin Schaffner @ 2003-12-09 13:31 UTC (permalink / raw)
  To: linux-kernel

Hi!

I tried to cross-compile from Mac OS X, which failed because the Makefile
uses the "length" feature of GNU expr, which is not found in BSD expr. Here's a
fix.

Please CC me when replying.

--- a/Makefile	2003-12-09 13:54:50.000000000 +0100
+++ b/Makefile	2003-12-09 13:56:39.000000000 +0100
@@ -640,7 +640,7 @@
 uts_len := 64
 
 define filechk_version.h
-	if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
+	if expr "$(KERNELRELEASE)" : '.*' \> $(uts_len) >/dev/null ; then \
 	  echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
 	  exit 1; \
 	fi; \


--- a/Makefile   2003-12-09 14:27:56.000000000 +0100
+++ b/Makefile   2003-12-09 14:28:37.000000000 +0100
@@ -353,7 +353,7 @@
        @rm -f .ver1

 include/linux/version.h: ./Makefile
-       @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \
+       @expr "$(KERNELRELEASE)" : '.*' \<= $(uts_len) > /dev/null || \
          (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len)
characters >&2; false)
        @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver
        @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 +
$(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-09 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-09 13:31 [PATCH 2.4.23, 2.6.0-test11] avoid the use of unportable "expr length" Martin Schaffner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).