updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / lll-git / PKGBUILD
blob8ae46822b742fb4796746c9806840a5d7e1e8740
1 # Maintainer: Jens Staal <staal1978@gmail.com>
2 # Adopted from: https://aur.archlinux.org/packages.php?ID=12295
3 # Also check: https://github.com/lll-project/clang/wiki/toolchain_build_instructions
5 pkgname=lll-git
6 pkgver=2011.04.30
7 pkgrel=2
8 pkgdesc='LLVM/Clang compiler infrastructure, patched for linux compilation, selfhosting.'
9 arch=('i686' 'x86_64')
10 url='http://llvm.org/bugs/show_bug.cgi?id=4068'
11 license=('custom:University of Illinois/NCSA Open Source License')
12 depends=('libffi' 'clang') #'python' 'ocaml' really needed?
13 # Future plans: Add 'llvm-compiler-rt-svn' 'libdispatch-blocks-svn' 'libkqueue' for Grand Central Dispatch support
14 makedepends=('git')
15 provides=('llvm' 'clang')
16 conflicts=('llvm' 'llvm-svn' 'clang')
18 # this is always the latest svn so debug info can be useful
19 # options=('!strip')
21 _gitroot='git://github.com/lll-project'
23 build() {
24 msg "setting build environment"
25 cd $srcdir
26 export CC=clang
27 export CXX=clang++
28 export CFLAGS="-O2 -march=native -mtune=native"
29 export CXXFLAGS="$CFLAGS"
30 # export LIBS="-lBlocksRuntime -ldispatch"
32 msg "getting llvm"
33   if [ -d llvm ]; then
34     cd llvm
35     git pull origin
36     msg "The local files are updated."
37   else
38     git clone $_gitroot/llvm.git
39   fi
41 msg "getting clang"
42 cd $srcdir/llvm/tools
43   if [ -d clang ]; then
44     cd clang
45     git pull origin
46     msg "The local files are updated."
47   else
48     git clone $_gitroot/clang.git
49   fi
51 # Experimental. Comment this section out if broken
52 msg "getting LLVM stdlibc++"
53 cd $srcdir/llvm/tools/clang/runtime
54    if [ -d libcxx ]; then
55       cd libcxx
56       git pull origin
57       msg "The local files are updated"
58   else
59       git clone $_gitroot/libcxx.git
60   fi
61 # ...to here...
63   msg 'GIT checkout done or server timeout'
65   msg 'Start building LLVM and Clang with Linux compilation patches'
67   cd $srcdir
69   rm -rf build # start fresh
70   mkdir build
71   cd build
73   ../llvm/configure \
74     --prefix=/usr \
75     --sysconfdir=/etc \
76     --enable-optimized \
77     --enable-assertions \
78     --enable-targets=host-only \
79     --enable-libffi
82   make
84   make DESTDIR=${pkgdir} install
86   # no docs please
87 #  rm -rf ${pkgdir}/usr/docs
89   install -D -m644 $srcdir/llvm/LICENSE.TXT ${pkgdir}/usr/share/licenses/llvm/LICENSE.TXT