From 64a81471013ea9bed9024a9b00db8ae5f58bd644 Mon Sep 17 00:00:00 2001 From: Howard Bussey Date: Sat, 16 Sep 2023 16:37:24 -0400 Subject: [PATCH] Fix apple silicon build problems Issue #294 - find gnu-getopt when installed by homebrew in /opt - invoke realpath only on known path components (needed for some realpath implementation(s)) (relevant when build-flavor directory does not yet exist) --- cmake/cmake-builder.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/cmake-builder.sh b/cmake/cmake-builder.sh index b58c84102..d75b1af64 100755 --- a/cmake/cmake-builder.sh +++ b/cmake/cmake-builder.sh @@ -83,6 +83,7 @@ cmakeSFlag= ## MacOS workaround: MacOS has an older getopt installed in /usr/bin, brew ## has an updated version that installs in a custom place. [[ -d /usr/local/opt/gnu-getopt/bin ]] && PATH="/usr/local/opt/gnu-getopt/bin:$PATH" +[[ -d /opt/homebrew/opt/gnu-getopt/bin ]] && PATH="/opt/homebrew/opt/gnu-getopt/bin:$PATH" [[ -d /usr/local/opt/coreutils/libexec/gnubin ]] && PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" getopt_prog= @@ -299,7 +300,7 @@ if [[ "x${simhTopDir}" = x ]]; then echo "Did this really happen?" exit 1 else - buildSubdir=$(${realpath} "${simhTopDir}/cmake/${buildSubdir}") + buildSubdir=$(${realpath} "${simhTopDir}/cmake/")"/${buildSubdir}" echo "${scriptName}: SIMH top-evel directory: ${simhTopDir}" echo "${scriptName}: Build directory: ${buildSubdir}" fi