2
2
# Installs dependencies, builds Silverfish, and places it into your path
3
3
# Be sure to validate the Rust and LLVM install scripts we invoke below!
4
4
5
+ sudo=" sudo"
6
+ if [[ $( whoami) == " root" ]]; then
7
+ sudo=" "
8
+ fi
9
+
5
10
# Exit if not executing script from project root because we use relative paths
6
11
# We want to match without case because the URL of the git repo is case insensitive, but the resulting
7
12
# directory is case sensitive. Thus, we can end up with either "aWsm" or "awsm."
8
13
shopt -s nocasematch
9
- if [[ $( git remote get-url origin) != * " /aWsm.git " || $( git rev-parse --show-toplevel) != $( pwd) ]]; then
14
+ if [[ $( git remote get-url origin) != * " /awsm " * || $( git rev-parse --show-toplevel) != $( pwd) ]]; then
10
15
echo " Install script must be run from project root."
11
16
exit 1
12
17
fi
13
18
shopt -u nocasematch
14
19
15
20
# Install Build Dependencies
16
- sudo apt install build-essential --yes
17
- sudo apt install cmake --yes
21
+ $sudo apt install build-essential --yes
22
+ $sudo apt install cmake --yes
23
+ $sudo apt install lsb-release wget software-properties-common --yes
18
24
19
25
# Initialize Wasmception submodule
20
26
# Check to see if ./wasmception directory exists and is not empty.
@@ -38,13 +44,13 @@ source "$HOME/.cargo/env"
38
44
export PATH=" $HOME /.cargo/bin:$PATH "
39
45
40
46
# Install LLVM build dependencies
41
- LLVM_VERSION=9
42
- sudo bash -c " $( wget -O - https://apt.llvm.org/llvm.sh) " bash $LLVM_VERSION
43
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
44
- sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
45
- sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
46
- sudo apt install libc++-dev libc++abi-dev --yes
47
+ LLVM_VERSION=11
48
+ $ sudo bash -c " $( wget -O - https://apt.llvm.org/llvm.sh) " bash $LLVM_VERSION
49
+ $ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
50
+ $ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
51
+ $ sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
52
+ $ sudo apt install libc++-dev libc++abi-dev --yes
47
53
48
54
# Build and install Silverfish
49
55
cargo build --release
50
- sudo cp -t /usr/bin ./target/release/silverfish
56
+ $ sudo cp -t /usr/bin ./target/release/silverfish
0 commit comments