-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sh
executable file
·39 lines (34 loc) · 1.11 KB
/
build.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
#!/bin/bash
DL="https://github.com/openipc/firmware/releases/download/latest"
if [ "$1" = "vdec" ] || [ "$1" = "osd" ]; then
CC=cortex_a7-gcc13-glibc-4_9
else
CC=cortex_a7_thumb2-gcc13-musl-4_9
fi
GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc
if [ ! -e toolchain/$CC ]; then
wget -c -q --show-progress $DL/$CC.tgz -P $PWD
mkdir -p toolchain/$CC
tar -xf $CC.tgz -C toolchain/$CC --strip-components=1 || exit 1
rm -f $CC.tgz
fi
if [ ! -e firmware ]; then
git clone https://github.com/openipc/firmware --depth=1
fi
if [ "$1" = "vdec" ]; then
DRV=$PWD/firmware/general/package/hisilicon-osdrv-hi3536dv100/files/lib
make -C vdec -B CC=$GCC DRV=$DRV
elif [ "$1" = "venc-goke" ]; then
DRV=$PWD/firmware/general/package/goke-osdrv-gk7205v200/files/lib
make -C venc -B CC=$GCC DRV=$DRV $1
elif [ "$1" = "venc-hisi" ]; then
DRV=$PWD/firmware/general/package/hisilicon-osdrv-hi3516ev200/files/lib
make -C venc -B CC=$GCC DRV=$DRV $1
elif [ "$1" = "osd" ]; then
cd osd
cmake -Bbuild -DCMAKE_C_COMPILER=$GCC -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel 8
else
echo "Usage: $0 [vdec|venc-goke|venc-hisi|osd]"
exit 1
fi