diff options
| author | Jack Nagel | 2014-08-09 14:57:09 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-08-09 14:57:09 -0500 |
| commit | e0f86a1a86ec3c42e53fa4b6d29753925aaf2e09 (patch) | |
| tree | 1aa3cece51ffd6c333185674a76cb8b854036652 /Library | |
| parent | f0b75b286957f7ba012461492f1635a13a5dbe16 (diff) | |
| download | brew-e0f86a1a86ec3c42e53fa4b6d29753925aaf2e09.tar.bz2 | |
Pull effective arch detection into a method
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ENV/std.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 381549744..b6ca357b0 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -301,17 +301,19 @@ module Stdenv remove flags, %r{-mssse3} remove flags, %r{-msse4(\.\d)?} append flags, xarch unless xarch.empty? + append flags, map.fetch(effective_arch, default) + end + def effective_arch if ARGV.build_bottle? - arch = ARGV.bottle_arch || Hardware.oldest_cpu - append flags, Hardware::CPU.optimization_flags.fetch(arch) + ARGV.bottle_arch || Hardware.oldest_cpu elsif Hardware::CPU.intel? && !Hardware::CPU.sse4? # If the CPU doesn't support SSE4, we cannot trust -march=native or # -march=<cpu family> to do the right thing because we might be running # in a VM or on a Hackintosh. - append flags, Hardware::CPU.optimization_flags.fetch(Hardware.oldest_cpu) + Hardware.oldest_cpu else - append flags, map.fetch(Hardware::CPU.family, default) + Hardware::CPU.family end end |
