-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·74 lines (64 loc) · 2.68 KB
/
setup.sh
File metadata and controls
executable file
·74 lines (64 loc) · 2.68 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
TOOLCHAIN_FILE="armv7-eabihf--musl--stable-2018.02-2.tar.bz2"
TOOLCHAIN_URL="https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/$TOOLCHAIN_FILE"
if [ ! -d toolchain ]; then
if [ "$1" == "automated_build" ]; then
echo "Extracting toolchain..."
mkdir toolchain
wget -qO- "$TOOLCHAIN_URL" | tar xj --strip-components=1 -C toolchain
fi
if [ ! -z "$1" ] && [ "$1" != "automated_build" ]; then
echo "Working directory: `pwd`"
cp $1 .
fi
if [ ! -f "$TOOLCHAIN_FILE" ] && [ "$1" != "automated_build" ]; then
echo "$TOOLCHAIN_FILE not found."
while true; do
read -p "download $TOOLCHAIN_URL? (y/n): " yn
case $yn in
[yY]* ) wget "$TOOLCHAIN_URL"; break;; # Accepts 'y', 'Y', 'yes', 'YES', etc.
[nN]* ) echo "Please run setup.sh with path to toolchain archive eg: "; echo "./setup.sh $TOOLCHAIN_FILE"; exit;; # Accepts 'n', 'N', 'no', 'NO', etc.
* ) echo "Invalid response. Please enter 'y' or 'n'.";;
esac
done
fi
if [ -f "$TOOLCHAIN_FILE" ]; then
echo "Using toolchain `pwd`/$TOOLCHAIN_FILE"
if [ ! -d toolchain ]; then
echo "Extracting toolchain..."
mkdir toolchain
tar -xvjf $TOOLCHAIN_FILE --strip-components=1 -C toolchain
fi
fi
fi
rm -rf build_*
echo
echo "**********************************************"
echo "Preparing HDZero Goggle Build Environment....."
echo "**********************************************"
cmake . -DHDZ_GOGGLE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=toolchain/share/buildroot/toolchainfile.cmake -Bbuild_goggle
echo
echo "**********************************************"
echo "Preparing HDZero BoxPro Build Environment....."
echo "**********************************************"
cmake . -DHDZ_BOXPRO=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=toolchain/share/buildroot/toolchainfile.cmake -Bbuild_boxpro
echo
echo "**********************************************"
echo "Preparing HDZero Goggle2 Build Environment....."
echo "**********************************************"
cmake . -DHDZ_GOGGLE2=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=toolchain/share/buildroot/toolchainfile.cmake -Bbuild_goggle2
echo
echo "****************************************"
echo "*** HDZero Goggle Build Instructions ***"
echo "****************************************"
echo "cd build_goggle; make -j"
echo
echo "****************************************"
echo "*** HDZero BoxPro Build Instructions ***"
echo "****************************************"
echo "cd build_boxpro; make -j"
echo
echo "****************************************"
echo "*** HDZero Goggle2 Build Instructions ***"
echo "****************************************"
echo "cd build_goggle2; make -j"