aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorMisty De Meo2012-01-02 17:20:30 -0600
committerMisty De Meo2012-01-11 21:16:13 -0600
commit1ed22ff1c34a99e48feea77af39b05e6b9d00ce4 (patch)
treee38fdbbb347f30d0bc2e333c834565eb909a86f2 /Library/Homebrew/extend
parent79439626b5e7564566bdf8736916342e2bb5e1a7 (diff)
downloadbrew-1ed22ff1c34a99e48feea77af39b05e6b9d00ce4.tar.bz2
ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Allow the use of a Homebrewed gcc-4.2 in order to support homebrew-alt's apple-gcc42 formula. This also removes the :force filtering for the gcc-4.2 check error. Closes Homebrew/homebrew#9384. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/ENV.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index b1ff5d9cf..60d6e05d0 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -83,13 +83,15 @@ module HomebrewEnvExtension
alias_method :gcc_4_0, :gcc_4_0_1
def gcc args = {}
- self['CC'] = "/usr/bin/gcc-4.2"
- self['CXX'] = "/usr/bin/g++-4.2"
+ gcc_path = Pathname.new "/usr/bin/gcc-4.2"
+ gxx_path = Pathname.new "/usr/bin/g++-4.2"
+ self['CC'] = gcc_path.exist? ? gcc_path : HOMEBREW_PREFIX+'bin/gcc-4.2'
+ self['CXX'] = gxx_path.exist? ? gxx_path : HOMEBREW_PREFIX+'bin/g++-4.2'
replace_in_cflags '-O4', '-O3'
set_cpu_cflags 'core2 -msse4', :penryn => 'core2 -msse4.1', :core2 => 'core2', :core => 'prescott'
@compiler = :gcc
- raise "GCC could not be found" if args[:force] and not File.exist? ENV['CC'] \
+ raise "GCC could not be found" if not File.exist? ENV['CC'] \
or (Pathname.new(ENV['CC']).realpath.to_s =~ /llvm/)
end
alias_method :gcc_4_2, :gcc