gmp5 stable port information

Info4: <<
Package: gmp5%type_pkg[-64bit]
Version: 5.0.4
Revision: 1
GCC: 4.0
Type: -64bit (boolean)
Architecture: ( %type_raw[-64bit] = -64bit ) powerpc, ( %type_raw[-64bit] = -64bit ) i386
Source: mirror:gnu:gmp/gmp-%v.tar.bz2
Source-MD5: 50c3edcb7c9438e04377ee9a1a061b79
Source2: http://www.csl.cornell.edu/~fang/sw/gmp-trunk-20110131-config.guess
Source2-MD5: d526c73bbb512808aa4e871937dd6fa4
# PatchFile: %{ni}.patch
# PatchFile-MD5: 5e2d7de9993a24aee6ad146b844fb6a3
Depends: <<
%N-shlibs (= %v-%r),
libgmpxx5%type_pkg[-64bit]-shlibs (= %v-%r),
( %type_raw[-64bit] = -64bit ) 64bit-cpu
<<
BuildDepends: fink (>= 0.26.0)
# gcc4.0 (>= 4.0.1-1)
Conflicts: gmp, gmp-64bit, gmp5, gmp5-64bit
Replaces: gmp, gmp-64bit, gmp5, gmp5-64bit
SetCPPFLAGS: -fexceptions
# $host_build_override
ConfigureParams: <<
ABI=$ABI \
--libdir='${prefix}/%lib/gmp5' \
--infodir='${prefix}/share/info' \
--enable-cxx \
--disable-static
<<
PatchScript: <<
#!/bin/sh -ev
# %{default_script}
echo "replacing gmp's config.guess with newer one from trunk (patched)"
mv config.guess config.guess.orig
sed 's|corei[a-z]*|corei|g' ../gmp-trunk-*-config.guess > ./config.guess
chmod +x ./config.guess
sed -i.orig -e 's|-Wa,-maltivec|-maltivec|g' configure
<<
UseMaxBuildJobs: true
CompileScript: <<
#! /bin/sh -ev
mkdir build
cd build
# extra checks for compiler version
# darwin8's default compiler is good
# darwin9 needs newer compiler
# darwin10's default compiler is good
darwin_vers=`uname -r | cut -d. -f1`
# pogma: workaround for bug in ltmain.sh (2.2.6b and earlier)
export lt_cv_apple_cc_single_mod=yes
if test "$darwin_vers" = 9 ; then
export CC=gcc-4.2
export CXX=g++-4.2
test -x `which gcc-4.2` || { echo "gcc-4.2 required, but missing!"; exit 1; }
fi
# force i386 to bump to i686 to avoid symbol dep on __sync_fetch_and_add_4
hb=`../config.guess`
echo "config.guess: $hb"
# case $hb in
# i386-*-*) hb=`echo $hb | sed 's|i386|i686|'`
# host_build_override="--host=$hb --build=$hb" ;;
# esac
if [ "%type_raw[-64bit]" == "." ] ; then
case "%m" in
i386 | powerpc) ABI=32 ;;
x86_64) ABI=64 ;;
esac
else
case "%m" in
i386) ABI=64 ;;
powerpc) ABI=mode64 ;;
esac
fi
prefix=%p echo "configuring with: %c"
../configure %c
make
make check
<<
InstallScript: <<
#!/bin/sh -ev
cd build
make -j1 DESTDIR=%d install
#Move .la and symlinks to %p/%lib so packages don't need tricks to find them.
mv %i/%lib/gmp5/libgmp.la %i/%lib
mv %i/%lib/gmp5/libgmpxx.la %i/%lib
rm %i/%lib/gmp5/libgmp.dylib %i/%lib/gmp5/libgmpxx.dylib
ln -s %p/%lib/gmp5/libgmp.10.dylib %i/%lib/libgmp.dylib
ln -s %p/%lib/gmp5/libgmpxx.4.dylib %i/%lib/libgmpxx.dylib
<<
DocFiles: COPYING COPYING.LIB README
InfoDocs: gmp.info
BuildDependsOnly: True
SplitOff: <<
Package: %N-shlibs
Depends: ( %type_raw[-64bit] = -64bit ) 64bit-cpu
Files: %lib/gmp5/libgmp.*.dylib
Shlibs: <<
%p/%lib/gmp5/libgmp.10.dylib 11.0.0 %n (>= 5.0.1-2) %type_num[-64bit]
<<
Description: Shared library for gmp package
DocFiles: doc/* AUTHORS COPYING COPYING.LIB ChangeLog INSTALL NEWS README
<<
SplitOff2: <<
Package: libgmpxx5%type_pkg[-64bit]-shlibs
Depends: ( %type_raw[-64bit] = -64bit ) 64bit-cpu, %N-shlibs
Files: %lib/gmp5/libgmpxx.*.dylib
Shlibs: <<
%p/%lib/gmp5/libgmpxx.4.dylib 7.0.0 %n (>= 5.0.1-2) %type_num[-64bit]
<<
Description: Shared C++ library for gmp package
DocFiles: doc/* AUTHORS COPYING COPYING.LIB ChangeLog INSTALL NEWS README
<<
License: LGPL
Description: GNU multiple precision arithmetic library
DescDetail: <<
GNU MP is a portable library written in C for arbitrary precision
arithmetic on integers, rational numbers, and floating-point numbers.
<<
DescPackaging: <<
Unfortunately, the libgmpxx4 splitoff, which existed from vers. 4.1.4-1
through vers. 4.2.1-1008, was misnamed. It *should* have been called
libgmpxx3, and the new version of that library should now be in a splitoff
called libgmpxx4. To work around this, the splitoff is now called
libgmpxx (with no number); note that the next time the major version of
this library changes, the splitoff should go to libgmpxx5.

Starting with gmp5, we install to a private pkglib dir so that it may
coexist with other major versions of gmp without conflicts/replaces.
Since gmp5, static libraries have been removed in favor of shared-only.
<<
DescPort: <<
gmp5-5.0.2-2: includes patch for low probability division bug in
mpn/generic/dcpi1_bdiv_q.c

Older notes:

Patch from Ben Hines to build libgmpxx, as of vers. 4.1-2. As of vers.
4.1.4-1, libgmpxx gets its own splitoff.

As of vers. 4.2, mpfr is a separate library, available in fink as the
libmpfr1 package.

The patch, provided by Martin Costabel, makes the 64bit variant compile on
the new MacBookPros whose core2 duo processor is misidentified as pentium3.

As of vers. 4.2.3, we are building with -fexceptions, for the benefit of
ppl library that will be used in gcc 4.4.x. (Suggested by Jack Howarth;
see http://www.cs.unipr.it/ppl/ and http://gcc.gnu.org/wiki/Graphite .)

Patch: from jhowarth for configure test on llvm-gcc/clang builds
checking how to switch to read-only data section...
<<
Maintainer: David Fang
# Former maintainer: Dave Morrison
Homepage: http://gmplib.org
<<

gmp5 stable port .patch

--- gmp-5.0.2/acinclude.m4.orig 2011-05-17 19:03:09.000000000 -0400
+++ gmp-5.0.2/acinclude.m4 2011-05-17 19:03:43.000000000 -0400
@@ -1941,8 +1941,8 @@
esac

cat >conftest.c < -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
--- gmp-5.0.2/configure.orig 2011-05-17 19:15:41.000000000 -0400
+++ gmp-5.0.2/configure 2011-05-17 19:16:00.000000000 -0400
@@ -26446,8 +26446,8 @@
esac

cat >conftest.c < -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
diff -r 03ed209dd7ef -r 538dfce27f41 mpn/generic/dcpi1_bdiv_q.c
--- a/mpn/generic/dcpi1_bdiv_q.c Thu Jun 16 12:22:24 2011 +0200
+++ b/mpn/generic/dcpi1_bdiv_q.c Fri Jul 15 13:43:41 2011 +0200
@@ -130,7 +129,7 @@
qn = nn - qn;
while (qn > dn)
{
- mpn_sub_1 (np + dn, np + dn, qn, cy);
+ mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
qp += dn;
np += dn;

gmp5 _unstable_ port .patch