From: Sebastian Huber Date: Wed, 9 Mar 2022 06:46:13 +0000 (+0100) Subject: build: Avoid length() awk function X-Git-Tag: cygwin-3.4.0~462 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=332df71d3491f4f1024b14e2999cec4db13d4b39;p=newlib-cygwin.git 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 --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; \