# $Id$ PNAME="gmp" PVER="4.3.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 mutilib.sminc compat, don't use it! sminclude mbuild alx SRC_URI=( gnu://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2DATE="updatecmd_gnu ${PNAME}" src_compile() { install -d ${SRCDIR}/build cd ${SRCDIR}/build ../configure \ --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libdir=/usr/$(mlibdir) \ --enable-mpbsd \ || die mmake || die # build 32bit libraries for multilib systems if [[ ${ARCH} = x86_64 ]] then install -d ${SRCDIR}/build-m32 cd ${SRCDIR}/build-m32 ABI=32 CC="gcc -m32" \ ../configure \ --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libdir=/usr/lib \ --enable-mpbsd \ || 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 }