Fix `hookmethod=auto` does not work on some mac monterey, issue #464

Related issue #409.
pull/465/head
Gavin Chou 2022-07-27 02:10:19 +08:00
parent 060801d8c8
commit 7efbf9f077
1 changed files with 6 additions and 0 deletions

6
configure vendored
View File

@ -214,6 +214,12 @@ check_define __APPLE__ && {
osver=$(get_define_stripped __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 2>/dev/null)
test "$osver" -gt $((120000 - 1)) && hookmethod=dyld
fi
# The above check is not sufficient, check out issue #464 for more detail.
has_sw_vers=`which sw_vers 2>/dev/null`
if [ "$hookmethod" = auto ] && [ "$has_sw_vers" ] ; then
osver=`sw_vers | grep -i productver | awk '{print $2}' | awk -F. '{print $1}'`
test "$osver" -ge 12 && hookmethod=dyld
fi
}
check_define __FreeBSD__ && bsd_detected=true
check_define __OpenBSD__ && {