Magellan Linux

Contents of /trunk/core/gmp/gmp-5.0.4-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11476 - (show annotations) (download)
Sat Mar 10 18:46:36 2012 UTC (12 years, 2 months ago) by niro
File size: 2480 byte(s)
auto added: ver bump to 5.0.4-r1
1 # $Id$
2
3 PNAME="gmp"
4 PVER="5.0.4"
5 PBUILD="r1"
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++-4.6"
14
15 SRCFILE="${PNAME}-${PVER}.tar.bz2"
16 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
17
18 # not multilib.sminc compat, don't use it!
19 sminclude mbuild
20
21 SRC_URI=(
22 gnu://${PNAME}/${SRCFILE}
23 mirror://${PNAME}/${SRCFILE}
24 )
25
26 UP2DATE="updatecmd_gnu ${PNAME}"
27
28 src_compile()
29 {
30 install -d ${SRCDIR}/build
31 cd ${SRCDIR}/build
32 CPPFLAGS="-fexceptions" \
33 CC="gcc -isystem /usr/include" \
34 CXX="g++ -isystem /usr/include" \
35 LDFLAGS="-Wl,-rpath-link,/$(mlibdir)" \
36 ../configure \
37 --build=${CHOST} \
38 --host=${CHOST} \
39 --prefix=/usr \
40 --mandir=/usr/share/man \
41 --infodir=/usr/share/info \
42 --libdir=/usr/$(mlibdir) \
43 --enable-mpbsd \
44 --enable-cxx \
45 || die
46 mmake || die
47
48 # build 32bit libraries for multilib systems
49 if [[ ${ARCH} = x86_64 ]]
50 then
51 install -d ${SRCDIR}/build-m32
52 cd ${SRCDIR}/build-m32
53 CPPFLAGS="-fexceptions" \
54 ABI=32 \
55 CC="gcc -m${ABI} -isystem /usr/include" \
56 CXX="g++ -m${ABI} -isystem /usr/include" \
57 LDFLAGS="-Wl,-rpath-link,/lib -m${ABI}" \
58 ../configure \
59 --build=${CHOST} \
60 --host=${CHOST} \
61 --prefix=/usr \
62 --mandir=/usr/share/man \
63 --infodir=/usr/share/info \
64 --libdir=/usr/lib \
65 --enable-mpbsd \
66 --enable-cxx \
67 || die
68 mmake || die
69 fi
70 }
71
72 src_check()
73 {
74 cd ${SRCDIR}/build
75 make -k check || die
76
77 if [[ ${ARCH} = x86_64 ]]
78 then
79 cd ${SRCDIR}/build-m32
80 make -k check || die
81 fi
82 }
83
84 src_install()
85 {
86 cd ${SRCDIR}/build
87 make DESTDIR=${BINDIR} install || die
88
89 # build 32bit libraries for multilib systems
90 if [[ ${ARCH} = x86_64 ]]
91 then
92 # move the 64bit header
93 mv ${BINDIR}/usr/include/gmp{,-64}.h || die
94
95 cd ${SRCDIR}/build-m32
96 make DESTDIR=${BINDIR} install || die
97
98 # move the 32bit header
99 mv ${BINDIR}/usr/include/gmp{,-32}.h || die
100
101 # create a wrapper header
102 cat > ${BINDIR}/usr/include/gmp.h << "EOF"
103 /* gmp.h - Stub Header */
104 #ifndef __STUB__GMP_H__
105 #define __STUB__GMP_H__
106
107 #if defined(__x86_64__) || \
108 defined(__sparc64__) || \
109 defined(__arch64__) || \
110 defined(__powerpc64__) || \
111 defined (__s390x__)
112 # include "gmp-64.h"
113 #else
114 # include "gmp-32.h"
115 #endif
116
117 #endif /* __STUB__GMP_H__ */
118 EOF
119 fi
120
121 cd ${SRCDIR}
122 minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die
123 }