homebrew-core/Formula/gmp.rb
Jack Nagel f10e8aaa88 Revert "gmp: build with ENV.universal_binary"
This broke the build for a lot of people, and since nothing of import
explicitly requires a universal build, I think it's best to just revert
it for now.

Though I would really like to get GMP building universal eventually, so
patches welcome.

This reverts commit c0b2528a705891af3f1be9bc33397a334c903655.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-09-06 16:23:34 -05:00

42 lines
1.2 KiB
Ruby

require 'formula'
class Gmp < Formula
url 'ftp://ftp.gnu.org/gnu/gmp/gmp-5.0.2.tar.bz2'
homepage 'http://gmplib.org/'
sha1 '2968220e1988eabb61f921d11e5d2db5431e0a35'
def options
[
["--32-bit", "Force 32-bit."],
["--skip-check", "Do not run 'make check' to verify libraries."]
]
end
def install
# Reports of problems using gcc 4.0 on Leopard
# https://github.com/mxcl/homebrew/issues/issue/2302
# Also force use of 4.2 on 10.6 in case a user has changed the default
ENV.gcc_4_2
args = ["--prefix=#{prefix}", "--enable-cxx"]
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
# see: http://gmplib.org/macos.html
if MacOS.prefer_64_bit? and not ARGV.include? "--32-bit"
ENV.m64
args << "--build=x86_64-apple-darwin"
else
ENV.m32
args << "--host=none-apple-darwin"
end
system "./configure", *args
system "make"
ENV.j1 # Doesn't install in parallel on 8-core Mac Pro
system "make install"
# 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"
end
end