aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/ENV.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend/ENV.rb')
-rw-r--r--Library/Homebrew/extend/ENV.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 0f93a5d6f..097f002d2 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -121,7 +121,8 @@ module HomebrewEnvExtension
self['CC'] = self['OBJC'] = "#{MacOS.dev_tools_path}/gcc-4.0"
self['CXX'] = self['OBJCXX'] = "#{MacOS.dev_tools_path}/g++-4.0"
replace_in_cflags '-O4', '-O3'
- set_cpu_cflags 'nocona -mssse3', :core => 'prescott', :bottle => 'generic'
+ set_cpu_cflags '-march=nocona -mssse3',
+ Hardware::CPU.optimization_flags
@compiler = :gcc
end
alias_method :gcc_4_0, :gcc_4_0_1
@@ -155,7 +156,7 @@ module HomebrewEnvExtension
end
replace_in_cflags '-O4', '-O3'
- set_cpu_cflags 'core2 -msse4', :penryn => 'core2 -msse4.1', :core2 => 'core2', :core => 'prescott', :bottle => 'generic'
+ set_cpu_cflags '-march=core2 -msse4', Hardware::CPU.optimization_flags
@compiler = :gcc
end
alias_method :gcc_4_2, :gcc
@@ -163,7 +164,7 @@ module HomebrewEnvExtension
def llvm
self['CC'] = self['OBJC'] = MacOS.locate("llvm-gcc")
self['CXX'] = self['OBJCXX'] = MacOS.locate("llvm-g++")
- set_cpu_cflags 'core2 -msse4', :penryn => 'core2 -msse4.1', :core2 => 'core2', :core => 'prescott'
+ set_cpu_cflags '-march=core2 -msse4', Hardware::CPU.optimization_flags
@compiler = :llvm
end
@@ -172,7 +173,7 @@ module HomebrewEnvExtension
self['CXX'] = self['OBJCXX'] = MacOS.locate("clang++")
replace_in_cflags(/-Xarch_i386 (-march=\S*)/, '\1')
# Clang mistakenly enables AES-NI on plain Nehalem
- set_cpu_cflags 'native', :nehalem => 'native -Xclang -target-feature -Xclang -aes'
+ set_cpu_cflags '-march=native', :nehalem => '-march=native -Xclang -target-feature -Xclang -aes'
append_to_cflags '-Qunused-arguments'
@compiler = :clang
end
@@ -325,10 +326,10 @@ module HomebrewEnvExtension
append flags, xarch unless xarch.empty?
if ARGV.build_bottle?
- append flags, '-mtune=' + map.fetch(:bottle) if map.has_key? :bottle
+ append flags, '-mtune=generic'
else
# Don't set -msse3 and older flags because -march does that for us
- append flags, '-march=' + map.fetch(Hardware.intel_family, default)
+ append flags, map.fetch(Hardware::CPU.family, default)
end
# not really a 'CPU' cflag, but is only used with clang
@@ -467,7 +468,8 @@ class << ENV
flags_to_set.each {|key| self[key] = cflags}
# Ensure we use architecture optimizations for GCC 4.2.x
- set_cpu_flags flags_to_set, 'core2 -msse4', :penryn => 'core2 -msse4.1', :core2 => 'core2', :core => 'prescott', :bottle => 'generic'
+ set_cpu_flags flags_to_set, 'core2 -msse4',
+ Hardware::CPU.optimization_flags
elsif not self['FCFLAGS'] or self['FFLAGS']
opoo <<-EOS.undent
No Fortran optimization information was provided. You may want to consider
@@ -487,7 +489,8 @@ class << ENV
fc_flag_vars.each {|key| self[key] = cflags}
# Ensure we use architecture optimizations for GCC 4.2.x
- set_cpu_flags fc_flag_vars, 'core2 -msse4', :penryn => 'core2 -msse4.1', :core2 => 'core2', :core => 'prescott', :bottle => 'generic'
+ set_cpu_flags fc_flag_vars, 'core2 -msse4',
+ Hardware::CPU.optimization_flags
else
onoe <<-EOS