This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.sh
executable file
·132 lines (125 loc) · 2.41 KB
/
compile.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#! /bin/sh
set -e
die() {
echo $1
exit 1
}
usage() {
die "usage: compile.sh editor|runner|server|headless|frt|editor-stable|runner-stable"
}
[ -x compile.sh ] || die "Please run from project root directory."
[ -f workdir/godot/README.md -o -f workdir/stable/README.md ] || die "No godot source."
[ $# -eq 1 ] || usage
# Theora is builtin in console applications because linking it would cause
# the package to be dependent on x11 (via cairo).
common_opts="\
use_llvm=yes \
use_lto=yes \
builtin_zlib=no \
builtin_freetype=no \
builtin_libpng=no \
builtin_libogg=no \
builtin_libvorbis=no \
builtin_opus=no \
builtin_libglew=no \
builtin_libwebp=no \
builtin_openssl=no \
"
ccflags_rpi="\
-march=armv6 \
-mfpu=vfp \
-mfloat-abi=hard \
"
export BUILD_REVISION=rpi
cd workdir
case $1 in
editor)
cd godot
nice scons \
platform=x11 \
tools=yes \
target=release_debug \
$common_opts \
builtin_libsquish=no \
builtin_libtheora=no \
pulseaudio=no \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot.x11.opt.tools.32.llvm
;;
runner)
cd godot
nice scons \
platform=x11 \
tools=no \
target=release \
$common_opts \
builtin_libtheora=no \
pulseaudio=no \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot.x11.opt.32.llvm
;;
server)
cd godot
nice scons \
platform=server \
tools=no \
target=release \
$common_opts \
builtin_libtheora=yes \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot_server.server.opt.32
;;
headless)
cd godot
nice scons \
platform=server \
tools=yes \
target=release_debug \
$common_opts \
builtin_libtheora=yes \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot_server.server.opt.tools.32
;;
frt)
cd godot
[ -f platform/frt/README.md ] || die "No frt source."
nice scons \
platform=frt \
target=release \
$common_opts \
builtin_libtheora=yes \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot.frt.opt.llvm
;;
editor-stable)
cd stable
nice scons \
platform=x11 \
tools=yes \
target=release_debug \
$common_opts \
builtin_libsquish=no \
builtin_libtheora=no \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot.x11.opt.tools.32.llvm
;;
runner-stable)
cd stable
nice scons \
platform=x11 \
tools=no \
target=release \
$common_opts \
builtin_libtheora=no \
CCFLAGS="$ccflags_rpi" \
-j 4
strip bin/godot.x11.opt.32.llvm
;;
*) usage
esac