1 # Contributor : Jens Staal <staal1978@gmail.com>
2 # Package copied from: https://aur.archlinux.org/packages.php?ID=16492
3 pkgname=tcc-static-musl
6 pkgdesc="Tiny C Compiler statically compiled against the musl libc"
8 url="http://bellard.org/tcc/"
10 source=(http://download.savannah.nongnu.org/releases/tinycc/tcc-${pkgver}.tar.bz2)
12 depends=('musl') #musl-git is also good
13 #optdepends=('tcc') # self-hosting compilation
15 md5sums=('991c2a1986cce15f03ca6ddc86ea5f43')
18 rm -rf $srcdir/build # start fresh
19 cp -ar ${srcdir}/tcc-${pkgver} $srcdir/build
22 #sed fixes from Gentoo ebuild, cheers!
24 sed -i -e 's|$(INSTALL) -s|$(INSTALL)|' Makefile
31 sed -i -e '1s/$/ -lX11/' examples/ex4.c
33 msg "Setting up compilation environment"
35 # if [ -d /usr/lib/tcc ]; then
36 # msg "great! you already got TCC, let's set that as compiler"
37 # export CC=tcc #I need to investigate the gcc-musl
40 # msg "poor you, no TCC? do not despair you will soon have it :)"
41 # msg "make sure that you got some other compiler installed"
46 export CFLAGS="-Os -static"
47 ./configure --prefix=/usr
53 make tccdir=${pkgdir}/usr/lib/tcc libdir=${pkgdir}/usr/lib \
54 mandir=${pkgdir}/usr/share/man bindir=${pkgdir}/usr/bin \
55 includedir=${pkgdir}/usr/include \
56 docdir=${pkgdir}/usr/share/doc/tcc \
60 make CFLAGS="-fPIC" libtcc.o || return 1
61 ld -shared -soname libtcc.so -o libtcc.so libtcc.o || return 1
62 mkdir -p ${pkgdir}/usr/lib/
63 install -m755 libtcc.so "${pkgdir}/usr/lib/libtcc.so"