Added a version of the LLVM/Clang checkout and

build script that applies any local patches to
LLVM/Clang.

llvm-svn: 146811
This commit is contained in:
Sean Callanan 2011-12-17 02:00:57 +00:00
parent 7caca84ce4
commit 4de1090322
1 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,73 @@
#!/bin/sh -x
# Usage:
# build-lldb-llvm-clang <revision> [Debug|Release]
# build-lldb-llvm-clang <llvm-revision> <clang-revision> [Debug|Release]
LLVM_REVISION=$1
CLANG_REVISION=$2
LLVM_CONFIGURATION=$3
if [ "$LLVM_REVISION" = "" ]; then
echo "Usage:\n build-lldb-llvm-clang <llvm-revision> [<clang-revision> Debug|Release]"
exit 1
fi
if [ "$CLANG_REVISION" = "" ]; then
$CLANG_REVISION = $LLVM_REVISION
fi
# Checkout LLVM
svn co -q -r $LLVM_REVISION http://llvm.org/svn/llvm-project/llvm/trunk llvm
# change directory to "./llvm"
cd llvm
rm -rf test
# Checkout Clang
# change directory to "./llvm/tools"
cd tools
svn co -q -r $CLANG_REVISION http://llvm.org/svn/llvm-project/cfe/trunk clang
rm -rf clang/test
# change directory to "./llvm"
cd ..
for patch_file in ../scripts/llvm.*.diff
do
echo "Applying patch from '$patch_file'"
patch -p0 < "$patch_file"
done
# change directory to "./llvm/tools/clang"
cd tools/clang
for patch_file in ../../../scripts/clang.*.diff
do
echo "Applying patch from '$patch_file'"
patch -p0 < "$patch_file"
done
# change directory to "./"
cd ../../..
pwd
if [ "$LLVM_CONFIGURATION" = "Debug" ]; then
# Configure "Debug+Asserts" build
mkdir llvm-debug
cd llvm-debug
../llvm/configure --enable-targets=x86_64,arm
make -j8 clang-only VERBOSE=1 PROJECT_NAME='llvm'
make -j8 tools-only VERBOSE=1 PROJECT_NAME='llvm' EDIS_VERSION=1
elif [ "$LLVM_CONFIGURATION" = "Release" ]; then
# Configure "Release" build
mkdir llvm-release
cd llvm-release
../llvm/configure --enable-targets=x86_64,arm --enable-optimized --disable-assertions
make -j8 clang-only VERBOSE=1 PROJECT_NAME='llvm'
make -j8 tools-only VERBOSE=1 PROJECT_NAME='llvm' EDIS_VERSION=1
elif [ "$LLVM_CONFIGURATION" = "BuildAndIntegration" ]; then
# Configure "BuildAndIntegration" build
rm -rf ./scripts/*.diff
else
echo "checked out llvm (revision $LLVM_REVISION) and clang (revision $CLANG_REVISION)."
exit 0
fi