1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 if [[ ${PV} == "9999" ]] ; then
9 ESVN_REPO_URI="https://svn.code.sf.net/p/sdcc/code/trunk/sdcc"
10 inherit subversion autotools
11 docs_compile() { return 0; }
13 SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
14 doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
15 KEYWORDS="~amd64 ~x86"
16 docs_compile() { return 1; }
19 DESCRIPTION="Small device C compiler (for various microprocessors)"
20 HOMEPAGE="http://sdcc.sourceforge.net/"
27 RDEPEND="sys-libs/ncurses
29 >=dev-embedded/gputils-0.13.7
30 boehm-gc? ( dev-libs/boehm-gc )
31 !dev-embedded/sdcc-svn"
33 if docs_compile ; then
36 >=app-office/lyx-1.3.4
44 # Fix conflicting variable names between Gentoo and sdcc
46 '(' -name 'Makefile*.in' -o -name configure ')' \
48 -e 's:\<(PORTDIR|ARCH)\>:SDCC\1:g' \
51 epatch "${FILESDIR}"/${P}-gcc44.patch
52 epatch "${FILESDIR}"/${P}-getline.patch
53 epatch "${FILESDIR}"/${P}-headers.patch
54 epatch "${FILESDIR}"/${P}-build.patch
56 # We'll install doc manually
57 sed -i -e '/SDCC_DOC/d' Makefile.in || die
58 sed -i -e 's/all install-doc/all/' as/Makefile.in || die
59 sed -i -e 's/ doc//' sim/ucsim/packages_in.mk || die
61 [[ ${PV} == "9999" ]] && eautoreconf
65 ac_cv_prog_STRIP=true \
67 $(use_enable boehm-gc libgc) \
68 $(docs_compile && use_enable doc || echo --disable-doc)
73 if docs_compile && use doc ; then
76 for d in cdbfileformat sdccman test_suite_spec ; do
77 lyx -e html ${d} || die
83 emake DESTDIR="${D}" install || die
84 dodoc doc/*.txt doc/*/*.txt
85 find "${D}" -name .deps -exec rm -rf {} +
88 docs_compile || cd "${WORKDIR}"/doc
92 # a bunch of archives (*.a) are built & installed by gputils
93 # for PIC processors, but they do not work with standard `ar`
94 # & `scanelf` utils and they're not for the host.
95 env RESTRICT="" prepstrip "${D%/}"/usr/bin