Magellan Linux

Contents of /branches/magellan-next/core/gmp/gmp-5.0.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5822 - (show annotations) (download)
Mon Aug 16 19:44:18 2010 UTC (13 years, 10 months ago) by niro
File size: 2435 byte(s)
auto added: ver bump to 5.0.1-r1
1 # $Id: gmp-4.3.1-r2.smage2 3003 2009-10-05 19:14:19Z niro $
2
3 PNAME="gmp"
4 PVER="5.0.1"
5 PBUILD="r1"
6
7 PCATEGORIE="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 # do not depend on glibc, as it depends ob libstdc++ and this wants gmp
14 # as SRCDEPEND -> this may generate loops
15 DEPEND=""
16
17 SRCFILE="${PNAME}-${PVER}.tar.bz2"
18 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
19
20 # not multilib.sminc compat, don't use it!
21 sminclude mbuild
22
23 SRC_URI=(
24 gnu://${PNAME}/${SRCFILE}
25 mirror://${PNAME}/${SRCFILE}
26 )
27
28 UP2DATE="updatecmd_gnu ${PNAME}"
29
30 src_compile()
31 {
32 install -d ${SRCDIR}/build
33 cd ${SRCDIR}/build
34 CPPFLAGS="-fexceptions" \
35 CC="gcc -m64 -isystem /usr/include" \
36 CXX="g++ -m64 -isystem /usr/include" \
37 LDFLAGS="-Wl,-rpath-link,/lib -m64" \
38 ../configure \
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 -m32 -isystem /usr/include" \
57 CXX="g++ -m32 -isystem /usr/include" \
58 LDFLAGS="-Wl,-rpath-link,/lib -m32" \
59 ../configure \
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_install()
73 {
74 cd ${SRCDIR}/build
75 make DESTDIR=${BINDIR} install || die
76
77 # build 32bit libraries for multilib systems
78 if [[ ${ARCH} = x86_64 ]]
79 then
80 # move the 64bit header
81 mv ${BINDIR}/usr/include/gmp{,-64}.h || die
82
83 cd ${SRCDIR}/build-m32
84 make DESTDIR=${BINDIR} install || die
85
86 # move the 32bit header
87 mv ${BINDIR}/usr/include/gmp{,-32}.h || die
88
89 # create a wrapper header
90 cat > ${BINDIR}/usr/include/gmp.h << "EOF"
91 /* gmp.h - Stub Header */
92 #ifndef __STUB__GMP_H__
93 #define __STUB__GMP_H__
94
95 #if defined(__x86_64__) || \
96 defined(__sparc64__) || \
97 defined(__arch64__) || \
98 defined(__powerpc64__) || \
99 defined (__s390x__)
100 # include "gmp-64.h"
101 #else
102 # include "gmp-32.h"
103 #endif
104
105 #endif /* __STUB__GMP_H__ */
106 EOF
107 fi
108
109 cd ${SRCDIR}
110 minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die
111 }