2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gmp < Formula
|
2011-09-12 16:31:30 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/gmp/gmp-5.0.2.tar.bz2'
|
2011-11-30 18:56:07 +00:00
|
|
|
mirror 'http://ftp.gnu.org/gnu/gmp/gmp-5.0.2.tar.bz2'
|
2009-09-26 19:11:08 +00:00
|
|
|
homepage 'http://gmplib.org/'
|
2011-05-21 22:59:05 +00:00
|
|
|
sha1 '2968220e1988eabb61f921d11e5d2db5431e0a35'
|
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
|
|
|
|
|
2011-10-18 09:56:23 +00:00
|
|
|
# Fixes make check for xcode 4.2. See:
|
|
|
|
# http://gmplib.org/list-archives/gmp-bugs/2011-July/002308.html
|
|
|
|
def patches
|
|
|
|
DATA if MacOS.xcode_version >= "4.2"
|
|
|
|
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
|
2011-10-18 09:56:23 +00:00
|
|
|
# Do not force if xcode > 4.2 since it does not have /usr/bin/gcc-4.2 as default
|
|
|
|
unless MacOS.xcode_version >= "4.2"
|
|
|
|
ENV.gcc_4_2
|
|
|
|
end
|
2010-10-17 23:31:01 +00:00
|
|
|
|
2011-05-21 22:59:05 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--enable-cxx"]
|
2009-09-26 19:11:08 +00:00
|
|
|
|
2011-03-26 17:03:08 +00:00
|
|
|
# Build 32-bit where appropriate, and help configure find 64-bit CPUs
|
2011-08-30 02:20:56 +00:00
|
|
|
# see: http://gmplib.org/macos.html
|
2011-03-26 17:03:08 +00:00
|
|
|
if MacOS.prefer_64_bit? and not ARGV.include? "--32-bit"
|
|
|
|
ENV.m64
|
|
|
|
args << "--build=x86_64-apple-darwin"
|
|
|
|
else
|
2010-10-17 16:48:35 +00:00
|
|
|
ENV.m32
|
2011-10-03 19:40:14 +00:00
|
|
|
args << "--build=none-apple-darwin"
|
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"
|
2011-05-21 22:59:05 +00:00
|
|
|
ENV.j1 # Doesn't install in parallel on 8-core Mac Pro
|
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
|
2011-10-18 09:56:23 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/acinclude.m4 b/acinclude.m4
|
|
|
|
index 699dd7b..87b5f6f 100644
|
|
|
|
--- a/acinclude.m4
|
|
|
|
+++ b/acinclude.m4
|
|
|
|
@@ -1941,8 +1941,8 @@ X86_PATTERN | x86_64-*-*)
|
|
|
|
esac
|
|
|
|
|
|
|
|
cat >conftest.c <<EOF
|
|
|
|
-extern const int foo[]; /* Suppresses C++'s suppression of foo */
|
|
|
|
-const int foo[] = {1,2,3};
|
|
|
|
+extern const int foo[[]]; /* Suppresses C++'s suppression of foo */
|
|
|
|
+const int foo[[]] = {1,2,3};
|
|
|
|
EOF
|
|
|
|
echo "Test program:" >&AC_FD_CC
|
|
|
|
cat conftest.c >&AC_FD_CC
|
|
|
|
diff --git a/configure b/configure
|
|
|
|
index 07b9fda..f6df8cd 100755
|
|
|
|
--- a/configure
|
|
|
|
+++ b/configure
|
|
|
|
@@ -26446,8 +26446,8 @@ i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* |
|
|
|
|
esac
|
|
|
|
|
|
|
|
cat >conftest.c <<EOF
|
|
|
|
-extern const int foo; /* Suppresses C++'s suppression of foo */
|
|
|
|
-const int foo = {1,2,3};
|
|
|
|
+extern const int foo[]; /* Suppresses C++'s suppression of foo */
|
|
|
|
+const int foo[] = {1,2,3};
|
|
|
|
EOF
|
|
|
|
echo "Test program:" >&5
|
|
|
|
cat conftest.c >&5
|