From 7efbf9f0774b6fb4bf5f7fbaf6e53b02963bd791 Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Wed, 27 Jul 2022 02:10:19 +0800 Subject: [PATCH] Fix `hookmethod=auto` does not work on some mac monterey, issue #464 Related issue #409. --- configure | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure b/configure index 6d7107c..a2a0a27 100755 --- a/configure +++ b/configure @@ -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__ && {