Skip to content

Commit

Permalink
ENV.gcc: search HOMEBREW_PREFIX/bin for gcc-4.2
Browse files Browse the repository at this point in the history
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#9384.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
  • Loading branch information
mistydemeo authored and etehtsea committed Jan 12, 2012
1 parent 0ba2642 commit c913eb4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Library/Homebrew/extend/ENV.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ def gcc_4_0_1
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
Expand Down

0 comments on commit c913eb4

Please sign in to comment.