Magellan Linux

Contents of /trunk/core/gmp/gmp-5.0.5-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12566 - (show annotations) (download)
Tue Jun 12 08:03:03 2012 UTC (11 years, 11 months ago) by niro
File size: 2497 byte(s)
-rev bump to 5.0.5-r2; rebuild against new toolchain (gcc-4.7.0, glibc-2.15)
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
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
96 cd ${SRCDIR}/build-m32
97 make DESTDIR=${BINDIR} install || die
98
99 # move the 32bit header
100 mv ${BINDIR}/usr/include/gmp{,-32}.h || die
101
102 # create a wrapper header
103 cat > ${BINDIR}/usr/include/gmp.h << "EOF"
104 /* gmp.h - Stub Header */
105 #ifndef __STUB__GMP_H__
106 #define __STUB__GMP_H__
107
108 #if defined(__x86_64__) || \
109 defined(__sparc64__) || \
110 defined(__arch64__) || \
111 defined(__powerpc64__) || \
112 defined (__s390x__)
113 # include "gmp-64.h"
114 #else
115 # include "gmp-32.h"
116 #endif
117
118 #endif /* __STUB__GMP_H__ */
119 EOF
120 fi
121
122 cd ${SRCDIR}
123 minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die
124 }