Permalink
Browse files

clang-svn: fixed GCC headers, modifications for easier rebuilding.

  • Loading branch information...
1 parent aba058a commit 76d6c4b99a2e22889c016c026a3c807f2c21a958 @mosra committed Apr 27, 2012
Showing with 37 additions and 40 deletions.
  1. +37 −40 clang-svn/PKGBUILD
View
@@ -8,25 +8,19 @@
# Contributor: Tomas Lindquist Olsen <tomas@famolsen.dk>
# Contributor: Roberto Alsina <ralsina@kde.org>
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
+# Contributor: mosra <mosra@centrum.cz>
pkgname=clang-svn
-pkgver=150295
-_gcc_ver=4.6.2
+pkgver=153817
pkgrel=1
pkgdesc="Low Level Virtual Machine with Clang from SVN"
arch=('i686' 'x86_64')
url="http://llvm.org/"
license=('custom:University of Illinois/NCSA Open Source License')
-depends=('gcc-libs' 'libffi' 'python2' "gcc=$_gcc_ver")
+depends=('gcc-libs' 'libffi' 'python2' "gcc")
makedepends=('svn' 'cmake')
provides=('clang' 'llvm')
conflicts=(llvm llvm-svn llvm-ocaml clang clang-analyzer)
-source=()
-md5sums=('02c23b4aaca3445b8bf39fddb2f9906e'
- '87a7162dbe99e9ffce6c40bd09f5f4f0'
- '225ee6b531f8327f34f344a18cb4ec81'
- '8f7582d7440e4a8342c3aea9ec714fb4'
- '9d153103dda0c088562f1feb1129b67e')
_svntrunk="http://llvm.org/svn/llvm-project"
_svnmod="llvm"
@@ -35,68 +29,71 @@ _crtmod="compiler-rt"
#_cxxmod="libcxx"
build() {
- cd "$srcdir"
-
msg2 "Connecting to LLVM.org SVN server...."
+ cd "$srcdir"
if [ -d $_svnmod/.svn ]; then
(cd $_svnmod && svn update -r $pkgver) || warning "Update failed!"
else
- svn co $_svntrunk/$_svnmod/trunk $_svnmod --config-dir ./ -r $pkgver
+ svn co $_svntrunk/$_svnmod/trunk $_svnmod --config-dir "$srcdir" -r $pkgver
fi
- if [ -d $_cfemod/.svn ]; then
- (cd $_cfemod && svn update -r $pkgver) || warning "Update failed!"
+ cd "$srcdir/llvm/tools"
+ if [ -d clang/.svn ]; then
+ (cd clang && svn update -r $pkgver) || warning "Update failed!"
else
- svn co $_svntrunk/$_cfemod/trunk $_cfemod --config-dir ./ -r $pkgver
+ svn co $_svntrunk/$_cfemod/trunk clang --config-dir "$srcdir" -r $pkgver
fi
- if [ -d $_crtmod/.svn ]; then
- (cd $_crtmod && svn update -r $pkgver) || warning "Update failed!"
+ cd "$srcdir/llvm/projects"
+ if [ -d compiler-rt/.svn ]; then
+ (cd compiler-rt && svn update -r $pkgver) || warning "Update failed!"
else
- svn co $_svntrunk/$_crtmod/trunk $_crtmod --config-dir ./ -r $pkgver
+ svn co $_svntrunk/$_crtmod/trunk compiler-rt --config-dir "$srcdir" -r $pkgver
fi
- #if [ -d $_cxxmod/.svn ]; then
- # (cd $_cxxmod && svn update -r $pkgver) || warning "Update failed!"
- #else
- # svn co $_svntrunk/$_cxxmod/trunk $_cxxmod --config-dir ./ -r $pkgver
- #fi
-
msg2 "SVN checkout done or server timeout"
- rm -rf $_svnmod-build
- svn export $_svnmod $_svnmod-build
- svn export $_cfemod $_svnmod-build/tools/clang
- svn export $_crtmod $_svnmod-build/projects/compiler-rt
- #svn export $_cxxmod $_svnmod-build/projects/libcxx
- cd $_svnmod-build
-
- # Find our headers
- sed -i "s|/usr/local/include|/usr/include/c++/$_gcc_ver|g" tools/clang/lib/Frontend/InitHeaderSearch.cpp
+ # Parse GCC include paths.
+ INCLUDES=`gcc -v -x c++ /dev/null -fsyntax-only 2>&1 | awk '{
+ if ($0 ~ /End of search list./) {
+ includes=0;
+ }
+ if (includes) {
+ if (printed) {
+ printf(":");
+ }
+ printf("%s", $1);
+ printed=1;
+ }
+ if ($0 ~ /#include <...> search starts here:/) {
+ includes=1;
+ }
+ }'`
msg2 "Starting build..."
- [[ -d build ]] && rm -r build
- mkdir build && cd build
+ cd "$srcdir"
+ mkdir -p build && cd build
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-LLVM_ENABLE_ASSERTIONS=OFF \
-LLVM_ENABLE_FFI=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
- ..
+ -DC_INCLUDE_DIRS="${INCLUDES}" \
+ ../$_svnmod
+
+ make
}
package() {
- cd "$srcdir/$_svnmod-build"
-
- cd build
+ cd "$srcdir/build"
make DESTDIR=$pkgdir install
- cd ..
+ cd ../$_svnmod
install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

0 comments on commit 76d6c4b

Please sign in to comment.