diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2020-12-31 14:43:00 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2021-01-02 19:56:19 +0000 |
commit | 4a04f09dc7616ebe76ee71aa50eee54f1115f1f2 (patch) | |
tree | 7be74d466d91f4398541f10a38cdab04b82ed121 /gcc/config.gcc | |
parent | 5282e22f0e7f0d0d5ca2bdc4a952c0d383300eba (diff) | |
download | gcc-4a04f09dc7616ebe76ee71aa50eee54f1115f1f2.zip gcc-4a04f09dc7616ebe76ee71aa50eee54f1115f1f2.tar.gz gcc-4a04f09dc7616ebe76ee71aa50eee54f1115f1f2.tar.bz2 |
Darwin, Simplify headers 4/5 : Remove redundant headers.
The darwinN.h headers (with the sole exception of darwin7.h,
which contains a target macro definition) now only contain
values that set fall-backs for cross-compilations, these can
be provided from the config.gcc script which means we no longer
need the darwinN.h - so delete them.
gcc/ChangeLog:
* config.gcc: Compute default version information
from the configured target. Likewise defaults for
ld64.
* config/darwin10.h: Removed.
* config/darwin12.h: Removed.
* config/darwin9.h: Removed.
* config/rs6000/darwin8.h: Removed.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r-- | gcc/config.gcc | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index 70ecc51..b942e97 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -685,17 +685,47 @@ case ${target} in *-*-darwin*) tmake_file="t-darwin " tm_file="${tm_file} darwin.h" + darwin_os=`echo ${target} | sed 's/.*darwin\([0-9.]*\).*$/\1/'` + darwin_maj=`expr "$darwin_os" : '\([0-9]*\).*'` + macos_min=`expr "$darwin_os" : '[0-9]*\.\([0-9]*\).*'` + macos_maj=10 + if test x"${macos_min}" = x; then + macos_min=0 + fi + def_ld64=85.2 case ${target} in - *-*-darwin9*) - tm_file="${tm_file} darwin9.h" - ;; - *-*-darwin[1][01]*) - tm_file="${tm_file} darwin9.h darwin10.h" - ;; - *-*-darwin[1][2-9]* | *-*-darwin[2][0-9]*) - tm_file="${tm_file} darwin9.h darwin10.h darwin12.h" - ;; + # Darwin 4 to 19 correspond to macOS 10.0 to 10.15 + *-*-darwin[4-9]* | *-*-darwin1[0-9]*) + macos_min=`expr $darwin_maj - 4` + ;; + *-*-darwin20*) + # Darwin 20 corresponds to macOS 11. + macos_maj=11 + def_ld64=609.0 + ;; + *-*-darwin) + case ${cpu_type} in + aarch64) macos_maj=11 ;; + x86_64) macos_min=6 ;; + *) macos_min=5 ;; + esac + case ${host} in + *-*-darwin*) tm_defines="$tm_defines DARWIN_USE_KERNEL_VERS" ;; + *) + # If configuring a cross-compiler then we will have set some + # default above, but it is probably not what was intended. + echo "Warning: Using ${target} is only suitable for Darwin hosts" 1>&2 + echo "configure with an explicit target version" 1>&2 + ;; + esac + ;; + *) + echo "Error: configuring for an unreleased macOS version ${target}" 1>&2 + exit 1 + ;; esac + tm_defines="$tm_defines DEF_MIN_OSX_VERSION=\\\"${macos_maj}.${macos_min}\\\"" + tm_defines="$tm_defines DEF_LD64=\\\"${def_ld64}\\\"" tm_file="${tm_file} ${cpu_type}/darwin.h" tm_p_file="${tm_p_file} darwin-protos.h" target_gtfiles="$target_gtfiles \$(srcdir)/config/darwin.c" |