From 0cae4399bd83c3e717098a0a5d3b0d0113b56eab Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 25 Oct 2020 23:31:47 -0700 Subject: [PATCH] Make awk script compatible with default Solaris /usr/bin/awk See #18950 --- configure | 7 ++++++- configure.in | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 2bc0107cfb..1d0a19b710 100755 --- a/configure +++ b/configure @@ -40857,7 +40857,12 @@ case "${host}" in ;; esac -dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '$0=="-arch" || $0=="-framework" || !seen[$0]++'; } +dedup_flags() +{ + printf "%s " "$@" | + awk 'BEGIN { RS=" "; ORS=" " } + { if ($0=="-arch" || $0=="-framework" || !seen[$0]++) print }' +} WX_CPPFLAGS=`dedup_flags "$CPPFLAGS"` WX_CFLAGS=`dedup_flags "$CFLAGS"` diff --git a/configure.in b/configure.in index f54c521523..60f8846056 100644 --- a/configure.in +++ b/configure.in @@ -8448,7 +8448,12 @@ dnl Also get rid of duplicates in the flags, which results in dramatically dnl shorter build logs and so is well worth it (but preserve some special dnl flags which are explicitly allowed to occur multiple times, as all their dnl occurrences must be preserved). -dedup_flags () { printf %s "$@" | awk -v RS=' +' -v ORS=' ' '$0=="-arch" || $0=="-framework" || !seen[[$0]]++'; } +dedup_flags() +{ + printf "%s " "$@" | + awk 'BEGIN { RS=" "; ORS=" " } + { if ($0=="-arch" || $0=="-framework" || !seen[[$0]]++) print }' +} WX_CPPFLAGS=`dedup_flags "$CPPFLAGS"` WX_CFLAGS=`dedup_flags "$CFLAGS"`