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
8 pkgdesc='LLVM/Clang compiler infrastructure, patched for linux compilation, selfhosting.'
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
15 provides=('llvm' 'clang')
16 conflicts=('llvm' 'llvm-svn' 'clang')
18 # this is always the latest svn so debug info can be useful
21 _gitroot='git://github.com/lll-project'
24 msg "setting build environment"
28 export CFLAGS="-O2 -march=native -mtune=native"
29 export CXXFLAGS="$CFLAGS"
30 # export LIBS="-lBlocksRuntime -ldispatch"
36 msg "The local files are updated."
38 git clone $_gitroot/llvm.git
46 msg "The local files are updated."
48 git clone $_gitroot/clang.git
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
57 msg "The local files are updated"
59 git clone $_gitroot/libcxx.git
63 msg 'GIT checkout done or server timeout'
65 msg 'Start building LLVM and Clang with Linux compilation patches'
69 rm -rf build # start fresh
78 --enable-targets=host-only \
84 make DESTDIR=${pkgdir} install
87 # rm -rf ${pkgdir}/usr/docs
89 install -D -m644 $srcdir/llvm/LICENSE.TXT ${pkgdir}/usr/share/licenses/llvm/LICENSE.TXT