Raster: replaced CRC32 with a faster byte-based implementation
[bblament.git] / build-bb.sh
blobc380597b0dd77d9ad5ce9a6a2b6b98e931c17a27
1 #!/bin/sh
3 ARCH="LinX11"
4 GUIBIN="blackbox"
5 LINKARCH="*"
6 BUILDEXTRA="tan"
7 LINKONLY="ona"
8 ENABLE_INTERP="tan"
10 odir=`pwd`
11 mdir=`dirname "$0"`
13 #unset BB_STANDARD_DIR
14 #unset BB_USE_DIR
15 #unset BB_PACKED_NAME
16 #unset BB_PACKED_FIRST
18 DEFLINARCH="LinX11"
20 # dev binares do this automatically
21 #exeargs="/PACKEDFIRST"
22 exeargs=""
23 exe="./blackboxInterp"
25 while [ $# -gt 0 ]; do
26 if [ "z$1" = "zdev" ]; then exe="./dev0lin"
27 elif [ "z$1" = "zdevfpu" ]; then exe="./dev0lin.64fpu"
28 elif [ "z$1" = "zlin" ]; then ARCH="$DEFLINARCH"
29 elif [ "z$1" = "zLin" ]; then ARCH="$DEFLINARCH"
30 elif [ "z$1" = "zlinX11" ]; then ARCH="LinX11"
31 elif [ "z$1" = "zLinX11" ]; then ARCH="LinX11"
32 elif [ "z$1" = "zX11" ]; then ARCH="LinX11"
33 elif [ "z$1" = "zx11" ]; then ARCH="LinX11"
34 elif [ "z$1" = "zwin" ]; then ARCH="Win"
35 elif [ "z$1" = "zWin" ]; then ARCH="Win"
36 elif [ "z$1" = "znoextra" ]; then BUILDEXTRA="ona"
37 elif [ "z$1" = "zlinkonly" ]; then LINKONLY="tan"
38 elif [ "z$1" = "z-h" ]; then
39 echo "usage: $0 [dev|devfpu] [lin|win] [noextra]"
40 exit 1
41 else
42 echo "wut?"
43 exit 1
45 shift 1
46 done
48 if [ $ARCH = "LinX11" ]; then
49 GUIBIN="blackbox"
50 LINKARCH="Linux"
51 ENABLE_INTERP="tan"
54 if [ ! -x "$exe" ]; then
55 echo "MSG: no ${exe} detected, switching to dev"
56 exe="./dev0lin"
58 echo "MSG: using binary '$exe'"
61 cd "$mdir"
63 SUBLIST_COMMON=" \
64 Utf \
65 HostSubArch \
66 HostKernel \
67 Files \
68 HostEnv \
69 HostIOBuffers \
70 HostFiles \
71 StdSubsManager \
72 StdLoader \
75 GUI_RESLIST=" \
76 1 BlackBox.res \
77 1 Applogo.ico \
78 2 Applogo.ico \
79 3 SFLogo.ico \
80 4 CFLogo.ico \
81 5 DtyLogo.ico \
82 6 folderimg.ico \
83 7 openimg.ico \
84 8 leafimg.ico \
85 1 Move.cur \
86 2 Copy.cur \
87 3 Link.cur \
88 4 Pick.cur \
89 5 Stop.cur \
90 6 Hand.cur \
91 7 Table.cur \
95 ################################################################
96 if [ $LINKONLY = ona ]; then
97 echo "compiling common base system"
98 "${exe}" $exeargs <<DATA
99 DevCompiler.SetCrossArch $ARCH
100 DevCompiler.CompileThis Builtins486^
101 DevCompiler.CompileSubs Host System Std Cons Raster Text Form Dev Comm Sql Ole Obx Diff Lamentdev Lament Srex Stroke Qjack
102 Kernel.Quit(0)
103 DATA
104 res="$?"
105 if [ $res -ne 0 ]; then
106 echo "*** ERROR ***"
107 exit 1
109 else
110 BUILDEXTRA="ona"
113 echo "linking GUI"
114 "${exe}" $exeargs <<DATA
115 DevCompiler.SetCrossArch $ARCH
116 DevLinker1.LinkElfExe $LINKARCH $GUIBIN := Builtins486 Kernel$+ $SUBLIST_COMMON HostGui HostLoader $GUI_RESLIST
117 Kernel.Quit(0)
118 DATA
119 res="$?"
120 if [ $res -ne 0 ]; then
121 echo "*** ERROR ***"
122 exit 1
125 if [ "$ENABLE_INTERP" = "tan" ]; then
126 echo "linking console interpreter"
127 "${exe}" $exeargs <<DATA
128 DevCompiler.SetCrossArch $ARCH
129 DevLinker1.LinkElfExe $LINKARCH dos blackboxInterp := Builtins486 Kernel$+ $SUBLIST_COMMON HostIntLoader 1 BlackBox.res
130 Kernel.Quit(0)
131 DATA
132 res="$?"
133 if [ $res -ne 0 ]; then
134 echo "*** ERROR ***"
135 exit 1
139 ### if [ "z$ARCH" = "zWin" ]; then
140 ### # HostKernel is required because "HostSubArch" is different
141 ### echo "compiling and linking Windows/MDI system"
142 ### # HostTabFrames is not used anymore, but let's keep it compiled for now
143 ### "${exe}" $exeargs <<DATA
144 ### DevCompiler.SetCrossArch "${ARCH}Mdi"
145 ### DevCompiler.CompileThis HostSubArch HostShowHook HostCFrames HostTabFrames HostMenus HostConfig HostInit HostKernel
146 ### DevLinker1.LinkElfExe $LINKARCH blackboxMDI := Builtins486 Kernel$+ $SUBLIST_COMMON HostGui HostLoader $GUI_RESLIST
147 ### Kernel.Quit(0)
148 ### DATA
149 ### res="$?"
150 ### if [ $res -ne 0 ]; then
151 ### echo "*** ERROR ***"
152 ### exit 1
153 ### fi
154 ### fi
155 ################################################################
158 if [ $BUILDEXTRA = "tan" ]; then
159 echo "compiling some additional modules for GUI"
161 MORESUBS="Brahe Check Srcnav Xhtml Cpc Mysql SQLite Zlib Xpack CPfront"
163 "${exe}" $exeargs <<DATA
164 DevCompiler.SetCrossArch $ARCH
165 DevCompiler.CompileSubs $MORESUBS
166 Kernel.Quit(0)
167 DATA
168 res="$?"
169 if [ $res -ne 0 ]; then
170 echo "*** ERROR ***"
171 exit 1
175 echo "compiling O3"
177 "${exe}" $exeargs <<DATA
178 DevCompiler.SetCrossArch $ARCH
179 DevCompiler.CompileSubs O3app O3base O3bb O3host O3std App
180 Kernel.Quit(0)
181 DATA
182 res="$?"
183 if [ $res -ne 0 ]; then
184 echo "*** ERROR ***"
185 exit 1
189 echo "compiling Other"
191 "${exe}" $exeargs <<DATA
192 DevCompiler.SetCrossArch $ARCH
193 DevCompiler.CompileSubs Other
194 Kernel.Quit(0)
195 DATA
197 res="$?"
198 if [ $res -ne 0 ]; then
199 echo "*** ERROR ***"
200 exit 1
204 cd "$odir"