1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils toolchain-funcs
9 if [[ ${PV} == "9999" ]] ; then
10 ESVN_REPO_URI="https://svn.code.sourceforge.net/p/sdcc/code/trunk/sdcc"
12 docs_compile() { return 0; }
14 SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
15 doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
16 KEYWORDS="~amd64 ~ppc ~x86"
17 docs_compile() { return 1; }
20 DESCRIPTION="Small device C compiler (for various microprocessors)"
21 HOMEPAGE="http://sdcc.sourceforge.net/"
24 non-free? ( MicroChip-SDCC )
25 packihx? ( public-domain )"
27 IUSE="mcs51 z80 z180 r2k r3ka gbz80 tlcs90 ds390 ds400 pic14 pic16 hc08 s08 stm8
28 ucsim device-lib packihx +sdcpp sdcdb sdbinutils non-free +boehm-gc doc"
39 RDEPEND="dev-libs/boost:=
42 >=dev-embedded/gputils-0.13.7
43 boehm-gc? ( dev-libs/boehm-gc:= )
44 !dev-embedded/sdcc-svn"
47 if docs_compile ; then
50 >=app-office/lyx-1.3.4
56 # Fix conflicting variable names between Gentoo and sdcc
58 '(' -name 'Makefile*.in' -o -name 'configure' ')' \
60 -e 's:\<(PORTDIR|ARCH)\>:SDCC\1:g' \
63 # https://sourceforge.net/p/sdcc/bugs/2398/
64 sed -i '1iAR = @AR@' Makefile.common.in || die
66 -e "/^AR =/s:=.*:=$(tc-getAR):" \
67 support/cpp/Makefile.in || die
69 # Make sure timestamps don't get messed up.
70 [[ ${PV} == "9999" ]] && find "${S}" -type f -exec touch -r . {} +
74 # sdbinutils subdir doesn't pass down --docdir properly, so need to
75 # expand $(datarootdir) ourselves.
77 ac_cv_prog_STRIP=true \
78 ac_cv_prog_AS="$(tc-getAS)" \
79 ac_cv_prog_AR="$(tc-getAR)" \
80 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
82 $(use_enable mcs51 mcs51-port) \
83 $(use_enable z80 z80-port) \
84 $(use_enable z180 z180-port) \
85 $(use_enable r2k r2k-port) \
86 $(use_enable r3ka r3ka-port) \
87 $(use_enable gbz80 gbz80-port) \
88 $(use_enable tlcs90 tlcs90-port) \
89 $(use_enable ds390 ds390-port) \
90 $(use_enable ds400 ds400-port) \
91 $(use_enable pic14 pic14-port) \
92 $(use_enable pic16 pic16-port) \
93 $(use_enable hc08 hc08-port) \
94 $(use_enable s08 s08-port) \
95 $(use_enable stm8 stm8-port) \
96 $(use_enable ucsim ucsim) \
97 $(use_enable device-lib device-lib) \
98 $(use_enable packihx packihx) \
99 $(use_enable sdcpp sdcpp) \
100 $(use_enable sdcdb sdcdb) \
101 $(use_enable sdbinutils sdbinutils) \
102 $(use_enable non-free non-free) \
103 $(use_enable boehm-gc libgc) \
104 $(docs_compile && use_enable doc || echo --disable-doc)
110 find "${D}" -name .deps -exec rm -rf {} + || die
113 docs_compile || cd "${WORKDIR}"/doc
117 # a bunch of archives (*.a) are built & installed by gputils
118 # for PIC processors, but they do not work with standard `ar`
119 # & `scanelf` utils and they're not for the host.
120 env RESTRICT="" prepstrip "${D%/}"/usr/bin