From d17e89bdfe093ff0b9b1050c1585a00e83b3c2a9 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Thu, 13 Nov 2025 05:03:02 +0900 Subject: [PATCH 1/3] build-gnu.sh: Use system's GNU tools --- util/build-gnu.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 75dfdb0358d..bd14348b1a1 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -8,21 +8,11 @@ set -e -# Use GNU version for make, nproc, readlink and sed on *BSD -case "$OSTYPE" in - *bsd*) - MAKE="gmake" - NPROC="gnproc" - READLINK="greadlink" - SED="gsed" - ;; - *) - MAKE="make" - NPROC="nproc" - READLINK="readlink" - SED="sed" - ;; -esac +# Use system's GNU version for make, nproc, readlink and sed on *BSD +MAKE=$(command -v gmake||command -v make) +NPROC=$(command -v gnproc||command -v nproc) +READLINK=$(command -v greadlink||command -v readlink) +SED=$(command -v gsed||command -v sed) ME="${0}" ME_dir="$(dirname -- "$("${READLINK}" -fm -- "${ME}")")" From 9887a3c9bb88fcc1c9fb2fc2f56c4c293a7f0c34 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Thu, 13 Nov 2025 06:13:43 +0900 Subject: [PATCH 2/3] build-gnu.sh: Cleanup logic for system bins --- util/build-gnu.sh | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index bd14348b1a1..e1388570a6d 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -39,24 +39,8 @@ path_GNU="$("${READLINK}" -fm -- "${path_GNU:-${path_UUTILS}/../gnu}")" ### -# On MacOS there is no system /usr/bin/timeout -# and trying to add it to /usr/bin (with symlink of copy binary) will fail unless system integrity protection is disabled (not ideal) -# ref: https://support.apple.com/en-us/102149 -# On MacOS the Homebrew coreutils could be installed and then "sudo ln -s /opt/homebrew/bin/timeout /usr/local/bin/timeout" -# Set to /usr/local/bin/timeout instead if /usr/bin/timeout is not found -SYSTEM_TIMEOUT="timeout" -if [ -x /usr/bin/timeout ]; then - SYSTEM_TIMEOUT="/usr/bin/timeout" -elif [ -x /usr/local/bin/timeout ]; then - SYSTEM_TIMEOUT="/usr/local/bin/timeout" -fi - -SYSTEM_YES="yes" -if [ -x /usr/bin/yes ]; then - SYSTEM_YES="/usr/bin/yes" -elif [ -x /usr/local/bin/yes ]; then - SYSTEM_YES="/usr/local/bin/yes" -fi +SYSTEM_TIMEOUT=$(command -v timeout) +SYSTEM_YES=$(command -v yes) ### From 44ae621296b0be76c15b425530b56838dec9f6cc Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Thu, 13 Nov 2025 06:51:07 +0900 Subject: [PATCH 3/3] show-utils.sh use GNU realpath --- util/show-utils.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/util/show-utils.sh b/util/show-utils.sh index 0a41698d930..3cc48794030 100755 --- a/util/show-utils.sh +++ b/util/show-utils.sh @@ -5,14 +5,7 @@ # spell-checker:ignore (jq) deps startswith # Use GNU version for realpath on *BSD -case "$OSTYPE" in - *bsd*) - REALPATH="grealpath" - ;; - *) - REALPATH="realpath" - ;; -esac +REALPATH=$(command -v grealpath||command -v realpath) ME="${0}" ME_dir="$(dirname -- "${ME}")"