forked from msfjarvis/oneplus3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildenv.sh
executable file
·54 lines (40 loc) · 1.51 KB
/
buildenv.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
#!/bin/zsh
set -e
if ! [ -x "$(command -v cpupower)" ]; then
echo Installing cpupower...
yay -Sy --noconfirm cpupower
fi
echo Changing CPUfreq governor to performance...
sudo cpupower frequency-set -g performance
echo Installing dependencies...
if ! [ -x "$(command -v ccache)" ]; then
echo Installing ccache...
yay -Sy --noconfirm ccache
fi
if [ ! -d ".vendor" ]; then
mkdir .vendor
echo Installing AnyKernel2...
mkdir .vendor/AnyKernel2
git clone [email protected]:MSF-Jarvis/AnyKernel2.git .vendor/AnyKernel2
echo Installing GCC toolchain build script...
mkdir .vendor/build-tools-gcc .vendor/gcc
git clone [email protected]:nathanchance/build-tools-gcc.git .vendor/build-tools-gcc
echo Building GCC for arm64...
(cd .vendor/build-tools-gcc && ./build -a arm64 -s gnu -v 7 -V && cp -r aarch64-linux-gnu ../gcc)
echo Building GCC for arm...
(cd .vendor/build-tools-gcc && ./build -a arm -s gnu -v 7 -V && cp -r arm-linux-gnueabi ../gcc)
echo Installing mkbootimg...
mkdir .vendor/mkbootimg
curl -L --progress https://android.googlesource.com/platform/system/core/+archive/master/mkbootimg.tar.gz \
| tar xzf - -C .vendor/mkbootimg
fi
export TOP=`readlink -f $(dirname "$0")`
export ARCH=arm64
export CCACHE_DIR=.ccache
export CROSS_COMPILE=$TOP/.vendor/gcc/aarch64-linux-gnu/bin/aarch64-linux-gnu-
export CROSS_COMPILE_ARM32=$TOP/.vendor/gcc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
export OUT=/tmp/out
export MAKEFLAGS="-j`expr $(nproc) \* 2` O=$OUT"
export USE_CCACHE=1
ccache -M 50G
exec zsh