From 22afb1cc43b9999afb77d9d9d221d00683b6f116 Mon Sep 17 00:00:00 2001 From: Camillo Lugaresi Date: Wed, 16 Mar 2011 02:46:46 +0100 Subject: [PATCH] make fails_with_llvm work when cc is llvm-gcc Closes Homebrew/homebrew#4693. Signed-off-by: Mike McQuaid --- Library/Homebrew/compatibility.rb | 4 ++++ Library/Homebrew/formula.rb | 5 ++++- Library/Homebrew/utils.rb | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/compatibility.rb b/Library/Homebrew/compatibility.rb index 43180ce1e5..70a55f1ae0 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 ba183b4d9c..9b800eeddf 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 fa08f8759b..bd33f86400 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -1,3 +1,5 @@ +require 'pathname' + class Tty class <&1` =~ /build (\d{4,})/ if $1