Michael Cho c4695307e4
shims/mac/super/m4: use gm4 if missing m4 (e.g. Xcode 15.3 CLT)
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-31 19:29:56 -04:00

20 lines
590 B
Bash
Executable File

#!/bin/bash
# This shim is a workaround for the missing `m4` in Xcode CLT 15.3.
# It can be removed after Apple provides a new CLT with a fix for FB13679972.
# See https://github.com/Homebrew/homebrew-core/issues/165388
# HOMEBREW_LIBRARY is set by bin/brew
# HOMEBREW_DEVELOPER_DIR is set by extend/ENV/super.rb
# shellcheck disable=SC2154
source "${HOMEBREW_LIBRARY}/Homebrew/shims/utils.sh"
try_exec_non_system "${SHIM_FILE}" "$@"
if [[ -n "${HOMEBREW_DEVELOPER_DIR}" && ! -x "${HOMEBREW_DEVELOPER_DIR}/usr/bin/m4" ]]
then
safe_exec "/usr/bin/gm4" "$@"
fi
exec "/usr/bin/m4" "$@"