# $Id: Portfile,v 1.11 2006/02/14 07:44:31 mww Exp $

PortSystem 1.0

name		mpfr
version		2.2.0
revision	3
categories	devel math
platforms	darwin 
maintainers	leimy@opendarwin.org

description	The MPFR library is a C library for multiple-precision floating-point computations 
long_description	 The MPFR library is a C library for multiple-precision \
			 floating-point computations with exact rounding (also called \
			 correct rounding). It is based on the GMP multiple-precision \
			 library and should replace the MPF class in further releases \
			 of GMP.

homepage	http://www.mpfr.org/
master_sites	http://www.mpfr.org/mpfr-${version}/
checksums	md5 1a81f721ee78cb027f6c41a243d3a33d
patchfiles	patches
use_bzip2	yes
extract.only	${name}-${version}.tar.bz2

depends_lib	port:gmp

configure.args	--enable-shared --infodir=\\\${prefix}/share/info --with-gmp=${prefix}
configure.env	CFLAGS="-fno-common" LDFLAGS="-L${prefix}/lib"

test.run	yes
test.target	check

post-destroot	{
		xinstall -d -m 755 ${destroot}${prefix}/share/${name}
		xinstall -m 644 -v -W ${worksrcpath} mpfr.texi texinfo.tex \
		${destroot}${prefix}/share/${name}
		system "ranlib ${destroot}${prefix}/lib/libmpfr.a" 
}

platform darwin x86	{
	configure.args-append	--host=none-apple-darwin
}
platform darwin i386	{
	configure.args-append	--host=none-apple-darwin
}

platform darwin 8 {
	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}
