summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorantman6662021-08-05 14:53:14 +0800
committerantman6662021-08-05 14:53:14 +0800
commitcde8041f5b3eb4da35b2e3000db5e958e80666cd (patch)
tree230b547bbc02a2bef77a66f493693fd4de2d2fec
parent45b2aeb2688f0e7ddfa49555546343a3c8ab45b9 (diff)
downloadaur-cde8041f5b3eb4da35b2e3000db5e958e80666cd.tar.gz
set native automatically
-rw-r--r--PKGBUILD11
1 files changed, 10 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bbccf0e98e16..3a1b29b014e8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -63,7 +63,16 @@ _localmodcfg=
# 39. Generic-x86-64-v4 (GENERIC_CPU4) (NEW)
# 40. Intel-Native optimizations autodetected by GCC (MNATIVE_INTEL) (NEW)
# 41. AMD-Native optimizations autodetected by GCC (MNATIVE_AMD) (NEW)
-_subarch=36
+if [ -z ${_subarch+x} ]; then
+ cpu=`grep vendor_id /proc/cpuinfo | awk -F: '{print $2}' | tail -1`
+ if [ $cpu == 'GenuineIntel' ]; then
+ _subarch=40
+ elif [ $cpu == 'AuthenticAMD' ]; then
+ _subarch=41
+ else
+ _subarch=36
+ fi
+fi
### IMPORTANT: Do no edit below this line unless you know what you're doing