# -*- 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
description ANSI C compiler targeting Intel 8051, Maxim 80DS390, Zilog Z80
long_description SDCC is a freeware, retargettable, optimizing ANSI C \
compiler that targets the Intel 8051, Maxim 80DS390, and \
Zilog Z80 based MCUs. Work is in progress on supporting \
Motorola 68HC08 as well as Microchip PIC16 and PIC18 series.
homepage http://sdcc.sourceforge.net/
checksums md5 a6151ed328fd3bc48305ffbc628dc122 \
sha1 03308a233a67e7fdce3f7e4972acb8731ae42666 \
rmd160 38f23365b676132651f0322779bff498eb7e2b8d
depends_build port:gputils
depends_lib port:readline
distfiles sdcc-src-${version}${extract.suffix}
# requires "sizeof (long)" to be the a single value, so no universal;
# universal isn't really required anyway.
# Setting CPP explicitly is bad, because 'cpp' and
# 'gcc -E' are not the same.
# make sure to not use any already installed headers and libraries;
# these are set in CPATH and LIBRARY_PATH anyway.
configure.args-append --prefix=${prefix}/libexec/${name}
configure.ldflags-delete "-L${prefix}/lib"
configure.cppflags-delete "-I${prefix}/include"
depends_build-append port:gmake
build.cmd ${prefix}/bin/gmake
# 10.7 provides 'getline()' already, but it is not
# interchangeable with that provided by SDCC. change SDCC's
# internal to "sdcc_getline", but not the #includes
reinplace "/getline/s@getline @sdcc_getline @g" \
${worksrcpath}/as/link/getline.h \
${worksrcpath}/as/link/getline.c \