summaryrefslogtreecommitdiff
path: root/community/llvm/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/llvm/PKGBUILD')
-rw-r--r--community/llvm/PKGBUILD86
1 files changed, 67 insertions, 19 deletions
diff --git a/community/llvm/PKGBUILD b/community/llvm/PKGBUILD
index 54bece439..99ea6e4a7 100644
--- a/community/llvm/PKGBUILD
+++ b/community/llvm/PKGBUILD
@@ -1,5 +1,6 @@
-# $Id: PKGBUILD 44403 2011-04-07 11:36:47Z foutrelis $
+# $Id: PKGBUILD 44752 2011-04-11 14:36:48Z foutrelis $
# Maintainer: Evangelos Foutras <foutrelis@gmail.com>
+# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Sebastian Nowicki <sebnow@gmail.com>
# Contributor: Devin Cofer <ranguvar{AT]archlinux[DOT}us>
# Contributor: Tobias Kieslich <tobias@justdreams.de>
@@ -10,20 +11,28 @@
pkgname=('llvm' 'llvm-ocaml' 'clang' 'clang-analyzer')
pkgver=2.9
-_gcc_ver=4.5.2
-pkgrel=1
+_gcc_ver=4.6.0
+pkgrel=4
arch=('i686' 'x86_64')
url="http://llvm.org/"
license=('custom:University of Illinois/NCSA Open Source License')
makedepends=('gcc-libs' 'libffi' 'python2' 'ocaml' "gcc=$_gcc_ver")
source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.tgz
http://llvm.org/releases/$pkgver/clang-$pkgver.tgz
+ ftp://ftp.archlinux.org/other/community/clang/gcc-headers-4.5.2.tar.xz
clang-plugin-loader-registry.patch
- cindexer-clang-path.patch)
+ cindexer-clang-path.patch
+ clang-toolchains-gcc-versions.patch
+ clang-pure64.patch
+ enable-lto.patch)
md5sums=('793138412d2af2c7c7f54615f8943771'
'634de18d04b7a4ded19ec4c17d23cfca'
+ '70e23a3dc2b38ecb2bb4d2c48f47295d'
'02c23b4aaca3445b8bf39fddb2f9906e'
- '87a7162dbe99e9ffce6c40bd09f5f4f0')
+ '87a7162dbe99e9ffce6c40bd09f5f4f0'
+ '8da236120a9a287a977b575b8b905c93'
+ '225ee6b531f8327f34f344a18cb4ec81'
+ '8f7582d7440e4a8342c3aea9ec714fb4')
build() {
cd "$srcdir/$pkgname-$pkgver"
@@ -52,21 +61,55 @@ build() {
# Fix clang path in CIndexer.cpp (https://bugs.archlinux.org/task/22799)
patch -d tools/clang -Np0 -i "$srcdir/cindexer-clang-path.patch"
+ # Add GCC 4.6.0 to GccVersions (FS#23631)
+ patch -d tools/clang -Np1 -i "$srcdir/clang-toolchains-gcc-versions.patch"
+
+ if [[ $CARCH == x86_64 ]]; then
+ # Adjust lib paths
+ patch -d tools/clang -Np0 -i "$srcdir/clang-pure64.patch"
+ fi
+
+ # Make -flto work
+ # Use gold instead of default linker, and always use the plugin
+ patch -d tools/clang -Np0 -i "$srcdir/enable-lto.patch"
+
# Apply strip option to configure
- _optimize_flag="--enable-optimize"
- [ "$(check_option strip)" = "n" ] && _optimize_flag="--disable-optimize"
+ _optimized_switch="enable"
+ [[ $(check_option strip) == n ]] && _optimized_switch="disable"
# Include location of libffi headers in CPPFLAGS
export CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libffi)"
- ./configure --prefix=/usr --libdir=/usr/lib/llvm --sysconfdir=/etc \
- --enable-shared --enable-libffi \
- --enable-bindings=ocaml --enable-targets=all \
- --disable-expensive-checks --disable-debug-runtime \
- --disable-assertions --with-binutils-include=/usr/include \
- $_optimize_flag \
- --with-cxx-include-root=/usr/include/c++/$_gcc_ver \
- --with-cxx-include-arch=$CHOST
+ # TODO: Uncomment when clang works with GCC 4.6+
+ #_cxx_headers="/usr/include/c++/$_gcc_ver"
+ #if [[ ! -d $_cxx_headers ]]; then
+ # error "Couldn't find the C++ headers, PKGBUILD needs fixing!"
+ # return 1
+ #fi
+ _cxx_headers="/usr/include/c++/clang-$pkgver"
+
+ _32bit_headers=""
+ if [[ $CARCH == x86_64 ]]; then
+ # Important for multilib
+ _32bit_headers="32"
+ fi
+
+ ./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib/llvm \
+ --sysconfdir=/etc \
+ --enable-shared \
+ --enable-libffi \
+ --enable-targets=all \
+ --disable-expensive-checks \
+ --disable-debug-runtime \
+ --disable-assertions \
+ --with-binutils-include=/usr/include \
+ --with-cxx-include-root=$_cxx_headers \
+ --with-cxx-include-arch=$CHOST \
+ --with-cxx-include-32bit-dir=$_32bit_headers \
+ --$_optimized_switch-optimized
+
make REQUIRES_RTTI=1
}
@@ -100,7 +143,7 @@ package_llvm() {
rm "$pkgdir"/usr/lib/llvm/*LLVMHello.*
# Symlink the gold plugin where clang expects it
- ln -s "llvm/libLLVMgold.so" "$pkgdir/usr/lib/LLVMgold.so"
+ ln -s llvm/LLVMgold.so "$pkgdir/usr/lib/LLVMgold.so"
# Add ld.so.conf.d entry
install -d "$pkgdir/etc/ld.so.conf.d"
@@ -146,6 +189,11 @@ package_clang() {
sed -i 's:$(PROJ_prefix)/share/doc/clang:$(PROJ_prefix)/share/doc/llvm:' \
"$srcdir/llvm-$pkgver/Makefile.config"
+ # Install old libstdc++ headers. Contains combined headers from
+ # gcc 4.5.2-6-i686 and gcc-multilib-4.5.2-6-x86_64
+ install -d "$pkgdir/usr/include/c++"
+ cp -rd "$srcdir/gcc-headers-4.5.2" "$pkgdir/usr/include/c++/clang-$pkgver"
+
install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/clang/LICENSE"
}
@@ -157,9 +205,9 @@ package_clang-analyzer() {
cd "$srcdir/llvm-$pkgver/tools/clang"
install -d "$pkgdir"/usr/{bin,lib/clang-analyzer}
- for tool in scan-{build,view}; do
- cp -r tools/$tool "$pkgdir/usr/lib/clang-analyzer"
- ln -s /usr/lib/clang-analyzer/$tool/$tool "$pkgdir/usr/bin"
+ for _tool in scan-{build,view}; do
+ cp -r tools/$_tool "$pkgdir/usr/lib/clang-analyzer/"
+ ln -s /usr/lib/clang-analyzer/$_tool/$_tool "$pkgdir/usr/bin/"
done
# Use Python 2