Magellan Linux

Contents of /smage/trunk/core/gmp/gmp-5.0.1-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 628 - (show annotations) (download)
Tue Oct 19 17:12:45 2010 UTC (13 years, 6 months ago) by niro
File size: 2488 byte(s)
auto added: ver bump to 5.0.1-r2
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="r2"
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 mcore
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 -isystem /usr/include" \
36 CXX="g++ -isystem /usr/include" \
37 LDFLAGS="-Wl,-rpath-link,/$(mlibdir)" \
38 ../configure \
39 --build=${CHOST} \
40 --host=${CHOST} \
41 --prefix=/usr \
42 --mandir=/usr/share/man \
43 --infodir=/usr/share/info \
44 --libdir=/usr/$(mlibdir) \
45 --enable-mpbsd \
46 --enable-cxx \
47 || die
48 mmake || die
49
50 # build 32bit libraries for multilib systems
51 if [[ ${ARCH} = x86_64 ]]
52 then
53 install -d ${SRCDIR}/build-m32
54 cd ${SRCDIR}/build-m32
55 CPPFLAGS="-fexceptions" \
56 ABI=32 \
57 CC="gcc -m${ABI} -isystem /usr/include" \
58 CXX="g++ -m${ABI} -isystem /usr/include" \
59 LDFLAGS="-Wl,-rpath-link,/lib -m${ABI}" \
60 ../configure \
61 --build=${CHOST} \
62 --host=${CHOST} \
63 --prefix=/usr \
64 --mandir=/usr/share/man \
65 --infodir=/usr/share/info \
66 --libdir=/usr/lib \
67 --enable-mpbsd \
68 --enable-cxx \
69 || die
70 mmake || die
71 fi
72 }
73
74 src_install()
75 {
76 cd ${SRCDIR}/build
77 make DESTDIR=${BINDIR} install || die
78
79 # build 32bit libraries for multilib systems
80 if [[ ${ARCH} = x86_64 ]]
81 then
82 # move the 64bit header
83 mv ${BINDIR}/usr/include/gmp{,-64}.h || die
84
85 cd ${SRCDIR}/build-m32
86 make DESTDIR=${BINDIR} install || die
87
88 # move the 32bit header
89 mv ${BINDIR}/usr/include/gmp{,-32}.h || die
90
91 # create a wrapper header
92 cat > ${BINDIR}/usr/include/gmp.h << "EOF"
93 /* gmp.h - Stub Header */
94 #ifndef __STUB__GMP_H__
95 #define __STUB__GMP_H__
96
97 #if defined(__x86_64__) || \
98 defined(__sparc64__) || \
99 defined(__arch64__) || \
100 defined(__powerpc64__) || \
101 defined (__s390x__)
102 # include "gmp-64.h"
103 #else
104 # include "gmp-32.h"
105 #endif
106
107 #endif /* __STUB__GMP_H__ */
108 EOF
109 fi
110
111 cd ${SRCDIR}
112 minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die
113 }