diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ENV/std.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index b9cbfbc68..51d9ef1ff 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -119,7 +119,7 @@ module Stdenv self.cxx = "#{MacOS.dev_tools_path}/g++-4.0" replace_in_cflags '-O4', '-O3' set_cpu_cflags '-march=nocona -mssse3' - @compiler = :gcc + @compiler = :gcc_4_0 end alias_method :gcc_4_0, :gcc_4_0_1 @@ -131,7 +131,7 @@ module Stdenv self.cc = MacOS.locate("gcc-4.2") self.cxx = MacOS.locate("g++-4.2") - unless cc + if cc.empty? self.cc = "#{HOMEBREW_PREFIX}/bin/gcc-4.2" self.cxx = "#{HOMEBREW_PREFIX}/bin/g++-4.2" raise "GCC could not be found" unless File.exist? cc diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 24c1b7181..c42e79727 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -99,11 +99,12 @@ module OS def default_cc cc = locate 'cc' - Pathname.new(cc).realpath.basename.to_s rescue nil + cc.realpath.basename.to_s rescue nil end def default_compiler case default_cc + when /^gcc-4.0/ then :gcc_4_0 when /^gcc/ then :gcc when /^llvm/ then :llvm when "clang" then :clang |
