# $Id: gmp-4.3.1-r2.smage2 3003 2009-10-05 19:14:19Z niro $ PNAME="gmp" PVER="5.0.1" PBUILD="r2" PCATEGORIE="dev-libs" STATE="unstable" DESCRIPTION="GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers." HOMEPAGE="http://www.swox.com/gmp/" # do not depend on glibc, as it depends ob libstdc++ and this wants gmp # as SRCDEPEND -> this may generate loops DEPEND="" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # not multilib.sminc compat, don't use it! sminclude mbuild mcore SRC_URI=( gnu://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2DATE="updatecmd_gnu ${PNAME}" src_compile() { install -d ${SRCDIR}/build cd ${SRCDIR}/build CPPFLAGS="-fexceptions" \ CC="gcc -isystem /usr/include" \ CXX="g++ -isystem /usr/include" \ LDFLAGS="-Wl,-rpath-link,/$(mlibdir)" \ ../configure \ --build=${CHOST} \ --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libdir=/usr/$(mlibdir) \ --enable-mpbsd \ --enable-cxx \ || die mmake || die # build 32bit libraries for multilib systems if [[ ${ARCH} = x86_64 ]] then install -d ${SRCDIR}/build-m32 cd ${SRCDIR}/build-m32 CPPFLAGS="-fexceptions" \ ABI=32 \ CC="gcc -m${ABI} -isystem /usr/include" \ CXX="g++ -m${ABI} -isystem /usr/include" \ LDFLAGS="-Wl,-rpath-link,/lib -m${ABI}" \ ../configure \ --build=${CHOST} \ --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libdir=/usr/lib \ --enable-mpbsd \ --enable-cxx \ || die mmake || die fi } src_install() { cd ${SRCDIR}/build make DESTDIR=${BINDIR} install || die # build 32bit libraries for multilib systems if [[ ${ARCH} = x86_64 ]] then # move the 64bit header mv ${BINDIR}/usr/include/gmp{,-64}.h || die cd ${SRCDIR}/build-m32 make DESTDIR=${BINDIR} install || die # move the 32bit header mv ${BINDIR}/usr/include/gmp{,-32}.h || die # create a wrapper header cat > ${BINDIR}/usr/include/gmp.h << "EOF" /* gmp.h - Stub Header */ #ifndef __STUB__GMP_H__ #define __STUB__GMP_H__ #if defined(__x86_64__) || \ defined(__sparc64__) || \ defined(__arch64__) || \ defined(__powerpc64__) || \ defined (__s390x__) # include "gmp-64.h" #else # include "gmp-32.h" #endif #endif /* __STUB__GMP_H__ */ EOF fi cd ${SRCDIR} minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die }