-
Notifications
You must be signed in to change notification settings - Fork 1
/
icecc-create-darwin-env
executable file
·54 lines (43 loc) · 1.64 KB
/
icecc-create-darwin-env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
if [[ ! ${THREADS} == "" ]]
then
J="-j ${THREADS}"
fi
if [[ ${CLANG_REVISION} == "" ]]
then
wget -O update.py https://raw.githubusercontent.com/chromium/chromium/master/tools/clang/scripts/update.py
CLANG_REVISION=$(cat update.py | grep CLANG_SVN_REVISION | head -n 1 | cut -d "'" -f 2 | cut -d "n" -f 2)
fi
# Checking out LLVM
svn checkout --force https://llvm.org/svn/llvm-project/llvm/trunk@${CLANG_REVISION} llvm
# Checking out Clang
svn checkout --force https://llvm.org/svn/llvm-project/cfe/trunk@${CLANG_REVISION} llvm/tools/clang
# Checking out LLD
svn checkout --force https://llvm.org/svn/llvm-project/lld/trunk@${CLANG_REVISION} llvm/tools/lld
# Checking out compiler-rt
svn checkout --force https://llvm.org/svn/llvm-project/compiler-rt/trunk@${CLANG_REVISION} llvm/compiler-rt
# Building
mkdir build
cd build
cmake -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_USE_CRT_RELEASE=MT \
-DLLVM_ENABLE_LIBXML2=FORCE_ON \
-DCMAKE_C_FLAGS= \
-DCMAKE_CXX_FLAGS= \
-DCMAKE_EXE_LINKER_FLAGS= \
-DCMAKE_SHARED_LINKER_FLAGS= \
-DCMAKE_MODULE_LINKER_FLAGS= \
-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin16.0.0 \
-DCMAKE_INSTALL_PREFIX:PATH=../install_dir_clang_darwin_on_linux/ \
../llvm
ninja ${J}
# Installing
ninja install
# Creating ice environment
cd ..
BUILD_ENV=$(pwd)/$(/usr/lib/icecc/icecc-create-env --clang $(pwd)/install_dir_clang_darwin_on_linux/bin/clang /usr/lib/icecc/compilerwrapper | grep creating | awk '{print $2}')
mv $BUILD_ENV clang_darwin_on_linux_${CLANG_REVISION}.tar.gz
rm -rf build install_dir_clang_darwin_on_linux update.py