-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·86 lines (74 loc) · 1.74 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
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
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
#
# Shell script for building Phoenix-RTOS ports
#
# Copyright 2019, 2024 Phoenix Systems
# Author: Pawel Pisarczyk, Daniel Sawka
#
set -e
# unset phoenix-rtos DEBUG variable as it changes how ports are compiled
unset DEBUG
if [ "$TARGET_FAMILY" = "ia32" ]; then
HOST_TARGET="i386"
HOST="i386-pc-phoenix"
elif [ "$TARGET_FAMILY" = "armv7a7" ]; then
HOST_TARGET="arm"
HOST="arm-phoenix"
elif [ "$TARGET_FAMILY" = "riscv64" ]; then
HOST_TARGET="riscv64"
HOST="riscv64-phoenix"
else
HOST_TARGET="$TARGET_FAMILY"
HOST="${TARGET_FAMILY}-phoenix"
fi
export HOST_TARGET HOST
# use CFLAGS/LDFLAGS/STRIP taken from make
CFLAGS="$EXPORT_CFLAGS"
LDFLAGS="$EXPORT_LDFLAGS"
STRIP="$EXPORT_STRIP"
export CFLAGS LDFLAGS STRIP
export PORTS_MIRROR_BASEURL="https://files.phoesys.com/ports/"
if [ -n "$PORTS_INSTALL_STRIPPED" ] && [ "$PORTS_INSTALL_STRIPPED" = "n" ]; then
export PREFIX_PORTS_INSTALL="$PREFIX_PROG"
else
export PREFIX_PORTS_INSTALL="$PREFIX_PROG_STRIPPED"
fi
# List of directories with ports. Built in this order
ports=(
"mbedtls"
"busybox"
"pcre"
"openssl"
"zlib"
"lighttpd"
"dropbear"
"lua"
"lzo"
"openvpn"
"curl"
"jansson"
"micropython"
"sscep"
"wpa_supplicant"
"libevent"
"openiked"
"azure_sdk"
"picocom"
"fs_mark"
"coremark"
)
for port in "${ports[@]}"; do
(
port_env_name="PORTS_${port^^}"
if [ "${!port_env_name}" = "y" ]; then
export PREFIX_PORT="${PREFIX_PROJECT}/phoenix-rtos-ports/${port}"
# TODO: Maybe "${PREFIX_BUILD}/ports/${port}" to avoid any potential name clashes?
export PREFIX_PORT_BUILD="${PREFIX_BUILD}/${port}"
source "${PREFIX_PROJECT}/phoenix-rtos-ports/build.subr"
b_log "Building ${port}"
mkdir -p "${PREFIX_PORT_BUILD}"
./phoenix-rtos-ports/"${port}"/build.sh
fi
)
done
exit 0