From e21523529b81cd94410b1baed2c7000afc928b90 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sat, 18 Mar 2023 11:02:56 +0200 Subject: [PATCH] configure: OSX/macos: autodetect new_macho value Use old (=no) if autodetect succeeded and osx ver <= 10, else new. Override is possible, and now also documented at ./configure --help. --- configure | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 6fe82482..4d3e5fc9 100755 --- a/configure +++ b/configure @@ -71,6 +71,12 @@ case $targetos in cc=`readlink $cc || echo clang` tcc_usrinclude="`xcrun --show-sdk-path`/usr/include" DLLSUF=".dylib" + case $* in *--config-new_macho*) ;; *) + # if new_macho was not specified and (known) ver <= 10, use old (=no) + osxver=$(sw_vers -productVersion 2>/dev/null) # X.Y.Z + osxver=${osxver%%.*} # major version (or empty on sw_vers error) + [ "${osxver:-11}" -ge 11 ] || confvars="$confvars new_macho=no" + esac ;; Windows_NT|MINGW*|MSYS*|CYGWIN*) mingw32=yes @@ -351,7 +357,7 @@ Advanced options (experts only): --config-backtrace=no disable stack backtraces (with -run or -bt) --config-bcheck=no disable bounds checker (-b) --config-predefs=no do not compile tccdefs.h, instead just include - --config-new_macho=no Use apple old macho object format + --config-new_macho=no|yes Force apple object format (autodetect osx <= 10) --config-codesign Use codesign on apple to sign executables --dwarf=x Use dwarf debug info instead of stabs (x=2..5) EOF