Added a --universal option to LLVM

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Joshua Ballanco 2010-12-08 17:43:28 -05:00 committed by Mike McQuaid
parent aece9675df
commit 67bef04d19

View file

@ -1,6 +1,7 @@
require 'formula'
def build_clang?; ARGV.include? '--with-clang'; end
def build_universal?; ARGV.include? '--universal'; end
class Clang <Formula
url 'http://llvm.org/releases/2.8/clang-2.8.tgz'
@ -14,7 +15,8 @@ class Llvm <Formula
md5 '220d361b4d17051ff4bb21c64abe05ba'
def options
[['--with-clang', 'Also build & install clang']]
[['--with-clang', 'Also build & install clang'],
['--universal', 'Build both i386 and x86_64 architectures']]
end
def install
@ -25,6 +27,11 @@ class Llvm <Formula
Clang.new.brew { clang_dir.install Dir['*'] }
end
if build_universal?
ENV['UNIVERSAL'] = '1'
ENV['UNIVERSAL_ARCH'] = 'i386 x86_64'
end
system "./configure", "--prefix=#{prefix}",
"--enable-targets=host-only",
"--enable-optimized"