From 7f508ca2c6c13b5f07c0ac6a0caa035f27bb7603 Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Thu, 28 Jul 2022 17:39:17 +0800 Subject: [PATCH] Fix `hookmethod=auto` does not work on some mac monterey, issue #464 Keep finding `sw_vers` POSIX. --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index a2a0a27..e35c0ad 100755 --- a/configure +++ b/configure @@ -215,8 +215,7 @@ check_define __APPLE__ && { 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 + if [ "$hookmethod" = auto ] && [ -f "/usr/bin/sw_vers" ] ; then osver=`sw_vers | grep -i productver | awk '{print $2}' | awk -F. '{print $1}'` test "$osver" -ge 12 && hookmethod=dyld fi