# $Id: Portfile 30224 2007-10-22 22:49:14Z jmpp@macports.org $

PortSystem 1.0
name		gmp-cxx-wrappers
version		4.2.1
revision	2
categories	devel math
maintainers	nomaintainer
platforms	darwin freebsd
description	C++ wrappers for the GNU multiple precision arithmetic library
long_description	\
		The C++ wrappers for gmp.  To build them requires that	\
		gmp be installed, hence this portfile, which rebuilds	\
		gmp, but only installs the C++ wrappers.

homepage	http://www.swox.com/gmp/

master_sites	gnu:gmp

use_bzip2	yes
distfiles	gmp-${version}${extract.suffix}
checksums	gmp-${version}${extract.suffix} md5 091c56e0e1cca6b09b17b69d47ef18e3

depends_run	port:gmp

worksrcdir	gmp-${version}

configure.env	ABI=32
configure.cflags-append -force_cpusubtype_ALL
configure.args \
	--infodir=\\\${prefix}/share/info \
	--enable-shared \
	--enable-cxx

test.run                yes
test.target             check

post-destroot {
	ui_msg "$UI_PREFIX Running ranlib on static libraries"
	system "ranlib ${destroot}${prefix}/lib/libgmpxx.a"
	
	delete ${destroot}${prefix}/include/gmp.h
	
	delete ${destroot}${prefix}/lib/libgmp.a
	delete ${destroot}${prefix}/lib/libgmp.la
	delete ${destroot}${prefix}/lib/libgmp.dylib
	delete ${destroot}${prefix}/lib/libgmp.3.dylib
	delete ${destroot}${prefix}/lib/libgmp.3.4.1.dylib
	
	delete ${destroot}${prefix}/share
}

platform darwin i386 {
	configure.env-delete    ABI=32
	configure.args-append   --host=none-apple-darwin
	configure.cflags-delete -force_cpusubtype_ALL
}
