From 76168e8e87e22af8037c66a6b06feefd136eeaf0 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 16 Jun 2010 11:50:36 -0700 Subject: [PATCH] Add "fails_with_llvm" to formula to document LLVM build breaks. Replaced ENV.gcc_4_2 + comments with calls to "fails_with_llvm", to specifically message to the user when a formula is known or suspected to not build with LLVM. If the user specifies "--use-llvm", the message will be displayed, but compilation will be tried anyway. Since using LLVM is now an advanced/hidden feature instead of the default on 10.6, we'll let the user try anyway (and submit patches if things are now working.) --- Library/Homebrew/formula.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 5353c65d4b..9471f58b56 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -296,6 +296,17 @@ class Formula self.class.external_deps end + def fails_with_llvm msg="", data=nil + return unless (ENV['HOMEBREW_USE_LLVM'] or ARGV.include? '--use-llvm') + + build = data.delete :build rescue nil + msg = "(No specific reason was given)" if msg.empty? + + opoo "LLVM was requested, but this formula is reported as not working with LLVM:" + puts msg + puts "Tested with LLVM build #{build}" unless build == nil + end + protected # Pretty titles the command and buffers stdout/stderr # Throws if there's an error