summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-libs/gmp
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-libs/gmp')
-rw-r--r--dev-libs/gmp/Manifest20
-rw-r--r--dev-libs/gmp/files/6.0.0a/gmp-6.0.0a-arm-thumb.diff22
-rw-r--r--dev-libs/gmp/files/6.0.0a/ppc64-build.diff23
-rw-r--r--dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch20
-rw-r--r--dev-libs/gmp/files/gmp-4.2.1-s390.diff68
-rw-r--r--dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch256
-rw-r--r--dev-libs/gmp/files/gmp-5.0.0-s390.diff68
-rw-r--r--dev-libs/gmp/files/gmp-5.0.1-perfpow-test.patch36
-rw-r--r--dev-libs/gmp/files/gmp-5.0.1-x86-nopie-tests.patch130
-rw-r--r--dev-libs/gmp/files/gmp-5.0.2-unnormalised-dividends.patch21
-rw-r--r--dev-libs/gmp/files/gmp-5.0.2-x32-bugfix.patch94
-rw-r--r--dev-libs/gmp/files/gmp-5.0.2-x32-support.patch41
-rw-r--r--dev-libs/gmp/files/gmp-5.0.5-x32-support.patch41
-rw-r--r--dev-libs/gmp/files/gmp-5.1.0-armv4.patch12
-rw-r--r--dev-libs/gmp/files/gmp-5.1.0-x32-support.patch42
-rw-r--r--dev-libs/gmp/files/gmp-5.1.0-x86-nopie-tests.patch119
-rw-r--r--dev-libs/gmp/gmp-4.3.2-r1.ebuild61
-rw-r--r--dev-libs/gmp/gmp-5.0.1.ebuild87
-rw-r--r--dev-libs/gmp/gmp-5.0.2.ebuild86
-rw-r--r--dev-libs/gmp/gmp-5.0.2_p1.ebuild102
-rw-r--r--dev-libs/gmp/gmp-5.0.3.ebuild101
-rw-r--r--dev-libs/gmp/gmp-5.0.4.ebuild101
-rw-r--r--dev-libs/gmp/gmp-5.0.5.ebuild101
-rw-r--r--dev-libs/gmp/gmp-5.1.0.ebuild116
-rw-r--r--dev-libs/gmp/gmp-5.1.1.ebuild115
-rw-r--r--dev-libs/gmp/gmp-5.1.2.ebuild114
-rw-r--r--dev-libs/gmp/gmp-5.1.3-r1.ebuild118
-rw-r--r--dev-libs/gmp/gmp-5.1.3.ebuild114
-rw-r--r--dev-libs/gmp/gmp-6.0.0a.ebuild117
-rw-r--r--dev-libs/gmp/metadata.xml8
30 files changed, 2354 insertions, 0 deletions
diff --git a/dev-libs/gmp/Manifest b/dev-libs/gmp/Manifest
new file mode 100644
index 000000000000..e3496e9016e8
--- /dev/null
+++ b/dev-libs/gmp/Manifest
@@ -0,0 +1,20 @@
+DIST gmp-4.3.2.tar.bz2 1897483 SHA256 936162c0312886c21581002b79932829aa048cfaf9937c6265aeaa14f1cd1775 SHA512 2e0b0fd23e6f10742a5517981e5171c6e88b0a93c83da701b296f5c0861d72c19782daab589a7eac3f9032152a0fc7eff7f5362db8fccc4859564a9aa82329cf WHIRLPOOL ab3d9c95b436df3782830da0874307d5577b83c111c2fae4a9063d4083f97c5c12643b154c1bd9a588945e5a677fb8ab416c394ced3e9b0aa671b2238bcb9b40
+DIST gmp-5.0.1.tar.bz2 2006109 SHA256 a2a610f01fd3298dc08c87bf30498c2402590e1bcb227fc40b15ee6d280939fb SHA512 9a128f7e192e5f1233ec068b04ba4789cd10ae1ca1a21d1089b9b596022f7dfb66c313599b5de462135b1556a8f8e72bce1b5f4666b1eeed1652e3d7f2f5d168 WHIRLPOOL e19602c9914ed0bcd60aa198cb6f4b35a8f133381808f0a0f0759987407aa8e356bf8cba99b4f4e44f526412a80ee1dbdd6fd2adaa88f8aaa1c7e7e881626f9a
+DIST gmp-5.0.2.tar.bz2 2024576 SHA256 dbc2db76fdd4e99f85d5e35aa378ed62c283e0d586b91bd8703aff75a7804c28 SHA512 b53cc482e73aa91ae4f83301d9ef83a98cd85cfe53347e102a059fa477edceebded466223b436bc250314eb6ec2e53ecc4fa1528341435f09e232f0c4e305bad WHIRLPOOL a60dbfd26fca44edeab921d2293bb5cdea62ad5050ebbaa7d0e21fe2089deaa893d92abdd109e613edf234a36071d64422c04b24de3c952b0147a4310b4229d4
+DIST gmp-5.0.3.tar.xz 1685288 SHA256 438ee3e2d03a5b7c23e9f3f46919ab53cab102bcf4f3c34ea3a08486610fd450 SHA512 dc68ad36bbf515386d735784fe4583443eb6168d10c2967e47ce4bd541076a18c01bcc4b04261330ee0489560978234c36bf7064d611ce2f21ac38c37e6b34f0 WHIRLPOOL cf9a481f8a3c911ac023fcbbd5129bbd3ea7003bca745268b0f4f7cc94cff601d68a3cbe62037819e430677f49b182f0ceaf80c76c6b9bc39103f7973e9e2589
+DIST gmp-5.0.4.tar.xz 1689832 SHA256 4e6de1262ec94cce7833abb787a6d9157a822cc63d406c3d46c737e46ade1523 SHA512 68e2eca72aa8bdf4dd83da55625c32488015c10ea8aed79c8b861070de99bad0bb44b78c32655c12df90802bde564f98f41e8bffa1a1f522f3432271a8fcb00c WHIRLPOOL 85860d555f48062cac175a9cc239cf18c69ea68f98477f3b0ff75cc91b1b4c04e1bebbfe5699ea103031fe381f3cc93089065cbbd67ad5e923169b3f38469eaf
+DIST gmp-5.0.5.tar.xz 1671264 SHA256 e87015a825a2445e169931ee27849d52576a2d9e338d1383dcb36fed68d0006f SHA512 79f69ed7959af18e626d4b21b5707ebd7701261ebc2cc9f78fa03c5efa9eb1c1aef2ba8728cdbc34fb09ba333aeba0f88ba7e4d87d6a93b21f936f9d8ee1174a WHIRLPOOL c224f0ce28762e8987b5c5a817d24412d1c85e7bab2f173b138f463cc380d85ab02585d4c2a0e5052c34a405e6cec1f744edb0ee525002d6b77584ff6ecb601b
+DIST gmp-5.1.0.tar.xz 1806216 SHA256 c232d96b92ee251a6b8fdbf0a45d4db17a784846dfdfaf36651eeef2117a8991 SHA512 33b364bddfe829c78e3720ad15dc9fe5cf4c774e9a206ae0a8467666872d40148da07b8a4d8b251e3240c3c8b4eee5e082edc13aa208d3912f9f5d600d1110e8 WHIRLPOOL 28fb5693254bd25276348c8483ca8a7638c6a781d566e1dba085c581d3de7f99f9deee57bb613dbea78c0aeebf01e0eafe6003bd5327b48495c7f86b4dc3a92f
+DIST gmp-5.1.1.tar.xz 1812988 SHA256 4bd64d782fdeb61aeed45b434fca5246d66baa9de76f87cba30c38460d8834c2 SHA512 4cc3307411eb2144e87b791ee2f52e0020711638f911dfa3cc5929a57eda5ac7d9ca10c1c0bb75c96afc7ff7a9c6ad165bc87409b036c562867b4e5da15ba571 WHIRLPOOL 8a7afe06d530a15edb75a0c37c8497d1ab209dfeffebd44aecfcfe6b75586c182384cfdf8ea9b696ce968aed04944ec7c1c271730b65c34b2e3504d26565240e
+DIST gmp-5.1.2.tar.xz 1819560 SHA256 c7d943a6eceb4f0d3d3ab1176aec37853831cdfa281e012f8a344ba3ceefcbc2 SHA512 2c135bb6be908e93e63fe8828b2128b4e22e8ba29adf3cc917493ab66b42d54654dad7f101f902105e854731a69a202c38e34f119f642828fa5568ef21075c5a WHIRLPOOL dc18f8b2f7f592a52872f477ff375a29d58bca6661877bd0e4ef26766ed439e98172e277fed9f91d7204990b3030423bf6b3bff0b996ec371d6e681f8c21e504
+DIST gmp-5.1.3.tar.xz 1818812 SHA256 dee2eda37f4ff541f30019932db0c37f6f77a30ba3609234933b1818f9b07071 SHA512 44bbec2b2a6480d4c9a9a633cca4fe0de966c13bc08bdcd8b934d81e21f3dfacaecf273f149dc613d365277d280ecee43cffdafaec1bd1239a7ed903f8658b5b WHIRLPOOL 0c4365a129136655046a8e46c4e2487a981c03de97ec47899f752cbd6e61661c6068b19c547acce8436f7a9af91396545c9bf7aa9de73a0f29384bbfebef927f
+DIST gmp-6.0.0a.tar.xz 1904112 SHA256 9156d32edac6955bc53b0218f5f3763facb890b73a835d5e1b901dcf8eb8b764 SHA512 50368f4368b244b442438ce1768cf0f1166e490d1bafb8feda1ffc90fea3807e7328f30f3faa861799e4f5ff6e3113049ca3231b2f48571e4583fc3d60441816 WHIRLPOOL 81639a9d433ce9ccb26527af309c7c41437bb3463e5986cce3b35f81b527068a2304ec3287e660454f850dedab61463a077f49d4ea2b7ee87eec94b15730c394
+DIST gmp-man-5.0.2.pdf 1024222 SHA256 fcdd621dea0215b8920bdbfacf374ae8ef4f548a2d0c3e8d65d904f1b9d174d4 SHA512 95ea00ee16e87e9f379e76cd6c1a850866e5f22c0e6fc6e5deaae1213a694d28dd6fc09c105b5e71d4bb24e07ca8b77c56d756ef680beac1f64cc17ab51b246c WHIRLPOOL eaa78db21ee7dc8076a752cc949f336c1699c752626496d1490babc2d00115b08fa954ba9f732405d63bbdb43d97c43bed1917629fee1106e2e87942c78d6da8
+DIST gmp-man-5.0.3.pdf 1159053 SHA256 8f12da7b0665a2a0b5e1bc83c702e67b1b854382af5cba58c2859564fc930550 SHA512 4be246f234379033922255ece26f8f7b6056ee637f0d3964459829a946368ae01e2434b22fb1a180cf0a4efa7ad18d332d3e1a89cf9040d5f9f27e43cd3ca8ab WHIRLPOOL 50b27cccd274d84d2b35d2551089755b5b88837fb28a24c5e244c8706004925fe86ff81c2cc68d6125f2113b68a741b9a6615b931bf8260f2cd384dcd5115336
+DIST gmp-man-5.0.4.pdf 1160172 SHA256 c577d4dea9964e85c07f859d60833fc56d10aba16fd42f380939b0360f79defb SHA512 0159c748e75ba12a4fe3164e7071966e39475fa95b477e16de9cff095dd67c144c3aed24a611cf44c434bff9942faa432fb2222a7a27c587ed22a2df2f33a8c0 WHIRLPOOL df53ea3df9069c3958427ae18d29247c7502e5140b7c6f8c2b15d38aab308a9fa8dea8f3b636907ce5588cc738393e600e4f7160d502f42b6df339a7f76ad5ca
+DIST gmp-man-5.0.5.pdf 1162914 SHA256 33c7456155bf39704eb1c874849315a925140014b4ad8a8c6f0e07e4fde6a9f2 SHA512 2207266e1187f9951e01f02c6c70eb8bde78fd8d748f144c1bcb10702510f79ee9dd698347d80cac2445112c1554919e734dafd48ebc4662e39b9031b3147544 WHIRLPOOL 1becb075143db9fb26662fed68f760624d381306831a9a58234d5e82303290497bb7b99582a1ab77bd8a72de70e97b516e113264aa307774a4632faf223624c8
+DIST gmp-man-5.1.0.pdf 1156063 SHA256 def7bae39aaf2756cd074207c02afca8b3dde66111bbc17769f196082de2f28b SHA512 e3736853a20fbb0de86458a1e724f515429ac43458e62479e7721416553e6015b3d5e6de6a6f3b00f0a6530ba6c9556aa1d6283d9dced2c58e1ce96c73c367a5 WHIRLPOOL a2ec71ce7e4369575d17691c694f0d175afcbc1832fac1c0eefeee7d694280317d51cef6a6cf02c1a6f8e941c69900fa175ca049b5a30718d39d84254ec7be68
+DIST gmp-man-5.1.1.pdf 1156487 SHA256 c8c33650c321022c417275321b75e3b0c1bf87275f17323fa843778097449504 SHA512 3e855b882a039099bdc3719c94e4c18d0025e3a903b770752271a41dd9c5cf2b70654f6f59c32edfd4320e9954f679610764f379bd21b9d883d4fc20bd312f76 WHIRLPOOL b87d92601f3c170527192f78c60d6a137043f39772baabdd17957344207fbaae1ad88f03e22348e6e572f0a8a28ee1d80b3dc52015704cb52676b545ccb9f4e5
+DIST gmp-man-5.1.2.pdf 1156466 SHA256 2f059a5179c2ea971b9b16553b9f15504e82ef0b7bc7f0b80b1b4fe33147c21f SHA512 b6fc8d82bf15b3d550bf2388fefbba4c7e1bdd5b324d6be52e6398d7b8fb72dd4a59f498bec80a7c8382fe3b5c026434766f0c319742c1263326e0a5b589bb21 WHIRLPOOL b43d41bdf97b94c284fbff305d9968d3142f748b79df51b3e34aa4a576e1655ebe2d3c90473b95d90f79670ae7b100a7b5e5d26ae353470ef2e2f853748dce95
+DIST gmp-man-5.1.3.pdf 1159009 SHA256 56b0e21329f46ef1d59c1f191afc82c59f8b72273a8131ed9b5000b7d0689c38 SHA512 ba6a4b0bd2b5ee4d284dd13e9c5531fcb9cfbbbc80f40df458d73c80a1aa250b750cfdd5039998e8b0c7259a8b4d24bd0c7b59a90108f9b680bee62e6948d59e WHIRLPOOL ade206d7e1f543ed028f51e247067eec4511bd0f2499103e1e6296fad2bf50c4f8e09cf7688cc5dd56ee572cf889508ac7918f85e5f91d29d088882f7734a4e0
+DIST gmp-man-6.0.0a.pdf 1187496 SHA256 b38ed1d760b20c01b734b65380ab667373fa48d8203f762a434cd3f326c67a38 SHA512 528972502d65d23b58c47a594a628e648f11cc027bd0894a39b8f892bb421ceabb7f35640a9eede21cea791f5f597ed4661a1f73444c56a6fb31fa6e362d96c2 WHIRLPOOL e6c4eb3a9adc82496a1872223ceb153e05c3aabd2323aeb38064739a5200eb8fc24fa3bb96f5fb1e632cc90a2576bd3966bae3c7a7a0c750ca56faeb30837eea
diff --git a/dev-libs/gmp/files/6.0.0a/gmp-6.0.0a-arm-thumb.diff b/dev-libs/gmp/files/6.0.0a/gmp-6.0.0a-arm-thumb.diff
new file mode 100644
index 000000000000..8b10d09395fd
--- /dev/null
+++ b/dev-libs/gmp/files/6.0.0a/gmp-6.0.0a-arm-thumb.diff
@@ -0,0 +1,22 @@
+https://gmplib.org/list-archives/gmp-discuss/2014-March/005537.html
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1396602422 -7200
+# Node ID 676e2d0f0e4dd301a7066079d2c9326c25c34a40
+# Parent 0194a75b56b21a9196626430af86c5bd9110c42d
+Conditionalise ARM asm on !__thumb__.
+
+diff -r 0194a75b56b2 -r 676e2d0f0e4d mpn/generic/div_qr_1n_pi1.c
+--- a/mpn/generic/div_qr_1n_pi1.c Thu Apr 03 23:58:51 2014 +0200
++++ b/mpn/generic/div_qr_1n_pi1.c Fri Apr 04 11:07:02 2014 +0200
+@@ -130,7 +130,7 @@
+ "%2" ((UDItype)(a0)), "r" ((UDItype)(b0)) __CLOBBER_CC)
+ #endif
+
+-#if defined (__arm__) && W_TYPE_SIZE == 32
++#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32
+ #define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "adds %2, %5, %6\n\t" \
+ "adcs %1, %3, %4\n\t" \
+
diff --git a/dev-libs/gmp/files/6.0.0a/ppc64-build.diff b/dev-libs/gmp/files/6.0.0a/ppc64-build.diff
new file mode 100644
index 000000000000..4d0ec5efcb83
--- /dev/null
+++ b/dev-libs/gmp/files/6.0.0a/ppc64-build.diff
@@ -0,0 +1,23 @@
+from upstream
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1395835068 -3600
+# Node ID 4a6d258b467f661da0894cc60ecd060f2e3c67c7
+# Parent 301ce2788826a2d4d2725bd5cf01e998638db37a
+Provide default for BMOD_1_TO_MOD_1_THRESHOLD.
+
+diff -r 301ce2788826 -r 4a6d258b467f mpn/powerpc64/mode64/gcd_1.asm
+--- a/mpn/powerpc64/mode64/gcd_1.asm Tue Mar 25 15:34:52 2014 +0100
++++ b/mpn/powerpc64/mode64/gcd_1.asm Wed Mar 26 12:57:48 2014 +0100
+@@ -43,6 +43,9 @@
+ define(`n', `r4')
+ define(`v0', `r5')
+
++ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
++ `define(`BMOD_1_TO_MOD_1_THRESHOLD',30)')
++
+ EXTERN_FUNC(mpn_mod_1)
+ EXTERN_FUNC(mpn_modexact_1c_odd)
+
+
diff --git a/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch b/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch
new file mode 100644
index 000000000000..093bec1a5dca
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch
@@ -0,0 +1,20 @@
+fixed executable stack
+
+http://bugs.gentoo.org/115038
+
+--- gmp-4.1.4/configure
++++ gmp-4.1.4/configure
+@@ -21689,6 +21689,13 @@
+ fi
+ echo "')" >> $gmp_configm4
+ echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
++# Gentoo hack
++case $host_os in
++ *linux*)
++ echo '.section .note.GNU-stack,"",%progbits' >> $gmp_configm4
++ echo '.previous' >> $gmp_configm4
++ ;;
++esac
+
+ # Create Makefiles
+ # FIXME: Upcoming version of autoconf/automake may not like broken lines.
diff --git a/dev-libs/gmp/files/gmp-4.2.1-s390.diff b/dev-libs/gmp/files/gmp-4.2.1-s390.diff
new file mode 100644
index 000000000000..82dbb722eb14
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-4.2.1-s390.diff
@@ -0,0 +1,68 @@
+stolen from SuSE
+
+--- configure.in
++++ configure.in
+@@ -1050,6 +1050,9 @@
+ ;;
+
+
++ s390x-*-*)
++ path="s390x" ;;
++
+ # IBM s/370 and similar
+ [s3[6-9]0*-*-*])
+ gcc_cflags="-O2 $fomit_frame_pointer"
+--- configure
++++ configure
+@@ -1050,6 +1050,9 @@
+ ;;
+
+
++ s390x-*-*)
++ path="s390x" ;;
++
+ # IBM s/370 and similar
+ s3[6-9]0*-*-*)
+ gcc_cflags="-O2 $fomit_frame_pointer"
+--- mpn/s390/gmp-mparam.h
++++ mpn/s390/gmp-mparam.h
+@@ -20,7 +20,8 @@
+ MA 02110-1301, USA. */
+
+
+-/* BITS_PER_MP_LIMB etc generated by configure */
++#define BITS_PER_MP_LIMB 32
++#define BYTES_PER_MP_LIMB 4
+
+
+ /* Generated by tuneup.c, 2001-12-03, gcc 2.95 */
+--- mpn/s390x/gmp-mparam.h
++++ mpn/s390x/gmp-mparam.h
+@@ -0,0 +1,27 @@
++/* gmp-mparam.h -- Compiler/machine parameter header file.
++
++Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
++
++This file is part of the GNU MP Library.
++
++The GNU MP Library is free software; you can redistribute it and/or modify
++it under the terms of the GNU Library General Public License as published by
++the Free Software Foundation; either version 2 of the License, or (at your
++option) any later version.
++
++The GNU MP Library is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
++or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
++License for more details.
++
++You should have received a copy of the GNU Library General Public License
++along with the GNU MP Library; see the file COPYING.LIB. If not, write to
++the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
++MA 02111-1307, USA. */
++
++#define BITS_PER_MP_LIMB 64
++#define BYTES_PER_MP_LIMB 8
++#define BITS_PER_LONGINT 64
++#define BITS_PER_INT 32
++#define BITS_PER_SHORTINT 16
++#define BITS_PER_CHAR 8
diff --git a/dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch b/dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch
new file mode 100644
index 000000000000..2f9911c1ea1b
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-4.3.2-ABI-multilib.patch
@@ -0,0 +1,256 @@
+Gentoo uses ABI env var already
+
+--- gmp-4.2.3/configure
++++ gmp-4.2.3/configure
+@@ -489,7 +489,7 @@
+ WANT_MPBSD_TRUE
+ WANT_MPBSD_FALSE
+ GMP_NAIL_BITS
+-ABI
++GMPABI
+ HAVE_HOST_CPU_FAMILY_power
+ HAVE_HOST_CPU_FAMILY_powerpc
+ GMP_LDFLAGS
+@@ -930,7 +930,7 @@
+ ac_precious_vars='build_alias
+ host_alias
+ target_alias
+-ABI
++GMPABI
+ CC
+ CFLAGS
+ LDFLAGS
+@@ -1091,7 +1091,7 @@
+ include additional configurations [automatic]
+
+ Some influential environment variables:
+- ABI desired ABI (for processors supporting more than one ABI)
++ GMPABI desired ABI (for processors supporting more than one ABI)
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+@@ -2670,7 +2670,7 @@
+ # (64-bit), but not both, so there's no option to choose the desired
+ # mode, we must instead detect which of the two it is. This is done by
+ # checking sizeof(long), either 4 or 8 bytes respectively. Do this in
+- # ABI=1.0 too, in case someone tries to build that with a 2.0w gcc.
++ # GMPABI=1.0 too, in case someone tries to build that with a 2.0w gcc.
+ #
+ gcc_cflags="-O2"
+ gcc_cflags_optlist="arch"
+@@ -2694,11 +2694,11 @@
+ # gcc 2.7.2.3 knows -mpa-risc-1-0 and -mpa-risc-1-1
+ # gcc 2.95 adds -mpa-risc-2-0, plus synonyms -march=1.0, 1.1 and 2.0
+ #
+- # We don't use -mpa-risc-2-0 in ABI=1.0 because 64-bit registers may not
++ # We don't use -mpa-risc-2-0 in GMPABI=1.0 because 64-bit registers may not
+ # be saved by the kernel on an old system. Actually gcc (as of 3.2)
+ # only adds a few float instructions with -mpa-risc-2-0, so it would
+ # probably be safe, but let's not take the chance. In any case, a
+- # configuration like --host=hppa2.0 ABI=1.0 is far from optimal.
++ # configuration like --host=hppa2.0 GMPABI=1.0 is far from optimal.
+ #
+ case $host_cpu in
+ hppa1.0*) gcc_cflags_arch="-mpa-risc-1-0" ;;
+@@ -2733,9 +2733,9 @@
+ cc_20n_cflags="+DA2.0 +e +O2 -Wl,+vnocompatwarnings"
+ cc_20n_testlist="hpc-hppa-2-0"
+
+- # ABI=2.0w is available for hppa2.0w and hppa2.0, but not for
++ # GMPABI=2.0w is available for hppa2.0w and hppa2.0, but not for
+ # hppa2.0n, on the assumption that that the latter indicates a
+- # desire for ABI=2.0n.
++ # desire for GMPABI=2.0n.
+ case $host in
+ hppa2.0n-*-*) ;;
+ *)
+@@ -3203,7 +3203,7 @@
+ # mode, but not set our ABI. For some reason it's sparc where this
+ # keeps coming up, presumably users there are accustomed to driving the
+ # compiler mode that way. The effect of our testlist setting is to
+- # reject ABI=64 in favour of ABI=32 if the user has forced the flags to
++ # reject GMPABI=64 in favour of GMPABI=32 if the user has forced the flags to
+ # 32-bit mode.
+ #
+ abilist="32"
+@@ -3308,12 +3308,12 @@
+ case $host_cpu in
+ sparc64 | sparcv9* | ultrasparc*)
+ case $host in
+- # Solaris 6 and earlier cannot run ABI=64 since it doesn't save
+- # registers properly, so ABI=32 is left as the only choice.
++ # Solaris 6 and earlier cannot run GMPABI=64 since it doesn't save
++ # registers properly, so GMPABI=32 is left as the only choice.
+ #
+ *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) ;;
+
+- # BSD sparc64 ports are 64-bit-only systems, so ABI=64 is the only
++ # BSD sparc64 ports are 64-bit-only systems, so GMPABI=64 is the only
+ # choice. In fact they need no special compiler flags, gcc -m64
+ # is the default, but it doesn't hurt to add it. v9 CPUs always
+ # use the sparc64 port, since the plain 32-bit sparc ports don't
+@@ -3399,7 +3399,7 @@
+ # -O, but lets assume that's no longer true.
+ #
+ # -m32 forces 32-bit mode on a bi-arch 32/64 amd64 build of gcc. -m64 is
+- # the default in such a build (we think), so -m32 is essential for ABI=32.
++ # the default in such a build (we think), so -m32 is essential for GMPABI=32.
+ # This is, of course, done for any $host_cpu, not just x86_64, so we can
+ # get such a gcc into the right mode to cross-compile to say i486-*-*.
+ #
+@@ -3639,7 +3639,7 @@
+
+ cat >&5 <<EOF
+ User:
+-ABI=$ABI
++GMPABI=$GMPABI
+ CC=$CC
+ CFLAGS=$CFLAGS_or_unset
+ CPPFLAGS=$CPPFLAGS_or_unset
+@@ -3660,24 +3660,24 @@
+ # If the user specifies an ABI then it must be in $abilist, after that
+ # $abilist is restricted to just that choice.
+ #
+-if test -n "$ABI"; then
++if test -n "$GMPABI"; then
+ found=no
+ for abi in $abilist; do
+- if test $abi = "$ABI"; then found=yes; break; fi
++ if test $abi = "$GMPABI"; then found=yes; break; fi
+ done
+ if test $found = no; then
+- { { echo "$as_me:$LINENO: error: ABI=$ABI is not among the following valid choices: $abilist" >&5
+-echo "$as_me: error: ABI=$ABI is not among the following valid choices: $abilist" >&2;}
++ { { echo "$as_me:$LINENO: error: GMPABI=$GMPABI is not among the following valid choices: $abilist" >&5
++echo "$as_me: error: GMPABI=$GMPABI is not among the following valid choices: $abilist" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+- abilist="$ABI"
++ abilist="$GMPABI"
+ fi
+
+ found_compiler=no
+
+ for abi in $abilist; do
+
+- echo "checking ABI=$abi"
++ echo "checking GMPABI=$abi"
+
+ # Suppose abilist="64 32", then for abi=64, will have abi1="_64" and
+ # abi2="_64". For abi=32, will have abi1="_32" and abi2="". This is how
+@@ -5128,7 +5128,7 @@
+ # For -march settings which enable SSE2 we exclude certain bad
+ # gcc versions and we need an OS knowing how to save xmm regs.
+ #
+- # This is only for ABI=32, any 64-bit gcc is good and any OS
++ # This is only for GMPABI=32, any 64-bit gcc is good and any OS
+ # knowing x86_64 will know xmm.
+ #
+ # -march=k8 was only introduced in gcc 3.3, so we shouldn't need
+@@ -6368,16 +6368,16 @@
+ done
+ fi
+
+- ABI="$abi"
++ GMPABI="$abi"
+ CC="$cc"
+ CFLAGS="$cflags"
+ CPPFLAGS="$cppflags"
+
+
+ # Could easily have this in config.h too, if desired.
+- ABI_nodots=`echo $ABI | sed 's/\./_/'`
++ GMPABI_nodots=`echo $GMPABI | sed 's/\./_/'`
+
+-echo "define_not_for_expansion(\`HAVE_ABI_$ABI_nodots')" >> $gmp_tmpconfigm4p
++echo "define_not_for_expansion(\`HAVE_ABI_$GMPABI_nodots')" >> $gmp_tmpconfigm4p
+
+
+
+@@ -8830,12 +8830,12 @@
+ # If there's any sse2 or mmx in the path, check whether the assembler
+ # supports it, and remove if not.
+ #
+-# We only need this in ABI=32, for ABI=64 on x86_64 we can assume a new
++# We only need this in GMPABI=32, for GMPABI=64 on x86_64 we can assume a new
+ # enough assembler.
+ #
+ case $host in
+ i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | athlon64-*-* | atom-*-* | core2-*-* | x86_64-*-*)
+- if test "$ABI" = 32; then
++ if test "$GMPABI" = 32; then
+ case "$path $fat_path" in
+ *mmx*) echo "$as_me:$LINENO: checking if the assembler knows about MMX instructions" >&5
+ echo $ECHO_N "checking if the assembler knows about MMX instructions... $ECHO_C" >&6
+@@ -9019,7 +9019,7 @@
+
+ cat >&5 <<EOF
+ Decided:
+-ABI=$ABI
++GMPABI=$GMPABI
+ CC=$CC
+ CFLAGS=$CFLAGS
+ CPPFLAGS=$CPPFLAGS
+@@ -9028,7 +9028,7 @@
+ CXXFLAGS=$CXXFLAGS
+ path=$path
+ EOF
+-echo "using ABI=\"$ABI\""
++echo "using GMPABI=\"$GMPABI\""
+ echo " CC=\"$CC\""
+ echo " CFLAGS=\"$CFLAGS\""
+ echo " CPPFLAGS=\"$CPPFLAGS\""
+@@ -30005,7 +30005,7 @@
+
+ case $host in
+ *-*-aix*)
+- case $ABI in
++ case $GMPABI in
+ 64 | aix64)
+ echo "include_mpn(\`powerpc64/aix.m4')" >> $gmp_tmpconfigm4i
+ ;;
+@@ -30015,7 +30015,7 @@
+ esac
+ ;;
+ *-*-linux* | *-*-*bsd*)
+- case $ABI in
++ case $GMPABI in
+ mode64)
+ echo "include_mpn(\`powerpc64/elf.m4')" >> $gmp_tmpconfigm4i
+ ;;
+@@ -30025,7 +30025,7 @@
+ esac
+ ;;
+ *-*-darwin*)
+- case $ABI in
++ case $GMPABI in
+ mode64)
+ echo "include_mpn(\`powerpc64/darwin.m4')" >> $gmp_tmpconfigm4i
+ ;;
+@@ -30048,7 +30048,7 @@
+
+ ;;
+ sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
+- case $ABI in
++ case $GMPABI in
+ 64)
+
+ echo "$as_me:$LINENO: checking if the assembler accepts \".register\"" >&5
+@@ -30130,7 +30130,7 @@
+ echo "define(<ALIGN_FILL_0x90>,<$gmp_cv_asm_align_fill_0x90>)" >> $gmp_tmpconfigm4
+
+
+- case $ABI in
++ case $GMPABI in
+ 32)
+
+ echo "include_mpn(\`x86/x86-defs.m4')" >> $gmp_tmpconfigm4i
+@@ -34032,7 +34032,7 @@
+ WANT_MPBSD_TRUE!$WANT_MPBSD_TRUE$ac_delim
+ WANT_MPBSD_FALSE!$WANT_MPBSD_FALSE$ac_delim
+ GMP_NAIL_BITS!$GMP_NAIL_BITS$ac_delim
+-ABI!$ABI$ac_delim
++GMPABI!$GMPABI$ac_delim
+ HAVE_HOST_CPU_FAMILY_power!$HAVE_HOST_CPU_FAMILY_power$ac_delim
+ HAVE_HOST_CPU_FAMILY_powerpc!$HAVE_HOST_CPU_FAMILY_powerpc$ac_delim
+ GMP_LDFLAGS!$GMP_LDFLAGS$ac_delim
diff --git a/dev-libs/gmp/files/gmp-5.0.0-s390.diff b/dev-libs/gmp/files/gmp-5.0.0-s390.diff
new file mode 100644
index 000000000000..14771a438ede
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.0-s390.diff
@@ -0,0 +1,68 @@
+stolen from SuSE
+
+--- configure.in
++++ configure.in
+@@ -1050,6 +1050,9 @@
+ ;;
+
+
++ s390x-*-*)
++ path="s390x" ;;
++
+ # IBM s/370 and similar
+ [s3[6-9]0*-*-*])
+ gcc_cflags="-O2 $fomit_frame_pointer"
+--- configure
++++ configure
+@@ -1050,6 +1050,9 @@
+ ;;
+
+
++ s390x-*-*)
++ path="s390x" ;;
++
+ # IBM s/370 and similar
+ s3[6-9]0*-*-*)
+ gcc_cflags="-O2 $fomit_frame_pointer"
+--- mpn/s390/gmp-mparam.h
++++ mpn/s390/gmp-mparam.h
+@@ -20,7 +20,8 @@
+ MA 02110-1301, USA. */
+
+
+-/* GMP_LIMB_BITS etc generated by configure */
++#define GMP_LIMB_BITS 32
++#define BYTES_PER_MP_LIMB 4
+
+
+ /* Generated by tuneup.c, 2001-12-03, gcc 2.95 */
+--- mpn/s390x/gmp-mparam.h
++++ mpn/s390x/gmp-mparam.h
+@@ -0,0 +1,27 @@
++/* gmp-mparam.h -- Compiler/machine parameter header file.
++
++Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
++
++This file is part of the GNU MP Library.
++
++The GNU MP Library is free software; you can redistribute it and/or modify
++it under the terms of the GNU Library General Public License as published by
++the Free Software Foundation; either version 2 of the License, or (at your
++option) any later version.
++
++The GNU MP Library is distributed in the hope that it will be useful, but
++WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
++or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
++License for more details.
++
++You should have received a copy of the GNU Library General Public License
++along with the GNU MP Library; see the file COPYING.LIB. If not, write to
++the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
++MA 02111-1307, USA. */
++
++#define GMP_LIMB_BITS 64
++#define BYTES_PER_MP_LIMB 8
++#define BITS_PER_LONGINT 64
++#define BITS_PER_INT 32
++#define BITS_PER_SHORTINT 16
++#define BITS_PER_CHAR 8
diff --git a/dev-libs/gmp/files/gmp-5.0.1-perfpow-test.patch b/dev-libs/gmp/files/gmp-5.0.1-perfpow-test.patch
new file mode 100644
index 000000000000..d1b8706082f0
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.1-perfpow-test.patch
@@ -0,0 +1,36 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1267122532 -3600
+# Node ID 794410151f5f966bcb5c3489b6441614990efe7c
+# Parent 948660e2e56d9cfaae035082b8fd473985505fb6
+Fix a test case to work for long long limbs.
+
+2010-02-25 Torbjorn Granlund <tege@gmplib.org>
+
+ * tests/mpz/t-perfpow.c (check_random): Use mp_limb_t type for limb
+ variables.
+
+diff -r 948660e2e56d -r 794410151f5f tests/mpz/t-perfpow.c
+--- a/tests/mpz/t-perfpow.c Thu Feb 25 16:08:21 2010 +0100
++++ b/tests/mpz/t-perfpow.c Thu Feb 25 19:28:52 2010 +0100
+@@ -2,7 +2,7 @@
+
+ Contributed to the GNU project by Torbjorn Granlund and Martin Boij.
+
+-Copyright 2008, 2009 Free Software Foundation, Inc.
++Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
+
+ This file is part of the GNU MP Library.
+
+@@ -109,7 +109,8 @@
+ {
+ mpz_t n, np, temp, primes[NRP];
+ int i, j, k, unique, destroy, res;
+- unsigned long int nrprimes, primebits, g, exp[NRP], e;
++ unsigned long int nrprimes, primebits;
++ mp_limb_t g, exp[NRP], e;
+ gmp_randstate_ptr rands;
+
+ rands = RANDS;
+
diff --git a/dev-libs/gmp/files/gmp-5.0.1-x86-nopie-tests.patch b/dev-libs/gmp/files/gmp-5.0.1-x86-nopie-tests.patch
new file mode 100644
index 000000000000..e2ec26f4de2c
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.1-x86-nopie-tests.patch
@@ -0,0 +1,130 @@
+2010-07-27 Magnus Granberg <zorry@gentoo.org>
+
+ #236054
+ tests/Makefile.in add -nopie to CFLAGS
+ test/misc/Makefile.in likewise
+ test/mpbsd/Makefile.in likewise
+ test/mpf/Makefile.in likewise
+ test/mpn/Makefile.in likewise
+ test/mpq/Makefile.in likewise
+ test/mpz/Makefile.in likewise
+ test/randMakefile.in likewise
+ test/cxx/Makefile.in likewise and CXXFLAGS
+
+--- a/tests/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/devel/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/devel/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/misc/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/misc/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpbsd/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpbsd/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpf/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpf/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpn/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpn/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpq/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpq/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpz/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpz/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/rand/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/rand/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/cxx/Makefile.in 2010-02-06 12:43:21.000000000 +0000
++++ b/tests/cxx/Makefile.in 2010-07-27 01:31:43.000000000 +0000
+@@ -189,13 +189,13 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+ CXX = @CXX@
+ CXXCPP = @CXXCPP@
+-CXXFLAGS = @CXXFLAGS@
++CXXFLAGS = @CXXFLAGS@ -nopie
+ CYGPATH_W = @CYGPATH_W@
+ DEFN_LONG_LONG_LIMB = @DEFN_LONG_LONG_LIMB@
+ DEFS = @DEFS@
diff --git a/dev-libs/gmp/files/gmp-5.0.2-unnormalised-dividends.patch b/dev-libs/gmp/files/gmp-5.0.2-unnormalised-dividends.patch
new file mode 100644
index 000000000000..f29f2eca1a90
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.2-unnormalised-dividends.patch
@@ -0,0 +1,21 @@
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1310730221 -7200
+# Node ID 538dfce27f410b910d5e2f011119269e224d16a3
+# Parent 03ed209dd7efd4f4fff0ce297bb3a8f7e7ba2366
+(mpn_dcpi1_bdiv_q): Get mpn_sub_1 size argument right.
+
+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;
+
diff --git a/dev-libs/gmp/files/gmp-5.0.2-x32-bugfix.patch b/dev-libs/gmp/files/gmp-5.0.2-x32-bugfix.patch
new file mode 100644
index 000000000000..a96136fcc3b8
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.2-x32-bugfix.patch
@@ -0,0 +1,94 @@
+UpstreamStatus: Pending
+
+When LONG_MIN is passed to val, -val is undefined. This patch fixes
+it. See for details: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
+
+--- gmp-4.3.2/mpf/iset_si.c.ll 2010-01-07 12:09:03.000000000 -0800
++++ gmp-4.3.2/mpf/iset_si.c 2011-11-30 16:42:35.827944358 -0800
+@@ -31,7 +31,7 @@ mpf_init_set_si (mpf_ptr r, long int val
+ r->_mp_prec = prec;
+ r->_mp_d = (mp_ptr) (*__gmp_allocate_func) ((prec + 1) * BYTES_PER_MP_LIMB);
+
+- vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val);
++ vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val);
+
+ r->_mp_d[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+--- gmp-4.3.2/mpf/set_si.c.ll 2010-01-07 12:09:03.000000000 -0800
++++ gmp-4.3.2/mpf/set_si.c 2011-11-30 16:42:47.823878367 -0800
+@@ -27,7 +27,7 @@ mpf_set_si (mpf_ptr dest, long val)
+ mp_size_t size;
+ mp_limb_t vl;
+
+- vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val);
++ vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val);
+
+ dest->_mp_d[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+--- gmp-4.3.2/mpz/cmp_si.c.ll 2010-01-07 12:09:03.000000000 -0800
++++ gmp-4.3.2/mpz/cmp_si.c 2011-11-30 13:44:25.923319700 -0800
+@@ -27,7 +27,7 @@ _mpz_cmp_si (mpz_srcptr u, signed long i
+ {
+ mp_size_t usize = u->_mp_size;
+ mp_size_t vsize;
+- mp_limb_t u_digit;
++ mp_limb_t u_digit, vl_digit;
+
+ #if GMP_NAIL_BITS != 0
+ /* FIXME. This isn't very pretty. */
+@@ -41,11 +41,14 @@ _mpz_cmp_si (mpz_srcptr u, signed long i
+
+ vsize = 0;
+ if (v_digit > 0)
+- vsize = 1;
++ {
++ vsize = 1;
++ vl_digit = (mp_limb_t) (unsigned long) v_digit;
++ }
+ else if (v_digit < 0)
+ {
+ vsize = -1;
+- v_digit = -v_digit;
++ vl_digit = (mp_limb_t) -(unsigned long) v_digit;
+ }
+
+ if (usize != vsize)
+@@ -56,10 +59,10 @@ _mpz_cmp_si (mpz_srcptr u, signed long i
+
+ u_digit = u->_mp_d[0];
+
+- if (u_digit == (mp_limb_t) (unsigned long) v_digit)
++ if (u_digit == vl_digit)
+ return 0;
+
+- if (u_digit > (mp_limb_t) (unsigned long) v_digit)
++ if (u_digit > vl_digit)
+ return usize;
+ else
+ return -usize;
+--- gmp-4.3.2/mpz/iset_si.c.ll 2010-01-07 12:09:03.000000000 -0800
++++ gmp-4.3.2/mpz/iset_si.c 2011-11-30 13:44:25.924319695 -0800
+@@ -31,7 +31,7 @@ mpz_init_set_si (mpz_ptr dest, signed lo
+ dest->_mp_alloc = 1;
+ dest->_mp_d = (mp_ptr) (*__gmp_allocate_func) (BYTES_PER_MP_LIMB);
+
+- vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val);
++ vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val);
+
+ dest->_mp_d[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
+--- gmp-4.3.2/mpz/set_si.c.ll 2010-01-07 12:09:03.000000000 -0800
++++ gmp-4.3.2/mpz/set_si.c 2011-11-30 13:44:25.947319574 -0800
+@@ -27,7 +27,7 @@ mpz_set_si (mpz_ptr dest, signed long in
+ mp_size_t size;
+ mp_limb_t vl;
+
+- vl = (mp_limb_t) (unsigned long int) (val >= 0 ? val : -val);
++ vl = (mp_limb_t) (val >= 0 ? (unsigned long int) val : -(unsigned long int) val);
+
+ dest->_mp_d[0] = vl & GMP_NUMB_MASK;
+ size = vl != 0;
diff --git a/dev-libs/gmp/files/gmp-5.0.2-x32-support.patch b/dev-libs/gmp/files/gmp-5.0.2-x32-support.patch
new file mode 100644
index 000000000000..28efee0a5eed
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.2-x32-support.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+Add X32 support in gmp configure.
+
+Patch Originator: H J Lu @ Intel
+Patch modified for Yocto by Nitin Kamble
+Signed Off By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/11/21
+
+--- gmp-4.3.2/configure
++++ gmp-4.3.2/configure
+@@ -1499,6 +1499,21 @@
+ path_64="x86_64/atom x86_64"
+ ;;
+ esac
++
++ # X32 support.
++ case x"$path_64" in
++ xx86_64*)
++ abilist="x32 64 32"
++ path_x32="$path_64"
++ limb_x32=longlong
++ cclist_x32="gcc"
++ gcc_x32_cflags="-O2 -mx32"
++ any_x32_testlist="sizeof-long-4"
++ CALLING_CONVENTIONS_OBJS_x32='amd64call.lo amd64check$U.lo'
++ SPEED_CYCLECOUNTER_OBJ_x32=x86_64.lo
++ cyclecounter_size_x32=2
++ ;;
++ esac
+ ;;
+ esac
+ ;;
+@@ -3039,7 +3058,7 @@
+ ;;
+ esac
+ ;;
+- 64)
++ 64|x32)
+
+ echo "include_mpn(\`x86_64/x86_64-defs.m4')" >> $gmp_tmpconfigm4i
+
diff --git a/dev-libs/gmp/files/gmp-5.0.5-x32-support.patch b/dev-libs/gmp/files/gmp-5.0.5-x32-support.patch
new file mode 100644
index 000000000000..b6867bf03abe
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.0.5-x32-support.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+Add X32 support in gmp configure.
+
+Patch Originator: H J Lu @ Intel
+Patch modified for Yocto by Nitin Kamble
+Signed Off By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/11/21
+
+--- gmp-5.0.5/configure
++++ gmp-5.0.5/configure
+@@ -5189,6 +5189,21 @@
+ esac
+ ;;
+ esac
++
++ # X32 support.
++ case x"$path_64" in
++ xx86_64*)
++ abilist="x32 64 32"
++ path_x32="$path_64"
++ limb_x32=longlong
++ cclist_x32="gcc"
++ gcc_x32_cflags="-O2 -mx32"
++ any_x32_testlist="sizeof-long-4"
++ CALLING_CONVENTIONS_OBJS_x32='amd64call.lo amd64check$U.lo'
++ SPEED_CYCLECOUNTER_OBJ_x32=x86_64.lo
++ cyclecounter_size_x32=2
++ ;;
++ esac
+ ;;
+
+
+@@ -3039,7 +3058,7 @@
+ ;;
+ esac
+ ;;
+- 64)
++ 64|x32)
+
+ echo "include_mpn(\`x86_64/x86_64-defs.m4')" >> $gmp_tmpconfigm4i
+
diff --git a/dev-libs/gmp/files/gmp-5.1.0-armv4.patch b/dev-libs/gmp/files/gmp-5.1.0-armv4.patch
new file mode 100644
index 000000000000..0337bd364968
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.1.0-armv4.patch
@@ -0,0 +1,12 @@
+fix missing __gmpn_invert_limb symbols w/armv4 targets
+
+--- a/configure
++++ b/configure
+@@ -582,6 +582,7 @@ case $host in
+ # options fail.
+ case $host_cpu in
+ armsa1 | armv4*)
++ path="arm"
+ ;;
+ armxscale | arm9te | arm10 | armv5*)
+ path="arm/v5 arm"
diff --git a/dev-libs/gmp/files/gmp-5.1.0-x32-support.patch b/dev-libs/gmp/files/gmp-5.1.0-x32-support.patch
new file mode 100644
index 000000000000..fda361d9b294
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.1.0-x32-support.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+Add X32 support in gmp configure.
+
+Patch Originator: H J Lu @ Intel
+Patch modified for Yocto by Nitin Kamble
+Signed Off By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/11/21
+
+--- gmp-5.1.0/configure
++++ gmp-5.1.0/configure
+@@ -5237,6 +5237,22 @@ echo "include_mpn(\`vax/elf.m4')" >> $gmp_tmpconfigm4i
+ extra_functions_64="invert_limb_table"
+ fi
+
++ # X32 support.
++ case x"$path_64" in
++ xx86_64*)
++ abilist="x32 64 32"
++ path_x32="$path_64"
++ limb_x32=longlong
++ cclist_x32="gcc"
++ gcc_x32_cflags="-O2 -mx32"
++ any_x32_testlist="sizeof-long-4"
++ CALLING_CONVENTIONS_OBJS_x32=$CALLING_CONVENTIONS_OBJS_64
++ SPEED_CYCLECOUNTER_OBJ_x32=$SPEED_CYCLECOUNTER_OBJ_64
++ cyclecounter_size_x32=$cyclecounter_size_64
++ extra_functions_x32=$extra_functions_64
++ ;;
++ esac
++
+ case $host in
+ *-*-solaris*)
+ # Sun cc.
+@@ -28611,7 +28627,7 @@ echo "include_mpn(\`x86/darwin.m4')" >> $gmp_tmpconfigm4i
+ ;;
+ esac
+ ;;
+- 64)
++ 64|x32)
+
+ echo "include_mpn(\`x86_64/x86_64-defs.m4')" >> $gmp_tmpconfigm4i
+
diff --git a/dev-libs/gmp/files/gmp-5.1.0-x86-nopie-tests.patch b/dev-libs/gmp/files/gmp-5.1.0-x86-nopie-tests.patch
new file mode 100644
index 000000000000..f21479f91110
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.1.0-x86-nopie-tests.patch
@@ -0,0 +1,119 @@
+2010-07-27 Magnus Granberg <zorry@gentoo.org>
+
+ #236054
+ tests/Makefile.in add -nopie to CFLAGS
+ test/misc/Makefile.in likewise
+ test/mpbsd/Makefile.in likewise
+ test/mpf/Makefile.in likewise
+ test/mpn/Makefile.in likewise
+ test/mpq/Makefile.in likewise
+ test/mpz/Makefile.in likewise
+ test/randMakefile.in likewise
+ test/cxx/Makefile.in likewise and CXXFLAGS
+
+--- a/tests/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/devel/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/devel/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/misc/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/misc/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpf/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpf/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpn/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpn/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpq/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpq/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/mpz/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/mpz/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/rand/Makefile.in 2010-07-27 00:53:05.000000000 +0000
++++ b/tests/rand/Makefile.in 2010-07-27 00:35:10.000000000 +0000
+@@ -200,7 +200,7 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+--- a/tests/cxx/Makefile.in 2010-02-06 12:43:21.000000000 +0000
++++ b/tests/cxx/Makefile.in 2010-07-27 01:31:43.000000000 +0000
+@@ -189,13 +189,13 @@
+ CC = @CC@
+ CCAS = @CCAS@
+ CC_FOR_BUILD = @CC_FOR_BUILD@
+-CFLAGS = @CFLAGS@
++CFLAGS = @CFLAGS@ -nopie
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CPP_FOR_BUILD = @CPP_FOR_BUILD@
+ CXX = @CXX@
+ CXXCPP = @CXXCPP@
+-CXXFLAGS = @CXXFLAGS@
++CXXFLAGS = @CXXFLAGS@ -nopie
+ CYGPATH_W = @CYGPATH_W@
+ DEFN_LONG_LONG_LIMB = @DEFN_LONG_LONG_LIMB@
+ DEFS = @DEFS@
diff --git a/dev-libs/gmp/gmp-4.3.2-r1.ebuild b/dev-libs/gmp/gmp-4.3.2-r1.ebuild
new file mode 100644
index 000000000000..c42ae5adf5f9
--- /dev/null
+++ b/dev-libs/gmp/gmp-4.3.2-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# this ebuild is only for the libgmp.so.3 ABI SONAME
+
+EAPI="3"
+
+inherit eutils libtool toolchain-funcs
+
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="LGPL-3"
+SLOT="3"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND="sys-devel/m4"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-4.3.2-ABI-multilib.patch
+ epatch "${FILESDIR}"/${PN}-4.2.1-s390.diff
+
+ sed -i -e 's:ABI = @ABI@:GMPABI = @GMPABI@:' \
+ Makefile.in */Makefile.in */*/Makefile.in
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+}
+
+src_configure() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) export GMPABI=32;;
+ 64|amd64|n64) export GMPABI=64;;
+ o32|n32) export GMPABI=${ABI};;
+ esac
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpfr \
+ --disable-mpbsd \
+ --disable-static \
+ --disable-cxx
+}
+
+src_install() {
+ emake install-libLTLIBRARIES DESTDIR="${D}" || die
+ rm "${D}"/usr/*/libgmp.{la,so} || die
+}
diff --git a/dev-libs/gmp/gmp-5.0.1.ebuild b/dev-libs/gmp/gmp-5.0.1.ebuild
new file mode 100644
index 000000000000..4ba74e920f68
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.0.1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool toolchain-funcs
+
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+# doc? ( http://www.nada.kth.se/~tege/${PN}-man-${PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="cxx" #doc
+
+DEPEND="sys-devel/m4"
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${P}-perfpow-test.patch
+ epatch "${FILESDIR}"/${PN}-5.0.0-s390.diff
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "${0}.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ o32|n32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpbsd \
+ $(use_enable cxx) \
+ || die "configure failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ #use doc && cp "${DISTDIR}"/gmp-man-${PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.0.2.ebuild b/dev-libs/gmp/gmp-5.0.2.ebuild
new file mode 100644
index 000000000000..c0f8675193c8
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.0.2.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool toolchain-funcs
+
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+# doc? ( http://www.nada.kth.se/~tege/${PN}-man-${PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="cxx" #doc
+
+DEPEND="sys-devel/m4"
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.0.0-s390.diff
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "${0}.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ o32|n32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpbsd \
+ $(use_enable cxx) \
+ || die "configure failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ #use doc && cp "${DISTDIR}"/gmp-man-${PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.0.2_p1.ebuild b/dev-libs/gmp/gmp-5.0.2_p1.ebuild
new file mode 100644
index 000000000000..14d44b475331
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.0.2_p1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.bz2
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx static-libs"
+
+DEPEND="sys-devel/m4"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${MY_P}.tar.bz2
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.0.0-s390.diff
+ epatch "${FILESDIR}"/${MY_P}-unnormalised-dividends.patch
+ has x32 $(get_all_abis) && epatch "${FILESDIR}"/${PN}-5.0.2*x32*.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "${0}.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpbsd \
+ $(use_enable cxx) \
+ $(use_enable static-libs static) \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.0.3.ebuild b/dev-libs/gmp/gmp-5.0.3.ebuild
new file mode 100644
index 000000000000..12825fd2e04c
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.0.3.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ xz -dc "${DISTDIR}/${MY_P}.tar.xz" | tar xof - || die
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.0.2*x32*.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "${0}.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpbsd \
+ $(use_enable cxx) \
+ $(use_enable static-libs static) \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.0.4.ebuild b/dev-libs/gmp/gmp-5.0.4.ebuild
new file mode 100644
index 000000000000..59e580cdf662
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.0.4.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool unpacker toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.0.2-x32-support.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "${0}.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpbsd \
+ $(use_enable cxx) \
+ $(use_enable static-libs static) \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.0.5.ebuild b/dev-libs/gmp/gmp-5.0.5.ebuild
new file mode 100644
index 000000000000..a11c1322dc19
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.0.5.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool unpacker toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.0.5-x32-support.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.0.1-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "${0}.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ --disable-mpbsd \
+ $(use_enable cxx) \
+ $(use_enable static-libs static) \
+ || die
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.1.0.ebuild b/dev-libs/gmp/gmp-5.1.0.ebuild
new file mode 100644
index 000000000000..7ba76d02287b
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.1.0.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool unpacker toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.1.0-armv4.patch
+ epatch "${FILESDIR}"/${PN}-5.1.0-x32-support.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.1.0-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+
+ emake || die
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup || die
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean || die
+ emake || die
+ fi
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.1.1.ebuild b/dev-libs/gmp/gmp-5.1.1.ebuild
new file mode 100644
index 000000000000..1d7af043c373
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.1.1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool unpacker toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+ epatch "${FILESDIR}"/${PN}-5.1.0-armv4.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.1.0-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+
+ emake || die
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup || die
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean || die
+ emake || die
+ fi
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.1.2.ebuild b/dev-libs/gmp/gmp-5.1.2.ebuild
new file mode 100644
index 000000000000..bc47d2605adb
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.1.2.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool unpacker toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.1.0-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+
+ emake || die
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup || die
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean || die
+ emake || die
+ fi
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.1.3-r1.ebuild b/dev-libs/gmp/gmp-5.1.3-r1.ebuild
new file mode 100644
index 000000000000..8946cc5d7ae3
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.1.3-r1.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic eutils libtool toolchain-funcs multilib-minimal
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r1
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+)"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( AUTHORS ChangeLog NEWS README doc/configuration doc/isa_abi_headache )
+HTML_DOCS=( doc )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
+
+src_prepare() {
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+multilib_src_configure() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ ECONF_SOURCE="${S}" econf \
+ --localstatedir=/var/state/gmp \
+ --enable-shared \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ emake
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean
+ emake
+ fi
+ fi
+}
+
+multilib_src_test() {
+ emake check
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-5.1.3.ebuild b/dev-libs/gmp/gmp-5.1.3.ebuild
new file mode 100644
index 000000000000..48ffa99cc28f
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.1.3.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit flag-o-matic eutils libtool unpacker toolchain-funcs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+
+ # disable -fPIE -pie in the tests for x86 #236054
+ if use x86 && gcc-specs-pie ; then
+ epatch "${FILESDIR}"/${PN}-5.1.0-x86-nopie-tests.patch
+ fi
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+src_compile() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ econf \
+ --localstatedir=/var/state/gmp \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+
+ emake || die
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup || die
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean || die
+ emake || die
+ fi
+ fi
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+
+ dodoc AUTHORS ChangeLog NEWS README
+ dodoc doc/configuration doc/isa_abi_headache
+ dohtml -r doc
+
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/gmp-6.0.0a.ebuild b/dev-libs/gmp/gmp-6.0.0a.ebuild
new file mode 100644
index 000000000000..44d16473fb53
--- /dev/null
+++ b/dev-libs/gmp/gmp-6.0.0a.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic eutils libtool toolchain-funcs multilib-minimal
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="|| ( LGPL-3+ GPL-2+ )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r1
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+)"
+
+S=${WORKDIR}/${MY_P%a}
+
+DOCS=( AUTHORS ChangeLog NEWS README doc/configuration doc/isa_abi_headache )
+HTML_DOCS=( doc )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
+
+src_prepare() {
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+multilib_src_configure() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ ECONF_SOURCE="${S}" econf \
+ --localstatedir=/var/state/gmp \
+ --enable-shared \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ emake
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean
+ emake
+ fi
+ fi
+}
+
+multilib_src_test() {
+ emake check
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/metadata.xml b/dev-libs/gmp/metadata.xml
new file mode 100644
index 000000000000..b419bd1ef173
--- /dev/null
+++ b/dev-libs/gmp/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>toolchain</herd>
+<use>
+ <flag name='pgo'>after building gmp, run some tests against to produce faster libraries -- this option will double the compile time</flag>
+</use>
+</pkgmetadata>