1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
8 DESCRIPTION="A very small C compiler for ix86/amd64"
9 HOMEPAGE="https://bellard.org/tcc/"
10 SRC_URI="https://download.savannah.gnu.org/releases/tinycc/${P}.tar.bz2"
14 KEYWORDS="~amd64 ~x86 ~amd64-linux"
16 DEPEND="dev-lang/perl" # doc generation
19 RESTRICT="!test? ( test )"
23 sed -i -e 's|$(INSTALL) -s|$(INSTALL)|' Makefile || die
29 }' examples/ex*.c || die
30 sed -i -e '1s/$/ -lX11/' examples/ex4.c || die
32 # Fix texi2html invocation
33 sed -i -e 's/-number//' Makefile || die
34 sed -i -e 's/--sections//' Makefile || die
40 use test && unset CFLAGS LDFLAGS # Tests run with CC=tcc etc, they will fail hard otherwise
41 # better fixes welcome, it feels wrong to hack the env like this
42 # not autotools, so call configure directly
43 ./configure --cc="$(tc-getCC)" \
44 --prefix="${EPREFIX}/usr" \
45 --libdir="${EPREFIX}/usr/$(get_libdir)" \
46 --docdir="${EPREFIX}/usr/share/doc/${PF}"
50 emake AR="$(tc-getAR)"
54 emake DESTDIR="${D}" install
56 dodoc Changelog README TODO VERSION
58 exeinto /usr/share/doc/${PF}/examples
63 # this is using tcc bits that don't know as-needed etc.
64 TCCFLAGS="" emake test