-
Notifications
You must be signed in to change notification settings - Fork 0
/
openbsd6.6.sh
executable file
·55 lines (48 loc) · 1.47 KB
/
openbsd6.6.sh
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
55
#!/usr/bin/env bash
set -e
################################################################################
#
# pkg install ninja cmake git coreutils
#
################################################################################
__JOBS=`gnproc`
__PROJECT=~/work/llvm
__SOURCE=$__PROJECT/llvm-project
__LLVM_TAG="llvmorg-10.0.0"
__LLVM_PRODUCT="llvm-10.0.0"
__LLVM_INSTALL_ROOT=/opt/$__LLVM_PRODUCT
mkdir -p `dirname $__SOURCE`
if [ ! -d $__SOURCE ]; then
echo "GIT: cloning llvm-project..."
git clone https://github.com/llvm/llvm-project.git $__SOURCE
fi
cd $__SOURCE
echo "GIT: switch to ${__LLVM_TAG}"
git switch --detach $__LLVM_TAG
git describe --always
################################################################################
#
# build: llvm
#
################################################################################
__BUILD=$__PROJECT/_build/$__LLVM_PRODUCT
__PREFIX=$__LLVM_INSTALL_ROOT
__PROJECTS="clang;lld"
if [ ! -f $__PREFIX/bin/llvm-config ]; then
if [ -d $__BUILD ]; then
echo "already exists: $__BUILD"
exit 1
fi
mkdir -p $__BUILD
cd $__BUILD
cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="$__PREFIX" \
-DCMAKE_PREFIX_PATH="$__PREFIX" \
-DLLVM_ENABLE_PROJECTS="$__PROJECTS" \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR" \
-DLLVM_ENABLE_LIBXML2="OFF" \
-DLLVM_ENABLE_TERMINFO="OFF" \
"$__SOURCE/llvm"
ninja -j$__JOBS install
fi