# $Id: Portfile,v 1.4 2005/07/27 01:42:02 gwright Exp $

PortSystem	1.0
name		gprolog
version		1.2.16
revision	4

categories	lang
maintainers	pmoura@mac.com
platforms	darwin
description	GNU Prolog compiler

long_description	\
		GNU Prolog is a free Prolog compiler with constraint	\
		solving over finite domains developed by Daniel Diaz.	\
		GNU Prolog accepts Prolog+constraint programs and	\
		produces native binaries (like gcc does from a C	\
		source). The obtained executable is then stand-alone.	\
		The size of this executable can be quite small since	\
		GNU Prolog can avoid linking the code of most unused	\
		built-in predicates. The performance of GNU Prolog is	\
		very encouraging (comparable to commercial systems).	\
		Beside native-code compilation, GNU Prolog offers a	\
		classical interactive interpreter (top-level) with a	\
		debugger.

homepage	http://gprolog.inria.fr/
master_sites	ftp://ftp.inria.fr/INRIA/Projects/contraintes/${name}/

checksums	md5 d7fe87106cd3e7e770375f04dd0d14c2

distname	${name}-${version}
worksrcdir 	${name}-${version}/src

platform darwin 8 {
		configure.env-append	CC=gcc-3.3
}

configure.args	--prefix=${destroot}/${prefix} \
		--with-install-dir=${destroot}/${prefix}/lib/${name}-${version} \
		--with-examples-dir=${destroot}/${prefix}/share/${name}-${version} \
		--with-doc-dir=${destroot}/${prefix}/share/${name}-${version} \
		--disable-regs	\
		--with-c-flags="-O1 -fomit-frame-pointer"

post-destroot	{ cd ${destroot}/${prefix}/bin

		  file delete fd2c
		  file delete gplc
		  file delete gprolog
		  file delete hexgplc
		  file delete ma2asm
		  file delete pl2wam
		  file delete wam2ma

		  system "ln -s ../lib/${name}-${version}/bin/fd2c fd2c"
		  system "ln -s ../lib/${name}-${version}/bin/gplc gplc"
		  system "ln -s ../lib/${name}-${version}/bin/gprolog gprolog"
		  system "ln -s ../lib/${name}-${version}/bin/hexgplc hexgplc"
		  system "ln -s ../lib/${name}-${version}/bin/ma2asm ma2asm"
		  system "ln -s ../lib/${name}-${version}/bin/pl2wam pl2wam"
		  system "ln -s ../lib/${name}-${version}/bin/wam2ma wam2ma"
		}

