# -*- 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

PortSystem          1.0
PortGroup           boost 1.0

# https://sourceforge.net/p/sdcc/bugs/3772
boost.version       1.81

name                sdcc
version             4.5.0
revision            0
categories          lang
license             GPL-3
maintainers         {snc @nerdling} openmaintainer
description         ANSI C compiler targeting Intel 8051, Maxim 80DS390, Zilog Z80
long_description    SDCC is a retargettable, optimizing ANSI - C \
                    compiler suite that targets the Intel MCS51 based \
                    microprocessors (8031, 8032, 8051, 8052, etc.), Maxim \
                    (formerly Dallas) DS80C390 variants, Freescale (formerly \
                    Motorola) HC08 based (hc08, s08) and Zilog Z80 based MCUs \
                    (z80, z180, gbz80, Rabbit 2000/3000, Rabbit 3000A). Work is \
                    in progress on supporting the Microchip PIC16 and PIC18 \
                    targets. It can be retargeted for other microprocessors.

homepage            http://sdcc.sourceforge.net/
master_sites        sourceforge:project/sdcc/sdcc/${version}

checksums           rmd160  cc5251cd6e576d16c2d833f8aa9c2239a32cbd0b \
                    sha256  d5030437fb436bb1d93a8dbdbfb46baaa60613318f4fb3f5871d72815d1eed80 \
                    size    20298103

compiler.cxx_standard  2011

depends_build \
    port:autoconf \
    port:automake \
    port:gputils \
    bin:makeinfo:texinfo

depends_lib \
    port:readline \
    port:zlib

depends_run \
    port:gputils

use_bzip2           yes
distfiles           ${name}-src-${version}${extract.suffix}

configure.args      --without-ccache

if {${configure.cxx_stdlib} ne ""} {
    if {[string match *clang* ${configure.compiler}]} {
        configure.ldflags-append \
                    -stdlib=${configure.cxx_stdlib}
    }
}

build.type          gnu

destroot.destdir    prefix=${destroot}${prefix} \
                    docdir=${destroot}${prefix}/share/doc/${name}

use_parallel_build  no

platform darwin 8 {
    depends_build-append    port:gmake
    build.cmd               ${prefix}/bin/gmake
}

livecheck.url       http://sourceforge.net/api/file/index/project-name/${name}/rss?path=/${name}
