# $Id: Portfile 78655 2011-05-16 09:40:48Z ryandesign@macports.org $

PortSystem 1.0

name		pfe
version		0.33.71
categories	lang
maintainers	nomaintainer
platforms	darwin
description	Implementation of ANSI Forth
long_description	The Forth-system is closely modeled along the new American National Standard for the programming language Forth. Every word of every word set mentioned in the dpANS-6 document of June 1993 has been implemented.  Additionally it is compatible to Forth-83.

homepage	http://pfe.sourceforge.net/
master_sites	sourceforge
use_bzip2	yes

checksums	sha1    2e61bbf550767793b20bffc544b625fc4e889f44 \
		rmd160  5bfdc5561c281f5d506151ec17552b03e6a411ab

configure.args	--with-sbr-static --without-testmodule

depends_lib	port:ncurses

# configure: error: cannot determine a size for long
universal_variant       no

post-configure {
	global reldir
	set reldir [string map {" " "_" "/" "_"} [exec uname -srm].d]
	xinstall -m 755 /usr/bin/glibtool ${worksrcpath}/${reldir}/pfe/libtool
}

destroot {
	global reldir
	xinstall -m 755 ${worksrcpath}/${reldir}/pfe/.libs/pfe ${destroot}${prefix}/bin
	eval xinstall -m 644 [glob ${worksrcpath}/${reldir}/pfe/.libs/*.dylib] ${destroot}${prefix}/lib
	xinstall -m 755 -d ${destroot}${prefix}/lib/pfe-fastest
	eval xinstall -m 644 [glob ${worksrcpath}/${reldir}/pfe/.libs/*.so] ${destroot}${prefix}/lib/pfe-fastest
	xinstall -m 644 ${worksrcpath}/doc/pfe.1 ${destroot}${prefix}/share/man/man1
	xinstall -m 755 -d ${destroot}${prefix}/share/pfe
	eval xinstall -m 644 [glob ${worksrcpath}/lib/*.4th] ${destroot}${prefix}/share/pfe
	xinstall -m 644 ${worksrcpath}/lib/easy4th.f ${destroot}${prefix}/share/pfe
}

# Fix gcc Intel bug, apparently. See:
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11001
# And:
# http://factor-language.blogspot.com/2007/08/gcc-is-open-sores-software.html
# The problem is only with -O1, which is pfe's built-in default.
configure.optflags      -O2
configure.args-append   --with-opt=[string map {"-O" ""} ${configure.optflags}]
