1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools toolchain-funcs
7 if [[ ${PV} == "9999" ]] ; then
8 ESVN_REPO_URI="https://svn.code.sf.net/p/sdcc/code/trunk/sdcc"
12 mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
13 doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )
18 DESCRIPTION="Small device C compiler (for various microprocessors)"
19 HOMEPAGE="http://sdcc.sourceforge.net/"
23 non-free? ( MicroChip-SDCC )
24 packihx? ( public-domain )
28 avr ds390 ds400 gbz80 hc08 mcs51 pic14 pic16 r2k r3ka s08 stm8 tlcs90 z180
33 +boehm-gc device-lib doc non-free packihx +sdbinutils sdcdb +sdcpp ucsim
36 for port in ${SDCC_PORTS}; do
37 REQUIRED_USE="${REQUIRED_USE}
38 ${port}? ( sdbinutils )
41 REQUIRED_USE="${REQUIRED_USE}
51 >=dev-embedded/gputils-0.13.7
52 boehm-gc? ( dev-libs/boehm-gc:= )
53 !dev-embedded/sdcc-svn
60 "${FILESDIR}"/${PN}-3.8.0-override-override.patch
64 # Fix conflicting variable names between Gentoo and sdcc
66 '(' -name 'Makefile*.in' -o -name 'configure' ')' \
68 -e 's:\<(PORTDIR|ARCH)\>:SDCC\1:g' \
71 # Make sure timestamps don't get messed up.
72 [[ ${PV} == "9999" ]] && find "${S}" -type f -exec touch -r . {} +
77 # Avoid 'bfd.info' rebuild with 'makeinfo': bug #705424
78 # Build dependencies are: eautoreconf->Makefile.in->bfdver.texi->bfd.info
79 touch support/sdbinutils/bfd/doc/bfdver.texi || die
80 touch support/sdbinutils/bfd/doc/bfd.info || die
84 # sdbinutils subdir doesn't pass down --docdir properly, so need to
85 # expand $(datarootdir) ourselves.
87 ac_cv_prog_AR="$(tc-getAR)" \
88 ac_cv_prog_AS="$(tc-getAS)" \
89 ac_cv_prog_STRIP=true \
90 $(use_enable avr avr-port) \
91 $(use_enable boehm-gc libgc) \
92 $(use_enable device-lib) \
93 $(use_enable ds390 ds390-port) \
94 $(use_enable ds400 ds400-port) \
95 $(use_enable gbz80 gbz80-port) \
96 $(use_enable hc08 hc08-port) \
97 $(use_enable mcs51 mcs51-port) \
98 $(use_enable non-free) \
99 $(use_enable packihx) \
100 $(use_enable pic14 pic14-port) \
101 $(use_enable pic16 pic16-port) \
102 $(use_enable r2k r2k-port) \
103 $(use_enable r3ka r3ka-port) \
104 $(use_enable s08 s08-port) \
105 $(use_enable sdbinutils) \
106 $(use_enable sdcdb) \
107 $(use_enable sdcpp) \
108 $(use_enable stm8 stm8-port) \
109 $(use_enable tlcs90 tlcs90-port) \
110 $(use_enable ucsim) \
111 $(use_enable z180 z180-port) \
112 $(use_enable z80 z80-port) \
114 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
121 find "${D}" -name .deps -exec rm -rf {} + || die
123 if use doc && [[ ${PV} != "9999" ]]; then
128 # a bunch of archives (*.a) are built & installed by gputils
129 # for PIC processors, but they do not work with standard `ar`
130 # & `scanelf` utils and they're not for the host.