mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin Schaffner" <schaffner@gmx.li>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.4.23, 2.6.0-test11] avoid the use of unportable "expr length"
Date: Tue, 9 Dec 2003 14:31:30 +0100 (MET)	[thread overview]
Message-ID: <14502.1070976690@www62.gmx.net> (raw)

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



                 reply	other threads:[~2003-12-09 13:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14502.1070976690@www62.gmx.net \
    --to=schaffner@gmx.li \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®