diff options
author | Torbjorn Granlund <tg@gmplib.org> | 2020-11-29 23:39:12 +0100 |
---|---|---|
committer | Torbjorn Granlund <tg@gmplib.org> | 2020-11-29 23:39:12 +0100 |
commit | 8a3ac5bc570189d6c7a8d932326a5eed6ab04d92 (patch) | |
tree | d6525368f15bdac436cb657d346b0d82a08c1a7c /config.guess | |
parent | 28a569838fa0b035b32ab7b894222a843869ad5d (diff) | |
download | gmp-8a3ac5bc570189d6c7a8d932326a5eed6ab04d92.tar.gz |
Recognise CPU "applem1".
Diffstat (limited to 'config.guess')
-rwxr-xr-x | config.guess | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/config.guess b/config.guess index 2d2680315..5893a8c34 100755 --- a/config.guess +++ b/config.guess @@ -173,6 +173,15 @@ EOF ;; arm*-*-* | aarch64-*-*) + if [ $((uname -s) 2>/dev/null) = Darwin ]; then + case $(system_profiler SPHardwareDataType | grep Chip) in + *Apple\ M1) + exact_cpu="applem1";; + *Apple\ M2) + exact_cpu="applem2";; + esac + fi + cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | sort -r | head -n 1 2>/dev/null` cpu_implementer=`sed -n 's/^CPU implementer.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | head -n 1 2>/dev/null` case "${cpu_implementer}_${cpu_code}" in |