2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-26 19:11:08 +00:00
|
|
|
|
|
|
|
class Gmp <Formula
|
2010-04-20 20:51:12 +00:00
|
|
|
url 'ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.bz2'
|
2009-09-26 19:11:08 +00:00
|
|
|
homepage 'http://gmplib.org/'
|
2010-04-20 20:51:12 +00:00
|
|
|
sha1 '6340edc7ceb95f9015a758c7c0d196eb0f441d49'
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
def options
|
|
|
|
[
|
2010-10-17 16:48:35 +00:00
|
|
|
["--32-bit", "Force 32-bit."],
|
|
|
|
["--skip-check", "Do not run 'make check' to verify libraries."]
|
2009-12-03 06:40:08 +00:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2009-09-26 19:11:08 +00:00
|
|
|
def install
|
2010-10-17 23:31:01 +00:00
|
|
|
# Reports of problems using gcc 4.0 on Leopard
|
2010-11-10 18:16:28 +00:00
|
|
|
# https://github.com/mxcl/homebrew/issues/issue/2302
|
2011-03-06 11:13:58 +00:00
|
|
|
# Also force use of 4.2 on 10.6 in case a user has changed the default
|
|
|
|
ENV.gcc_4_2
|
2010-10-17 23:31:01 +00:00
|
|
|
|
2010-10-17 16:48:35 +00:00
|
|
|
fails_with_llvm "Tests fail to compile; missing references in 'llvm bitcode in libtests.a(misc.o)'."
|
2010-04-20 20:51:12 +00:00
|
|
|
|
2010-04-26 15:40:55 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--infodir=#{info}", "--enable-cxx"]
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2010-10-17 16:48:35 +00:00
|
|
|
if Hardware.is_32_bit? or ARGV.include? "--32-bit"
|
|
|
|
ENV.m32
|
|
|
|
args << "--host=none-apple-darwin"
|
|
|
|
else
|
|
|
|
ENV.m64
|
2009-12-03 06:40:08 +00:00
|
|
|
end
|
2010-04-20 20:51:12 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make"
|
|
|
|
ENV.j1 # Don't install in parallel
|
2009-09-26 19:11:08 +00:00
|
|
|
system "make install"
|
2010-04-20 20:51:12 +00:00
|
|
|
|
2009-12-03 06:40:08 +00:00
|
|
|
# Different compilers and options can cause tests to fail even
|
|
|
|
# if everything compiles, so yes, we want to do this step.
|
|
|
|
system "make check" unless ARGV.include? "--skip-check"
|
2009-09-26 19:11:08 +00:00
|
|
|
end
|
|
|
|
end
|