diff options
| author | Camillo Lugaresi | 2011-03-16 02:46:46 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2011-03-17 17:49:14 +0000 |
| commit | 394780776c4d0acd9ebddca50a18a0e23982b2b1 (patch) | |
| tree | 415f09a69aa891d11ee35731743c8e32a52a02eb /Library | |
| parent | 52b86699c8b0678afe8804ad661cf80e23fe20fb (diff) | |
| download | homebrew-394780776c4d0acd9ebddca50a18a0e23982b2b1.tar.bz2 | |
make fails_with_llvm work when cc is llvm-gcc
Closes #4693.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/compatibility.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 7 |
3 files changed, 15 insertions, 1 deletions
diff --git a/Library/Homebrew/compatibility.rb b/Library/Homebrew/compatibility.rb index 43180ce1e..70a55f1ae 100644 --- a/Library/Homebrew/compatibility.rb +++ b/Library/Homebrew/compatibility.rb @@ -14,6 +14,10 @@ def dump_build_env env Homebrew.dump_build_env env end +def default_cc + MacOS.default_cc +end + def gcc_42_build MacOS.gcc_42_build_version end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index ba183b4d9..9b800eedd 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -265,7 +265,10 @@ class Formula end def fails_with_llvm msg="", data=nil - return unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm') + unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm') + ENV.gcc_4_2 if default_cc =~ /llvm/ + return + end build = data.delete :build rescue nil msg = "(No specific reason was given)" if msg.empty? diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index fa08f8759..bd33f8640 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -1,3 +1,5 @@ +require 'pathname' + class Tty class <<self def blue; bold 34; end @@ -208,6 +210,11 @@ def nostdout end module MacOS extend self + + def default_cc + Pathname.new("/usr/bin/cc").realpath.basename.to_s + end + def gcc_42_build_version `/usr/bin/gcc-4.2 -v 2>&1` =~ /build (\d{4,})/ if $1 |
