Contents of /trunk/core/gmp/gmp-5.0.5-r2.smage2
Parent Directory | Revision Log
Revision 12578 -
(show annotations)
(download)
Tue Jun 12 10:04:58 2012 UTC (12 years ago) by niro
File size: 3063 byte(s)
Tue Jun 12 10:04:58 2012 UTC (12 years ago) by niro
File size: 3063 byte(s)
-fixed missing mtools include
1 | # $Id$ |
2 | |
3 | PNAME="gmp" |
4 | PVER="5.0.5" |
5 | PBUILD="r2" |
6 | |
7 | PCAT="dev-libs" |
8 | STATE="unstable" |
9 | |
10 | DESCRIPTION="GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers." |
11 | HOMEPAGE="http://www.swox.com/gmp/" |
12 | |
13 | DEPEND=">= virtual/glibc |
14 | >= sys-libs/libstdc++-4.7" |
15 | |
16 | SRCFILE="${PNAME}-${PVER}.tar.bz2" |
17 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
18 | |
19 | # not multilib.sminc compat, don't use it! |
20 | sminclude mbuild mtools |
21 | |
22 | SRC_URI=( |
23 | gnu://${PNAME}/${SRCFILE} |
24 | mirror://${PNAME}/${SRCFILE} |
25 | ) |
26 | |
27 | UP2DATE="updatecmd_gnu ${PNAME}" |
28 | |
29 | src_compile() |
30 | { |
31 | install -d ${SRCDIR}/build |
32 | cd ${SRCDIR}/build |
33 | CPPFLAGS="-fexceptions" \ |
34 | CC="gcc -isystem /usr/include" \ |
35 | CXX="g++ -isystem /usr/include" \ |
36 | LDFLAGS="-Wl,-rpath-link,/$(mlibdir)" \ |
37 | ../configure \ |
38 | --build=${CHOST} \ |
39 | --host=${CHOST} \ |
40 | --prefix=/usr \ |
41 | --mandir=/usr/share/man \ |
42 | --infodir=/usr/share/info \ |
43 | --libdir=/usr/$(mlibdir) \ |
44 | --enable-mpbsd \ |
45 | --enable-cxx \ |
46 | || die |
47 | mmake || die |
48 | |
49 | # build 32bit libraries for multilib systems |
50 | if [[ ${ARCH} = x86_64 ]] |
51 | then |
52 | install -d ${SRCDIR}/build-m32 |
53 | cd ${SRCDIR}/build-m32 |
54 | CPPFLAGS="-fexceptions" \ |
55 | ABI=32 \ |
56 | CC="gcc -m${ABI} -isystem /usr/include" \ |
57 | CXX="g++ -m${ABI} -isystem /usr/include" \ |
58 | LDFLAGS="-Wl,-rpath-link,/lib -m${ABI}" \ |
59 | ../configure \ |
60 | --build=${CHOST} \ |
61 | --host=${CHOST} \ |
62 | --prefix=/usr \ |
63 | --mandir=/usr/share/man \ |
64 | --infodir=/usr/share/info \ |
65 | --libdir=/usr/lib \ |
66 | --enable-mpbsd \ |
67 | --enable-cxx \ |
68 | || die |
69 | mmake || die |
70 | fi |
71 | } |
72 | |
73 | src_check() |
74 | { |
75 | cd ${SRCDIR}/build |
76 | make -k check || die |
77 | |
78 | if [[ ${ARCH} = x86_64 ]] |
79 | then |
80 | cd ${SRCDIR}/build-m32 |
81 | make -k check || die |
82 | fi |
83 | } |
84 | |
85 | src_install() |
86 | { |
87 | cd ${SRCDIR}/build |
88 | make DESTDIR=${BINDIR} install || die |
89 | |
90 | # build 32bit libraries for multilib systems |
91 | if [[ ${ARCH} = x86_64 ]] |
92 | then |
93 | # move the 64bit header |
94 | mv ${BINDIR}/usr/include/gmp{,-64}.h || die |
95 | minstallfile gmp-mparam.h /usr/include/gmp-mparam-64.h || die |
96 | |
97 | cd ${SRCDIR}/build-m32 |
98 | make DESTDIR=${BINDIR} install || die |
99 | |
100 | # move the 32bit header |
101 | mv ${BINDIR}/usr/include/gmp{,-32}.h || die |
102 | minstallfile gmp-mparam.h /usr/include/gmp-mparam-32.h || die |
103 | |
104 | # create a wrapper header |
105 | cat > ${BINDIR}/usr/include/gmp.h << "EOF" |
106 | /* gmp.h - Stub Header */ |
107 | #ifndef __STUB__GMP_H__ |
108 | #define __STUB__GMP_H__ |
109 | |
110 | #if defined(__x86_64__) || \ |
111 | defined(__sparc64__) || \ |
112 | defined(__arch64__) || \ |
113 | defined(__powerpc64__) || \ |
114 | defined (__s390x__) |
115 | # include "gmp-64.h" |
116 | #else |
117 | # include "gmp-32.h" |
118 | #endif |
119 | |
120 | #endif /* __STUB__GMP_H__ */ |
121 | EOF |
122 | # create a wrapper header |
123 | cat > ${BINDIR}/usr/include/gmp-mparam.h << "EOF" |
124 | /* gmp-mparam.h - Stub Header */ |
125 | #ifndef __STUB__GMP_MPARAM_H__ |
126 | #define __STUB__GMP_MPARAM_H__ |
127 | |
128 | #if defined(__x86_64__) || \ |
129 | defined(__sparc64__) || \ |
130 | defined(__arch64__) || \ |
131 | defined(__powerpc64__) || \ |
132 | defined (__s390x__) |
133 | # include "gmp-mparam-64.h" |
134 | #else |
135 | # include "gmp-mparam-32.h" |
136 | #endif |
137 | |
138 | #endif /* __STUB__GMP_MPARAM_H__ */ |
139 | EOF |
140 | fi |
141 | |
142 | cd ${SRCDIR} |
143 | minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die |
144 | } |