oops .. forgot to offset from objects bounds
[AROS.git] / scripts / gimmearos.sh
blob8a5b082e2fc6779bee848dd34cb5496a52761251
1 #!/bin/bash
3 # Script for building AROS from the Subversion repository
5 # Currently only a limited amount of Linux distros is supported.
6 # If you improve this script, send modifications back to me, please.
7 # Matthias Rustler, mailto:mrustler@gmx.de
9 # This script is public domain. Use it at your own risk.
11 # $VER: gimmearos.sh 1.10 (28.07.2013)
13 curdir="`pwd`"
14 srcdir="aros-src"
15 srcdir_v0="aros-src-v0"
16 portsdir="ports-src"
17 cpucoresforcompile="2"
19 install_pkg()
21 if [ $# -ne 2 ]
22 then
23 echo "install_pkg() needs 2 arguments"
24 exit 100
26 echo -e "\nInstalling " $2
27 sudo $1 $2
28 if [ $? -ne 0 ]
29 then
30 echo -e "\n install failed. Script cancelled."
31 exit 100
37 echo -e "\n\nScript for downloading and building of AROS"
38 echo -e "============================================"
39 echo -e "\nStep 1: install prerequisites"
40 echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
41 echo -e "The build system needs some packages to do its job."
42 echo -e "If you are asked for a password enter you admin password."
43 echo -e "\n1 .. Get packages with apt-get for Debian and similar (e.g. Ubuntu)"
44 echo -e " for building 32-bit AROS on 32-bit Linux or 64-bit-AROS on 64-bit-Linux"
45 echo -e "2 .. As 1) but with additional packages for building 32-bit AROS"
46 echo -e " on 64-bit Linux"
47 echo -e "3 .. Get packages with yum for Fedora"
48 echo -e "4 .. Get packages with pacman for Arch"
49 echo -e "9 .. Skip this step"
50 echo -e "0 .. Exit"
52 echo -e "\nEnter number and press <Enter>:"
54 read input
55 case "$input" in
56 1 ) echo -e "\nInstalling prerequisites with apt-get..."
57 install_pkg "apt-get install" subversion
58 install_pkg "apt-get install" git-core
59 install_pkg "apt-get install" gcc
60 install_pkg "apt-get install" g++
61 install_pkg "apt-get install" make
62 install_pkg "apt-get install" gawk
63 install_pkg "apt-get install" bison
64 install_pkg "apt-get install" flex
65 install_pkg "apt-get install" bzip2
66 install_pkg "apt-get install" netpbm
67 install_pkg "apt-get install" autoconf
68 install_pkg "apt-get install" automake
69 install_pkg "apt-get install" libx11-dev
70 install_pkg "apt-get install" libxext-dev
71 install_pkg "apt-get install" libc6-dev
72 install_pkg "apt-get install" liblzo2-dev
73 install_pkg "apt-get install" libxxf86vm-dev
74 install_pkg "apt-get install" libpng12-dev
75 install_pkg "apt-get install" gcc-multilib
76 install_pkg "apt-get install" libsdl1.2-dev
77 install_pkg "apt-get install" byacc
80 2 ) echo -e "\nInstalling prerequisites with apt-get..."
81 install_pkg "apt-get install" subversion
82 install_pkg "apt-get install" git-core
83 install_pkg "apt-get install" gcc
84 install_pkg "apt-get install" g++
85 install_pkg "apt-get install" make
86 install_pkg "apt-get install" gawk
87 install_pkg "apt-get install" bison
88 install_pkg "apt-get install" flex
89 install_pkg "apt-get install" bzip2
90 install_pkg "apt-get install" netpbm
91 install_pkg "apt-get install" autoconf
92 install_pkg "apt-get install" automake
93 install_pkg "apt-get install" libx11-dev
94 install_pkg "apt-get install" libxext-dev
95 install_pkg "apt-get install" libc6-dev
96 install_pkg "apt-get install" liblzo2-dev
97 install_pkg "apt-get install" libxxf86vm-dev
98 install_pkg "apt-get install" libpng12-dev
99 install_pkg "apt-get install" gcc-multilib
100 install_pkg "apt-get install" libsdl1.2-dev
101 install_pkg "apt-get install" byacc
103 install_pkg "apt-get install" libc6-dev-i386
104 install_pkg "apt-get install" lib32gcc1
105 install_pkg "apt-get install" ia32-libs
108 3 ) echo -e "\nInstalling prerequisites with yum..."
109 install_pkg "yum install" subversion
110 install_pkg "yum install" git-core
111 install_pkg "yum install" gcc
112 install_pkg "yum install" gawk
113 install_pkg "yum install" bison
114 install_pkg "yum install" flex
115 install_pkg "yum install" bzip2
116 install_pkg "yum install" netpbm
117 install_pkg "yum install" autoconf
118 install_pkg "yum install" automake
119 install_pkg "yum install" libX11-devel
120 install_pkg "yum install" glibc-devel
121 install_pkg "yum install" lzo-devel
124 4 ) echo -e "\nInstalling prerequisites with pacman.."
125 echo -e "\nUpdating the List of software"
126 echo -e "\nEnter sudo password"
127 sudo pacman -Sy
128 install_pkg "pacman --needed --noconfirm -S" subversion
129 install_pkg "pacman --needed --noconfirm -S" git-core
130 install_pkg "pacman --needed --noconfirm -S" gcc
131 install_pkg "pacman --needed --noconfirm -S" gawk
132 install_pkg "pacman --needed --noconfirm -S" bison
133 install_pkg "pacman --needed --noconfirm -S" flex
134 install_pkg "pacman --needed --noconfirm -S" bzip2
135 install_pkg "pacman --needed --noconfirm -S" netpbm
136 install_pkg "pacman --needed --noconfirm -S" autoconf
137 install_pkg "pacman --needed --noconfirm -S" automake
138 #it appears as though the libx11-dev,libc6-dev,liblzo2-dev is not needed on arch
141 0 ) exit 0
143 esac
145 cd "$curdir"
147 input=""
148 until [ "$input" = "9" ]
150 echo -e "\nStep 2: Get the sources from the repository"
151 echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
152 echo -e "\nYou can either use Subversion or Git. Git doesn't require"
153 echo -e "a password, but you'll get only read-only access."
154 echo -e "The repositories will be checked out into the current directory."
155 echo -e "\nABI V1 is the current development version which is no longer"
156 echo -e "binary compatible with V0."
157 echo -e "\nABI V1 with | ABI V0 with | ABI V1 |"
158 echo -e "Subversion | Subversion | with GIT | Content"
159 echo -e "------------+-------------+----------+--------------------------"
160 echo -e " 1 | 11 | 21 | Get AROS core (required)"
161 echo -e " 2 | 12 | 22 | Get contrib (optional)"
162 echo -e "\n 3 | 13 | 23 | Get ports source (optional, needs contrib)"
163 echo -e "\n 4 | 14 | --- | Get documentation source (optional)"
164 echo -e " 5 | 15 | --- | Get binaries (wallpapers, logos etc.) (optional)"
165 echo -e "\n9 .. Leave loop, goto next step"
166 echo -e "0 .. Exit"
168 echo -e "\nEnter number and press <Enter>:"
170 read input
171 case "$input" in
172 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
173 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
175 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
176 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
178 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
179 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
181 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
182 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
184 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
185 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
188 11 ) echo -e "\nGetting AROS V0 core with Subversion...\n"
189 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/AROS "$srcdir_v0"
191 12 ) echo -e "\nGetting contrib V0 with Subversion...\n"
192 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/contrib "$srcdir_v0/contrib"
194 13 ) echo -e "\nGetting ports V0 with Subversion...\n"
195 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/ports "$srcdir_v0/ports"
197 14 ) echo -e "\nGetting documentation V1 with Subversion...\n"
198 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/documentation "$srcdir_v0/documentation"
200 15 ) echo -e "\nGetting binaries V1 with Subversion...\n"
201 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/binaries "$srcdir_v0/binaries"
204 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
205 git clone git://repo.or.cz/AROS.git "$srcdir"
207 22 ) echo -e "\nGetting contrib V1 with Git...\n"
208 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
210 23 ) echo -e "\nGetting ports V1 with Git...\n"
211 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
214 0 ) exit 0
216 esac
217 done
219 cd "$curdir"
222 input=""
223 until [ "$input" = "9" ]
225 cd "$curdir"
227 echo -e "\nStep 3: Configuring"
228 echo -e "~~~~~~~~~~~~~~~~~~~"
229 echo -e "\nABI V1 | ABI V0 |"
230 echo -e "-------+--------+----------------------------"
231 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
232 echo -e " 2 | 12 | linux-i386 (32-bit)"
233 echo -e " 3 | 13 | linux-x86_64 (64-bit) debug"
234 echo -e " 4 | 14 | linux-x86_64 (64-bit)"
235 echo -e " 5 | 15 | pc-i386 (32-bit)"
236 echo -e " 6 | 16 | pc-x86_64 (64-bit)"
237 echo -e "\n9 .. Leave loop, goto next step"
238 echo -e "0 .. Exit"
240 echo -e "\nEnter number and press <Enter>:"
242 read input
243 case "$input" in
244 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
245 mkdir -p "$portsdir"
246 mkdir -p aros-linux-i386-dbg
247 cd aros-linux-i386-dbg
248 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$curdir/$portsdir"
250 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
251 mkdir -p "$portsdir"
252 mkdir -p aros-linux-i386
253 cd aros-linux-i386
254 "../$srcdir/configure" --target=linux-i386 --with-portssources="$curdir/$portsdir"
256 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
257 mkdir -p "$portsdir"
258 mkdir -p aros-linux-x86_64-dbg
259 cd aros-linux-x86_64-dbg
260 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$curdir/$portsdir"
262 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
263 mkdir -p "$portsdir"
264 mkdir -p aros-linux-x86_64
265 cd aros-linux-x86_64
266 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$curdir/$portsdir"
268 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
269 mkdir -p "$portsdir"
270 mkdir -p aros-pc-i386
271 cd aros-pc-i386
272 "../$srcdir/configure" --target=pc-i386 --with-portssources="$curdir/$portsdir"
274 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
275 mkdir -p "$portsdir"
276 mkdir -p aros-pc-x86_64
277 cd aros-pc-x86_64
278 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$curdir/$portsdir"
282 11 ) echo -e "\nConfiguring linux-i386 V0 with full debug...\n"
283 mkdir -p "$portsdir"
284 mkdir -p aros-linux-i386-v0-dbg
285 cd aros-linux-i386-v0-dbg
286 "../$srcdir_v0/configure" --target=linux-i386 --enable-debug=all --with-portssources="$curdir/$portsdir"
288 12 ) echo -e "\nConfiguring linux-i386 V0 without debug...\n"
289 mkdir -p "$portsdir"
290 mkdir -p aros-linux-i386-v0
291 cd aros-linux-i386-v0
292 "../$srcdir_v0/configure" --target=linux-i386 --with-portssources="$curdir/$portsdir"
294 13 ) echo -e "\nConfiguring linux-x86_64 V0 with full debug...\n"
295 mkdir -p "$portsdir"
296 mkdir -p aros-linux-x86_64-v0-dbg
297 cd aros-linux-x86_64-v0-dbg
298 "../$srcdir_v0/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$curdir/$portsdir"
300 14 ) echo -e "\nConfiguring linux-x86_64 V0 without debug...\n"
301 mkdir -p "$portsdir"
302 mkdir -p aros-linux-x86_64-v0
303 cd aros-linux-x86_64-v0
304 "../$srcdir_v0/configure" --target=linux-x86_64 --with-portssources="$curdir/$portsdir"
306 15 ) echo -e "\nConfiguring pc-i386 V0...\n"
307 mkdir -p "$portsdir"
308 mkdir -p aros-pc-i386-v0
309 cd aros-pc-i386-v0
310 "../$srcdir_v0/configure" --target=pc-i386 --with-portssources="$curdir/$portsdir"
312 16 ) echo -e "\nConfiguring pc-x86_64 V0...\n"
313 mkdir -p "$portsdir"
314 mkdir -p aros-pc-x86_64-v0
315 cd aros-pc-x86_64-v0
316 "../$srcdir_v0/configure" --target=pc-x86_64 --with-portssources="$curdir/$portsdir"
320 0 ) exit 0
322 esac
323 done
327 cd "$curdir"
329 input=""
330 until [ "$input" = "9" ]
332 cd "$curdir"
333 echo -e "\nStep 4: Building"
334 echo -e "~~~~~~~~~~~~~~~~"
335 echo -e "\nYou can only build what you've already configured."
336 echo -e "\nABI V1 | ABI V0 |"
337 echo -e "-------+--------+----------------------------"
338 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
339 echo -e " 2 | 12 | linux-i386 (32-bit)"
340 echo -e " 3 | 13 | linux-x86_64 (64-bit) debug"
341 echo -e " 4 | 14 | linux-x86_64 (64-bit)"
342 echo -e " 5 | 15 | pc-i386 (32-bit)"
343 echo -e " 6 | 16 | pc-x86_64 (64-bit)"
344 echo -e "\n9 .. Leave loop, exit"
346 echo -e "\nEnter number and press <Enter>:"
348 read input
349 case "$input" in
350 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
351 cd aros-linux-i386-dbg
352 make "-j"$cpucoresforcompile
353 make default-x11keymaptable
354 echo -e "\nIf everything went well AROS will be available"
355 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
357 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
358 cd aros-linux-i386
359 make "-j"$cpucoresforcompile
360 make default-x11keymaptable
361 echo -e "\nIf everything went well AROS will be available"
362 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
364 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
365 cd aros-linux-x86_64-dbg
366 make "-j"$cpucoresforcompile
367 make default-x11keymaptable
368 echo -e "\nIf everything went well AROS will be available"
369 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
371 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
372 cd aros-linux-x86_64
373 make "-j"$cpucoresforcompile
374 make default-x11keymaptable
375 echo -e "\nIf everything went well AROS will be available"
376 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
378 5 ) echo -e "\nBuilding pc-i386 V1...\n"
379 cd aros-pc-i386
380 make "-j"$cpucoresforcompile
381 make default-x11keymaptable
382 echo -e "\nIf everything went well AROS will be available"
383 echo -e "in the directory aros-pc-i386/bin/<target>/AROS"
385 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
386 cd aros-pc-x86_64
387 make "-j"$cpucoresforcompile
388 make default-x11keymaptable
389 echo -e "\nIf everything went well AROS will be available"
390 echo -e "in the directory aros-pc-x86_64/bin/<target>/AROS"
394 11 ) echo -e "\nBuilding linux-i386 V0 with full debug...\n"
395 cd aros-linux-i386-v0-dbg
396 make "-j"$cpucoresforcompile
397 make default-x11keymaptable
398 echo -e "\nIf everything went well AROS will be available"
399 echo -e "in the directory aros-linux-i386-v0-dbg/bin/<target>/AROS"
401 12 ) echo -e "\nBuilding linux-i386 V0 without debug...\n"
402 cd aros-linux-i386-v0
403 make "-j"$cpucoresforcompile
404 make default-x11keymaptable
405 echo -e "\nIf everything went well AROS will be available"
406 echo -e "in the directory aros-linux-i386-v0/bin/<target>/AROS"
408 13 ) echo -e "\nBuilding linux-x86_64 V0 with full debug...\n"
409 cd aros-linux-x86_64-v0-dbg
410 make "-j"$cpucoresforcompile
411 make default-x11keymaptable
412 echo -e "\nIf everything went well AROS will be available"
413 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
415 14 ) echo -e "\nBuilding linux-x86_64 V0 without debug...\n"
416 cd aros-linux-x86_64-v0
417 make "-j"$cpucoresforcompile
418 make default-x11keymaptable
419 echo -e "\nIf everything went well AROS will be available"
420 echo -e "in the directory aros-linux-x86_64-v0/bin/<target>/AROS"
422 15 ) echo -e "\nBuilding pc-i386 V0...\n"
423 cd aros-pc-i386-v0
424 make "-j"$cpucoresforcompile
425 make default-x11keymaptable
426 echo -e "\nIf everything went well AROS will be available"
427 echo -e "in the directory aros-pc-i386-v0/bin/<target>/AROS"
429 16 ) echo -e "\nBuilding pc-x86_64 V0...\n"
430 cd aros-pc-x86_64-v0
431 make "-j"$cpucoresforcompile
432 make default-x11keymaptable
433 echo -e "\nIf everything went well AROS will be available"
434 echo -e "in the directory aros-pc-x86_64-v0/bin/<target>/AROS"
437 esac
438 done
441 cd "$curdir"
443 exit 0