diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-04-04 21:58:11 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-04-04 21:58:11 +0000 |
commit | 2b1419790b7c91d256e4269d35eb3a669cae4d4e (patch) | |
tree | 70f33a5c4e7e2ec4773a79b696315c3156a11c19 /dev-libs/gmp | |
parent | Marked stable on PPC. Tested on PowerBook 5,9 connected to ejabberd. As reque... (diff) | |
download | gentoo-2-2b1419790b7c91d256e4269d35eb3a669cae4d4e.tar.gz gentoo-2-2b1419790b7c91d256e4269d35eb3a669cae4d4e.tar.bz2 gentoo-2-2b1419790b7c91d256e4269d35eb3a669cae4d4e.zip |
Some more fixes from upstream and snipe a fix for s390x from SuSE.
(Portage version: 2.1.2.3)
Diffstat (limited to 'dev-libs/gmp')
-rw-r--r-- | dev-libs/gmp/ChangeLog | 10 | ||||
-rw-r--r-- | dev-libs/gmp/files/4.2.1/gmpxx.h.ternary.diff | 519 | ||||
-rw-r--r-- | dev-libs/gmp/files/4.2.1/mpz_set_d.diff | 12 | ||||
-rw-r--r-- | dev-libs/gmp/files/digest-gmp-4.2.1-r1 | 6 | ||||
-rw-r--r-- | dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch | 2 | ||||
-rw-r--r-- | dev-libs/gmp/files/gmp-4.2.1-s390.diff | 68 | ||||
-rw-r--r-- | dev-libs/gmp/gmp-4.2.1-r1.ebuild | 77 |
7 files changed, 692 insertions, 2 deletions
diff --git a/dev-libs/gmp/ChangeLog b/dev-libs/gmp/ChangeLog index 52d7c9ec0317..0eb40772e375 100644 --- a/dev-libs/gmp/ChangeLog +++ b/dev-libs/gmp/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-libs/gmp # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/ChangeLog,v 1.85 2007/02/22 12:09:46 blubb Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/ChangeLog,v 1.86 2007/04/04 21:58:11 vapier Exp $ + +*gmp-4.2.1-r1 (04 Apr 2007) + + 04 Apr 2007; Mike Frysinger <vapier@gentoo.org> + files/gmp-4.1.4-noexecstack.patch, +files/4.2.1/mpz_set_d.diff, + +files/gmp-4.2.1-s390.diff, +files/4.2.1/gmpxx.h.ternary.diff, + +gmp-4.2.1-r1.ebuild: + Some more fixes from upstream and snipe a fix for s390x from SuSE. 22 Feb 2007; Simon Stelling <blubb@gentoo.org> gmp-4.2.1.ebuild: replace some more ABIs with GMPABI; fix taken from kanaka's auto-multilib diff --git a/dev-libs/gmp/files/4.2.1/gmpxx.h.ternary.diff b/dev-libs/gmp/files/4.2.1/gmpxx.h.ternary.diff new file mode 100644 index 000000000000..79bbb1ab3807 --- /dev/null +++ b/dev-libs/gmp/files/4.2.1/gmpxx.h.ternary.diff @@ -0,0 +1,519 @@ +Index: gmpxx.h +=================================================================== +RCS file: /home/cvsfiles/gmp42/gmpxx.h,v +retrieving revision 1.4 +retrieving revision 1.5 +diff -p -2 -r1.4 -r1.5 +*** gmpxx.h 8 Apr 2006 19:58:48 -0000 1.4 +--- gmpxx.h 31 Oct 2006 10:40:59 -0000 1.5 +*************** struct __gmp_cmp_function +*** 1278,1367 **** + }; + +- struct __gmp_ternary_addmul // z = w + v * u +- { +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, mpz_srcptr u) +- { mpz_set(z, w); mpz_addmul(z, v, u); } +- +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, unsigned long int l) +- { mpz_set(z, w); mpz_addmul_ui(z, v, l); } +- static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l, mpz_srcptr v) +- { mpz_set(z, w); mpz_addmul_ui(z, v, l); } +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, signed long int l) +- { +- mpz_set(z, w); +- if (l >= 0) +- mpz_addmul_ui(z, v, l); +- else +- mpz_submul_ui(z, v, -l); +- } +- static void eval(mpz_ptr z, mpz_srcptr w, signed long int l, mpz_srcptr v) +- { +- mpz_set(z, w); +- if (l >= 0) +- mpz_addmul_ui(z, v, l); +- else +- mpz_submul_ui(z, v, -l); +- } +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, double d) +- { +- mpz_t temp; +- mpz_init_set_d(temp, d); +- mpz_set(z, w); +- mpz_addmul(z, v, temp); +- mpz_clear(temp); +- } +- static void eval(mpz_ptr z, mpz_srcptr w, double d, mpz_srcptr v) +- { +- mpz_t temp; +- mpz_init_set_d(temp, d); +- mpz_set(z, w); +- mpz_addmul(z, temp, v); +- mpz_clear(temp); +- } +- }; +- +- struct __gmp_ternary_submul // z = w - v * u +- { +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, mpz_srcptr u) +- { mpz_set(z, w); mpz_submul(z, v, u); } +- +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, unsigned long int l) +- { mpz_set(z, w); mpz_submul_ui(z, v, l); } +- static void eval(mpz_ptr z, mpz_srcptr w, unsigned long int l, mpz_srcptr v) +- { mpz_set(z, w); mpz_submul_ui(z, v, l); } +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, signed long int l) +- { +- mpz_set(z, w); +- if (l >= 0) +- mpz_submul_ui(z, v, l); +- else +- mpz_addmul_ui(z, v, -l); +- } +- static void eval(mpz_ptr z, mpz_srcptr w, signed long int l, mpz_srcptr v) +- { +- mpz_set(z, w); +- if (l >= 0) +- mpz_submul_ui(z, v, l); +- else +- mpz_addmul_ui(z, v, -l); +- } +- static void eval(mpz_ptr z, mpz_srcptr w, mpz_srcptr v, double d) +- { +- mpz_t temp; +- mpz_init_set_d(temp, d); +- mpz_set(z, w); +- mpz_submul(z, v, temp); +- mpz_clear(temp); +- } +- static void eval(mpz_ptr z, mpz_srcptr w, double d, mpz_srcptr v) +- { +- mpz_t temp; +- mpz_init_set_d(temp, d); +- mpz_set(z, w); +- mpz_submul(z, temp, v); +- mpz_clear(temp); +- } +- }; +- + struct __gmp_rand_function + { +--- 1278,1281 ---- +*************** __GMPZQ_DEFINE_EXPR(__gmp_binary_minus) +*** 2863,3277 **** + + +- /* Integer ternary expressions of the kind `a+b*c' or `a*b+c' can be +- evaluated directly via mpz_addmul */ +- +- // a + b * c +- #define __GMP_DEFINE_TERNARY_EXPR(eval_fun1, eval_fun2, eval_both) \ +- \ +- template <> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { eval_both::eval \ +- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \ +- expr.val2.get_val2().get_mpz_t()); } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, T, eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, T, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { eval_both::eval \ +- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \ +- expr.val2.get_val2()); } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<T, mpz_class, eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr \ +- <mpz_t, __gmp_binary_expr<T, mpz_class, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { eval_both::eval \ +- (z, expr.val1.get_mpz_t(), expr.val2.get_val1(), \ +- expr.val2.get_val2().get_mpz_t()); } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpz_t, T>, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <mpz_class, __gmp_expr<mpz_t, T>, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val2.get_val2()); \ +- eval_both::eval \ +- (z, expr.val1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \ +- temp.get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, mpz_class, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <__gmp_expr<mpz_t, T>, mpz_class, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val2.get_val1()); \ +- eval_both::eval(z, expr.val1.get_mpz_t(), temp.get_mpz_t(), \ +- expr.val2.get_val2().get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, U, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <__gmp_expr<mpz_t, T>, U, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val2.get_val1()); \ +- eval_both::eval \ +- (z, expr.val1.get_mpz_t(), temp.get_mpz_t(), expr.val2.get_val2()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<T, __gmp_expr<mpz_t, U>, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <T, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val2.get_val2()); \ +- eval_both::eval \ +- (z, expr.val1.get_mpz_t(), expr.val2.get_val1(), temp.get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr \ +- <mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, __gmp_expr<mpz_t, U>, \ +- eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef mpz_class val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <__gmp_expr<mpz_t, T>, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp1(expr.val2.get_val1()); \ +- mpz_class temp2(expr.val2.get_val2()); \ +- eval_both::eval \ +- (z, expr.val1.get_mpz_t(), temp1.get_mpz_t(), temp2.get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, mpz_class, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val1); \ +- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \ +- expr.val2.get_val2().get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, U, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr \ +- <mpz_t, __gmp_binary_expr<mpz_class, U, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val1); \ +- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \ +- expr.val2.get_val2()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<U, mpz_class, eval_fun1> >, \ +- eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr \ +- <mpz_t, __gmp_binary_expr<U, mpz_class, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp(expr.val1); \ +- eval_both::eval(z, temp.get_mpz_t(), expr.val2.get_val1(), \ +- expr.val2.get_val2().get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<mpz_class, __gmp_expr<mpz_t, U>, \ +- eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <mpz_class, __gmp_expr<mpz_t, U>, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp1(expr.val1); \ +- mpz_class temp2(expr.val2.get_val2()); \ +- eval_both::eval \ +- (z, temp1.get_mpz_t(), expr.val2.get_val1().get_mpz_t(), \ +- temp2.get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, mpz_class, \ +- eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <__gmp_expr<mpz_t, U>, mpz_class, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp1(expr.val1); \ +- mpz_class temp2(expr.val2.get_val1()); \ +- eval_both::eval(z, temp1.get_mpz_t(), temp2.get_mpz_t(), \ +- expr.val2.get_val2().get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U, class V> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, V, \ +- eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <__gmp_expr<mpz_t, U>, V, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp1(expr.val1); \ +- mpz_class temp2(expr.val2.get_val1()); \ +- eval_both::eval \ +- (z, temp1.get_mpz_t(), temp2.get_mpz_t(), expr.val2.get_val2()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U, class V> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<U, __gmp_expr<mpz_t, V>, \ +- eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <U, __gmp_expr<mpz_t, V>, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp1(expr.val1); \ +- mpz_class temp2(expr.val2.get_val2()); \ +- eval_both::eval \ +- (z, temp1.get_mpz_t(), expr.val2.get_val1(), temp2.get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; \ +- \ +- template <class T, class U, class V> \ +- class __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, T>, \ +- __gmp_expr<mpz_t, __gmp_binary_expr<__gmp_expr<mpz_t, U>, \ +- __gmp_expr<mpz_t, V>, eval_fun1> >, eval_fun2> > \ +- { \ +- private: \ +- typedef __gmp_expr<mpz_t, T> val1_type; \ +- typedef __gmp_expr<mpz_t, __gmp_binary_expr \ +- <__gmp_expr<mpz_t, U>, __gmp_expr<mpz_t, V>, eval_fun1> > val2_type; \ +- \ +- __gmp_binary_expr<val1_type, val2_type, eval_fun2> expr; \ +- public: \ +- __gmp_expr(const val1_type &val1, const val2_type &val2) \ +- : expr(val1, val2) { } \ +- void eval(mpz_ptr z) const \ +- { \ +- mpz_class temp1(expr.val1); \ +- mpz_class temp2(expr.val2.get_val1()); \ +- mpz_class temp3(expr.val2.get_val2()); \ +- eval_both::eval \ +- (z, temp1.get_mpz_t(), temp2.get_mpz_t(), temp3.get_mpz_t()); \ +- } \ +- const val1_type & get_val1() const { return expr.val1; } \ +- const val2_type & get_val2() const { return expr.val2; } \ +- unsigned long int get_prec() const { return mpf_get_default_prec(); } \ +- }; +- +- +- __GMP_DEFINE_TERNARY_EXPR(__gmp_binary_multiplies, __gmp_binary_plus, +- __gmp_ternary_addmul) +- __GMP_DEFINE_TERNARY_EXPR(__gmp_binary_multiplies, __gmp_binary_minus, +- __gmp_ternary_submul) + + /**************** Macros for defining functions ****************/ +--- 2777,2780 ---- diff --git a/dev-libs/gmp/files/4.2.1/mpz_set_d.diff b/dev-libs/gmp/files/4.2.1/mpz_set_d.diff new file mode 100644 index 000000000000..6c4d0cfdcbbb --- /dev/null +++ b/dev-libs/gmp/files/4.2.1/mpz_set_d.diff @@ -0,0 +1,12 @@ +*** mpz/set_d.c 14 Mar 2006 15:57:54 -0000 1.1 +--- mpz/set_d.c 31 May 2006 14:50:05 -0000 1.2 +*************** mpz_set_d (mpz_ptr r, double d) +*** 57,60 **** +--- 58,64 ---- + _mpz_realloc (r, rn); + ++ if (rn <= 0) ++ rn = 0; ++ + rp = PTR (r); + diff --git a/dev-libs/gmp/files/digest-gmp-4.2.1-r1 b/dev-libs/gmp/files/digest-gmp-4.2.1-r1 new file mode 100644 index 000000000000..dc6f8c7b5df0 --- /dev/null +++ b/dev-libs/gmp/files/digest-gmp-4.2.1-r1 @@ -0,0 +1,6 @@ +MD5 091c56e0e1cca6b09b17b69d47ef18e3 gmp-4.2.1.tar.bz2 1726453 +RMD160 831e02a36ac7b466857f8fafeffad7d51f7656e7 gmp-4.2.1.tar.bz2 1726453 +SHA256 d07ffcb37eecec35c5ec72516d10b35fdf6e6fef1fcf1dcd37e30b8cbf8bf941 gmp-4.2.1.tar.bz2 1726453 +MD5 09ab91ee64673cb78af2a02a310fd15b gmp-man-4.2.1.pdf 996792 +RMD160 3f8ea92b95e985d09ed8d5b45952ccf98fbd9dac gmp-man-4.2.1.pdf 996792 +SHA256 3bee6b5285eea339a5ea949cd9db12fe5f676f15beff8ae9cbee0011be24beef gmp-man-4.2.1.pdf 996792 diff --git a/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch b/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch index 8adc25d8b3e2..56f4604fc763 100644 --- a/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch +++ b/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch @@ -13,7 +13,7 @@ fixed executable stack as per bug #115038 thanks to Petteri Räty --- gmp-4.1.4/nostackexec +++ gmp-4.1.4/nostackexec @@ -0,0 +1,4 @@ -+#ifdef __ELF__ ++#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +.previous +#endif 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/gmp-4.2.1-r1.ebuild b/dev-libs/gmp/gmp-4.2.1-r1.ebuild new file mode 100644 index 000000000000..b21e2053e68e --- /dev/null +++ b/dev-libs/gmp/gmp-4.2.1-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/gmp-4.2.1-r1.ebuild,v 1.1 2007/04/04 21:58:11 vapier Exp $ + +inherit flag-o-matic eutils libtool + +DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers" +HOMEPAGE="http://www.swox.com/gmp/" +SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2 + doc? ( http://www.swox.se/${PN}/${PN}-man-${PV}.pdf )" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd" +IUSE="doc nocxx" + +RDEPEND="" +DEPEND="" + +src_unpack () { + unpack ${A} + cd "${S}" + EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV} + epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch + epatch "${FILESDIR}"/${P}-ABI-multilib.patch + epatch "${FILESDIR}"/${P}-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_compile() { + # GMP believes hppa2.0 is 64bit + if [[ ${CHOST} == hppa2.0-* ]] ; then + is_hppa_2_0=1 + export CHOST="${CHOST/2.0/1.1}" + fi + + # ABI mappings (needs all architectures supported) + if [ -n "${ABI}" ]; then + [ "${ABI}" = "32" ] && export GMPABI=32 + [ "${ABI}" = "64" ] && export GMPABI=64 + [ "${ABI}" = "x86" ] && export GMPABI=32 + [ "${ABI}" = "amd64" ] && export GMPABI=64 + [ "${ABI}" = "n64" ] && export GMPABI=64 + [ "${ABI}" = "o32" ] && export GMPABI=o32 + [ "${ABI}" = "n32" ] && export GMPABI=n32 + fi + + econf \ + --localstatedir=/var/state/gmp \ + --disable-mpfr \ + --disable-mpbsd \ + $(use_enable !nocxx cxx) \ + || die "configure failed" + + # Fix the ABI for hppa2.0 + if [ ! -z "${is_hppa_2_0}" ]; then + sed -i "${S}/config.h" -e 's:pa32/hppa1_1:pa32/hppa2_0:' + export CHOST="${CHOST/1.1/2.0}" + fi + + 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}/ +} |