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)
This commit is contained in:
Howard Bussey 2023-09-16 16:37:24 -04:00 committed by Paul Koning
parent 90e4597aa9
commit 8ee2b90dc4

View file

@ -82,6 +82,7 @@ cmakeSFlag=
## MacOS workaround: MacOS has an older getopt installed in /usr/bin, brew ## MacOS workaround: MacOS has an older getopt installed in /usr/bin, brew
## has an updated version that installs in a custom place. ## 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 /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" [[ -d /usr/local/opt/coreutils/libexec/gnubin ]] && PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
getopt_prog= getopt_prog=
@ -292,7 +293,7 @@ if [[ "x${simhTopDir}" = x ]]; then
echo "Did this really happen?" echo "Did this really happen?"
exit 1 exit 1
else else
buildSubdir=$(${realpath} "${simhTopDir}/cmake/${buildSubdir}") buildSubdir=$(${realpath} "${simhTopDir}/cmake/")"/${buildSubdir}"
echo "${scriptName}: SIMH top-evel directory: ${simhTopDir}" echo "${scriptName}: SIMH top-evel directory: ${simhTopDir}"
echo "${scriptName}: Build directory: ${buildSubdir}" echo "${scriptName}: Build directory: ${buildSubdir}"
fi fi