# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem          1.0

name                gcl
version             2.6.12
categories          lang
license             GPL-2+
platforms           darwin
maintainers         nomaintainer

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.
homepage            http://www.gnu.org/software/gcl

depends_lib         port:gettext \
                    port:gmp \
                    port:readline

master_sites        gnu
checksums           rmd160  51414c7d3da76220246807985763656b6a2ef4d9 \
                    sha256  8eb8491bccafc49683599e92a30ba36db0825dd4bb138a104cb662b9b0d090e8
worksrcdir          ${name}

# Don't compile with -Wno-unused-but-set-variable.
patchfiles          configure.patch

# Use the right compiler.
patchfiles-append   h-386-macosx.defs.patch

configure.cflags-append -std=gnu89
configure.args      --disable-notify \
                    --disable-statsysbfd \
                    --enable-ansi \
                    --enable-custreloc \
                    --enable-emacsdir=${prefix}/share/emacs/site-lisp/gcl \
                    --enable-infodir=${prefix}/share/info \
                    --enable-readline \
                    --without-x \
                    --disable-xgcl

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

use_parallel_build no

variant x11 {
    depends_lib-append  port:xorg-libX11
    configure.args-delete --without-x --disable-xgcl
    configure.args-append --with-x --enable-xgcl \
                          --x-includes=${prefix}/include \
                          --x-libraries=${prefix}/lib
}