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