# $Id: Portfile 50980 2009-05-14 19:41:55Z and.damore@macports.org $

PortSystem 1.0
name		gcl
version		2.6.7
revision	1
categories	lang
maintainers	waqar
description	GNU Common Lisp
long_description	\
	GCL is the official Common Lisp for the GNU project. Its design \
	makes use of the system's C compiler to compile to native 	\
	object code, providing for both good performance and facile 	\
	portability. On most platforms, GCL can load native object code \
	modules directly into its lisp core, where they are preserved 	\
	in any custom lisp images produced via the save-system call.
platforms	darwin
homepage       	http://www.gnu.org/software/gcl
master_sites	gnu
checksums	md5 c0f42e1f391162e5ac90912a70e8ecc3			\
		sha1 d54f7db5dbd9f49953f80259a5eb44ade65027b5

depends_lib	port:gettext port:readline port:gmp

patch 		{
	reinplace "s|/sw|${prefix}|g" 			\
			${worksrcpath}/h/powerpc-macosx.defs
	reinplace "s|/usr/local/lib|${prefix}/share|g"	\
			${worksrcpath}/info/makefile
	reinplace "s|/usr/share|${prefix}/share|g" 	\
			${worksrcpath}/configure
}

configure.cflags-append	"-no-cpp-precomp"

configure.args  --enable-machine=powerpc-macosx	\
		--prefix=${prefix}		\
		--enable-ansi			\
		--disable-statsysbfd 		\
		--disable-locbfd 		\
		--enable-custreloc 		\
		--enable-notify=no		\
		--mandir=${prefix}/share/man 	\
		--infodir=${prefix}/share/info	\
		--enable-infodir=${prefix}/share/info \
		--enable-emacsdir=${prefix}/share/emacs/site-lisp/gcl \
		--enable-readline 		\
		--without-x

post-configure	{
	reinplace "s|./default.el|${prefix}/etc/default.el|g" \
		${worksrcpath}/makedefs \
		${worksrcpath}/makedefc
	reinplace "s|/usr/share|${prefix}/share|g" \
		${worksrcpath}/makedefs \
		${worksrcpath}/makedefc
}

destroot.destdir       DESTDIR=${destroot}

variant x11	{
	configure.args-delete --without-x
	configure.args-append --with-x
}
