Skip to content

Commit

Permalink
configure: OSX/macos: autodetect new_macho value
Browse files Browse the repository at this point in the history
Use old (=no) if autodetect succeeded and osx ver <= 10, else new.
Override is possible, and now also documented at ./configure --help.
  • Loading branch information
avih committed Mar 18, 2023
1 parent 4dc4e93 commit e215235
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e215235

Please sign in to comment.