Magellan Linux

Contents of /smage/trunk/core/gmp/gmp-5.0.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1727 - (show annotations) (download)
Thu Sep 15 23:07:26 2011 UTC (12 years, 7 months ago) by niro
File size: 2412 byte(s)
auto added: ver bump to 5.0.2-r1
1 # $Id$
2
3 PNAME="gmp"
4 PVER="5.0.2"
5 PBUILD="r1"
6
7 PCATEGORIE="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 # do not depend on glibc, as it depends ob libstdc++ and this wants gmp
13 # as SRCDEPEND -> this may generate loops
14 DEPEND=""
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_install()
74 {
75 cd ${SRCDIR}/build
76 make DESTDIR=${BINDIR} install || die
77
78 # build 32bit libraries for multilib systems
79 if [[ ${ARCH} = x86_64 ]]
80 then
81 # move the 64bit header
82 mv ${BINDIR}/usr/include/gmp{,-64}.h || die
83
84 cd ${SRCDIR}/build-m32
85 make DESTDIR=${BINDIR} install || die
86
87 # move the 32bit header
88 mv ${BINDIR}/usr/include/gmp{,-32}.h || die
89
90 # create a wrapper header
91 cat > ${BINDIR}/usr/include/gmp.h << "EOF"
92 /* gmp.h - Stub Header */
93 #ifndef __STUB__GMP_H__
94 #define __STUB__GMP_H__
95
96 #if defined(__x86_64__) || \
97 defined(__sparc64__) || \
98 defined(__arch64__) || \
99 defined(__powerpc64__) || \
100 defined (__s390x__)
101 # include "gmp-64.h"
102 #else
103 # include "gmp-32.h"
104 #endif
105
106 #endif /* __STUB__GMP_H__ */
107 EOF
108 fi
109
110 cd ${SRCDIR}
111 minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die
112 }