Files
llvm-mingw/build-llvm.sh
T
Martin Storsjö da4d3df5da Update to the latest version of llvm/clang/lld
This version improves llvm-rc to support more rc script features
and features built-in filtering of CPP output in llvm-rc. It also
improves the handling of some def features in llvm-dlltool, allows
producing codeview debug information when targeting mingw and adds
handling of a few more ARM64 relocations in lld.
2018-05-11 09:48:07 +03:00

70 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
set -e
if [ $# -lt 1 ]; then
echo $0 dest
exit 1
fi
PREFIX="$1"
: ${CORES:=4}
if [ ! -d llvm ]; then
# When cloning master and checking out a pinned old hash, we can't use --depth=1.
# Do the git-svn rebase to populate git-svn information, to make
# "clang --version" produce SVN based version numbers.
git clone -b master https://github.com/llvm-mirror/llvm.git
cd llvm/tools
git clone -b master https://github.com/llvm-mirror/clang.git
git clone -b master https://github.com/llvm-mirror/lld.git
cd ..
git svn init https://llvm.org/svn/llvm-project/llvm/trunk
git config svn-remote.svn.fetch :refs/remotes/origin/master
git svn rebase -l
cd tools/clang
git svn init https://llvm.org/svn/llvm-project/cfe/trunk
git config svn-remote.svn.fetch :refs/remotes/origin/master
git svn rebase -l
cd ../lld
git svn init https://llvm.org/svn/llvm-project/lld/trunk
git config svn-remote.svn.fetch :refs/remotes/origin/master
git svn rebase -l
cd ../../..
CHECKOUT=1
fi
if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
cd llvm
[ -z "$SYNC" ] || git fetch
git checkout fd0a9c3d8a037210f68b960b663d97ec9506b300
cd tools/clang
[ -z "$SYNC" ] || git fetch
git checkout 24b26d24d6607708333f77803bd9b2305782bcf7
cd ../lld
[ -z "$SYNC" ] || git fetch
git checkout 656e850b00bee5c9afe7b2389a1dcc6265202143
cd ../../..
fi
if [ "$(which ninja)" != "" ]; then
CMAKE_GENERATOR="-G Ninja"
NINJA=1
fi
cd llvm
mkdir -p build
cd build
cmake \
$CMAKE_GENERATOR \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_TARGETS_TO_BUILD="ARM;AArch64;X86" \
..
if [ -n "$NINJA" ]; then
ninja install/strip
else
make -j$CORES install/strip
fi