summaryrefslogtreecommitdiff
path: root/community/tcc/PKGBUILD
blob: c5cc9d845837f5e70605c9a3e23fd48fd5e1bfc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# $Id: PKGBUILD 59917 2002-02-02 03:01:25Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer : Gergely Imreh <imrehgATgmailDOTcom>
# Contributor : dschauer <dschauerATgmailDOTcom>
# Contributor : Stefan Husmann <stefan-husmann@t-online.de>
# Contributor : Jeremy Cowgar <jeremy@cowgar.com>

pkgname=tcc
pkgver=0.9.25
pkgrel=2
pkgdesc="Tiny C Compiler"
arch=('i686' 'x86_64')
url="http://bellard.org/tcc/"
license=('LGPL')
makedepends=('gcc')
options=('docs')
source=(http://download.savannah.nongnu.org/releases/tinycc/${pkgname}-${pkgver}.tar.bz2)
md5sums=('991c2a1986cce15f03ca6ddc86ea5f43')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # sed fixes from Gentoo ebuild, cheers!
  # Don't strip
  sed -i -e 's|$(INSTALL) -s|$(INSTALL)|' Makefile

  # Fix examples
  sed -i -e '1{
    i#! /usr/bin/tcc -run
    /^#!/d
  }' examples/ex*.c
  sed -i -e '1s/$/ -lX11/' examples/ex4.c

  ./configure --prefix=/usr
  make
  make tccdir=${pkgdir}/usr/lib/tcc libdir=${pkgdir}/usr/lib \
    mandir=${pkgdir}/usr/share/man bindir=${pkgdir}/usr/bin \
    includedir=${pkgdir}/usr/include \
    docdir=${pkgdir}/usr/share/doc/tcc \
    install

  make clean
  make CFLAGS="-fPIC" libtcc.o
  ld -shared -soname libtcc.so -o libtcc.so libtcc.o
  install -D -m 755 libtcc.so "${pkgdir}/usr/lib/libtcc.so"
}