public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] build: Avoid length() awk function
@ 2022-03-09 11:05 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2022-03-09 11:05 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=332df71d3491f4f1024b14e2999cec4db13d4b39

commit 332df71d3491f4f1024b14e2999cec4db13d4b39
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date:   Wed Mar 9 07:46:13 2022 +0100

    build: Avoid length() awk function
    
    Some awk implementations such as old versions of mawk do not support the
    length() function.  Use the return value of the POSIX split() function instead.

Diff:
---
 newlib/Makefile.am | 4 ++--
 newlib/Makefile.in | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index ba0a3822f..81719660c 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -93,8 +93,8 @@ CLEANFILES += libg.a
 ## https://sourceware.org/PR28917
 AWK_UNIQUE_OBJS = $(AWK) '{ \
   for (i = NF; i > 0; --i) { \
-    split($$i, parts, "/"); \
-    name = parts[length(parts)]; \
+    count = split($$i, parts, "/"); \
+    name = parts[count]; \
     if (!(name in seen)) { \
       objs[i] = $$i; \
       seen[name] = 1; \
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index e0deacb61..7de777879 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -1380,8 +1380,8 @@ toollib_LIBRARIES = libm.a \
 toollib_DATA = $(CRT0) $(CRT1)
 AWK_UNIQUE_OBJS = $(AWK) '{ \
   for (i = NF; i > 0; --i) { \
-    split($$i, parts, "/"); \
-    name = parts[length(parts)]; \
+    count = split($$i, parts, "/"); \
+    name = parts[count]; \
     if (!(name in seen)) { \
       objs[i] = $$i; \
       seen[name] = 1; \


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

only message in thread, other threads:[~2022-03-09 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-09 11:05 [newlib-cygwin] build: Avoid length() awk function Sebastian Huber

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 read-only IMAP folder(s) and NNTP newsgroup(s).