Tiny kprintf implementation, only decimal and hexadecimal output (unsigned).
[AROS.git] / scripts / gimmearos.sh
blobc0206e3bc084dee0209e8f258de4006a31d2e50b
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.11 (26.07.2014) WIP
13 curdir="`pwd`"
14 srcdir="aros-src"
15 srcdir_v0="aros-src-v0"
16 portsdir="$HOME/aros-ports-src"
17 makeopts="-j2 -s"
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
36 echo -e "\n\n\n\n\n"
37 echo -e "***********************************************"
38 echo -e "* Script for downloading and building of AROS *"
39 echo -e "***********************************************"
40 echo -e "\n\n"
41 echo -e "*********************************"
42 echo -e "* Step 1: install prerequisites *"
43 echo -e "*********************************"
44 echo -e "The build system needs some packages to do its job."
45 echo -e "If you are asked for a password enter you admin password."
46 echo -e "\n1 .. Get packages with apt-get for Debian and similar (e.g. Ubuntu)"
47 echo -e " for building 32-bit AROS on 32-bit Linux or 64-bit-AROS on 64-bit-Linux"
48 echo -e "2 .. As 1) but with additional packages for building 32-bit AROS"
49 echo -e " on 64-bit Linux"
50 echo -e "3 .. Get packages with yum for Fedora"
51 echo -e "4 .. Get packages with pacman for Arch"
52 echo -e "5 .. Get packages with zypper for openSuse"
53 echo -e "6 .. As 5) but with additional packages for building 32-bit AROS"
54 echo -e " on 64-bit Linux"
55 echo -e "9 .. Skip this step"
56 echo -e "0 .. Exit"
58 echo -e "\nEnter number and press <Enter>:"
60 read input
61 case "$input" in
62 1 ) echo -e "\nInstalling prerequisites with apt-get..."
63 install_pkg "apt-get install" subversion
64 install_pkg "apt-get install" git-core
65 install_pkg "apt-get install" gcc
66 install_pkg "apt-get install" g++
67 install_pkg "apt-get install" make
68 install_pkg "apt-get install" gawk
69 install_pkg "apt-get install" bison
70 install_pkg "apt-get install" flex
71 install_pkg "apt-get install" bzip2
72 install_pkg "apt-get install" netpbm
73 install_pkg "apt-get install" autoconf
74 install_pkg "apt-get install" automake
75 install_pkg "apt-get install" libx11-dev
76 install_pkg "apt-get install" libxext-dev
77 install_pkg "apt-get install" libc6-dev
78 install_pkg "apt-get install" liblzo2-dev
79 install_pkg "apt-get install" libxxf86vm-dev
80 install_pkg "apt-get install" libpng12-dev
81 install_pkg "apt-get install" gcc-multilib
82 install_pkg "apt-get install" libsdl1.2-dev
83 install_pkg "apt-get install" byacc
86 2 ) echo -e "\nInstalling prerequisites with apt-get..."
87 install_pkg "apt-get install" subversion
88 install_pkg "apt-get install" git-core
89 install_pkg "apt-get install" gcc
90 install_pkg "apt-get install" g++
91 install_pkg "apt-get install" make
92 install_pkg "apt-get install" gawk
93 install_pkg "apt-get install" bison
94 install_pkg "apt-get install" flex
95 install_pkg "apt-get install" bzip2
96 install_pkg "apt-get install" netpbm
97 install_pkg "apt-get install" autoconf
98 install_pkg "apt-get install" automake
99 install_pkg "apt-get install" libx11-dev
100 install_pkg "apt-get install" libxext-dev
101 install_pkg "apt-get install" libc6-dev
102 install_pkg "apt-get install" liblzo2-dev
103 install_pkg "apt-get install" libxxf86vm-dev
104 install_pkg "apt-get install" libpng12-dev
105 install_pkg "apt-get install" gcc-multilib
106 install_pkg "apt-get install" libsdl1.2-dev
107 install_pkg "apt-get install" byacc
109 install_pkg "apt-get install" libc6-dev-i386
110 install_pkg "apt-get install" lib32gcc1
111 install_pkg "apt-get install" ia32-libs
114 3 ) echo -e "\nInstalling prerequisites with yum..."
115 install_pkg "yum install" subversion
116 install_pkg "yum install" git-core
117 install_pkg "yum install" gcc
118 install_pkg "yum install" gawk
119 install_pkg "yum install" bison
120 install_pkg "yum install" flex
121 install_pkg "yum install" bzip2
122 install_pkg "yum install" netpbm
123 install_pkg "yum install" autoconf
124 install_pkg "yum install" automake
125 install_pkg "yum install" libX11-devel
126 install_pkg "yum install" glibc-devel
127 install_pkg "yum install" lzo-devel
130 4 ) echo -e "\nInstalling prerequisites with pacman.."
131 echo -e "\nUpdating the List of software"
132 echo -e "\nEnter sudo password"
133 sudo pacman -Sy
134 install_pkg "pacman --needed --noconfirm -S" subversion
135 install_pkg "pacman --needed --noconfirm -S" git-core
136 install_pkg "pacman --needed --noconfirm -S" gcc
137 install_pkg "pacman --needed --noconfirm -S" gawk
138 install_pkg "pacman --needed --noconfirm -S" bison
139 install_pkg "pacman --needed --noconfirm -S" flex
140 install_pkg "pacman --needed --noconfirm -S" bzip2
141 install_pkg "pacman --needed --noconfirm -S" netpbm
142 install_pkg "pacman --needed --noconfirm -S" autoconf
143 install_pkg "pacman --needed --noconfirm -S" automake
144 #it appears as though the libx11-dev,libc6-dev,liblzo2-dev is not needed on arch
147 5 ) echo -e "\nInstalling prerequisites with zypper..."
148 # tools
149 install_pkg "zypper --non-interactive install" subversion
150 install_pkg "zypper --non-interactive install" git-core
151 install_pkg "zypper --non-interactive install" gcc
152 install_pkg "zypper --non-interactive install" gcc-c++
153 install_pkg "zypper --non-interactive install" make
154 install_pkg "zypper --non-interactive install" gawk
155 install_pkg "zypper --non-interactive install" bison
156 install_pkg "zypper --non-interactive install" flex
157 install_pkg "zypper --non-interactive install" bzip2
158 install_pkg "zypper --non-interactive install" netpbm
159 install_pkg "zypper --non-interactive install" autoconf
160 install_pkg "zypper --non-interactive install" automake
161 install_pkg "zypper --non-interactive install" patch
162 install_pkg "zypper --non-interactive install" cmake
163 install_pkg "zypper --non-interactive install" gperf
164 install_pkg "zypper --non-interactive install" perl-Switch
165 install_pkg "zypper --non-interactive install" byacc
167 # libs
168 install_pkg "zypper --non-interactive install" libXxf86vm1
170 #devel
171 install_pkg "zypper --non-interactive install" libX11-devel
172 install_pkg "zypper --non-interactive install" glibc-devel
173 install_pkg "zypper --non-interactive install" libpng12-devel
176 6 ) echo -e "\nInstalling prerequisites with zypper..."
177 # tools
178 install_pkg "zypper --non-interactive install" subversion
179 install_pkg "zypper --non-interactive install" git-core
180 install_pkg "zypper --non-interactive install" gcc
181 install_pkg "zypper --non-interactive install" gcc-c++
182 install_pkg "zypper --non-interactive install" make
183 install_pkg "zypper --non-interactive install" gawk
184 install_pkg "zypper --non-interactive install" bison
185 install_pkg "zypper --non-interactive install" flex
186 install_pkg "zypper --non-interactive install" bzip2
187 install_pkg "zypper --non-interactive install" netpbm
188 install_pkg "zypper --non-interactive install" autoconf
189 install_pkg "zypper --non-interactive install" automake
190 install_pkg "zypper --non-interactive install" patch
191 install_pkg "zypper --non-interactive install" cmake
192 install_pkg "zypper --non-interactive install" gperf
193 install_pkg "zypper --non-interactive install" perl-Switch
194 install_pkg "zypper --non-interactive install" byacc
196 # libs
197 install_pkg "zypper --non-interactive install" libXxf86vm1
199 #devel
200 install_pkg "zypper --non-interactive install" libX11-devel
201 install_pkg "zypper --non-interactive install" glibc-devel
202 install_pkg "zypper --non-interactive install" libpng12-devel
204 # 32-bit support
205 install_pkg "zypper --non-interactive install" gcc-32bit
206 install_pkg "zypper --non-interactive install" gcc-c++-32bit
207 install_pkg "zypper --non-interactive install" glibc-devel-32bit
208 install_pkg "zypper --non-interactive install" libXxf86vm1-32bit
211 0 ) exit 0
213 esac
215 cd "$curdir"
217 input=""
218 until [ "$input" = "9" ]
220 echo -e "\n\n\n\n\n"
221 echo -e "***********************************************"
222 echo -e "* Step 2: get the sources from the repository *"
223 echo -e "***********************************************"
224 echo -e "\nYou can either use Subversion or Git. Git doesn't require"
225 echo -e "a password, but you'll get only read-only access."
226 echo -e "The repositories will be checked out into the current directory."
227 echo -e "\nABI V1 is the current development version which is no longer"
228 echo -e "binary compatible with V0."
229 echo -e "\nABI V1 with | ABI V0 with | ABI V1 |"
230 echo -e "Subversion | Subversion | with GIT | Content"
231 echo -e "------------+-------------+----------+--------------------------"
232 echo -e " 1 | 11 | 21 | Get AROS core (required)"
233 echo -e " 2 | 12 | 22 | Get contrib (optional)"
234 echo -e "\n 3 | 13 | 23 | Get ports source (optional, needs contrib)"
235 echo -e "\n 4 | 14 | --- | Get documentation source (optional)"
236 echo -e " 5 | 15 | --- | Get binaries (wallpapers, logos etc.) (optional)"
237 echo -e "\n9 .. Go to 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 "\nGetting AROS V1 core with Subversion...\n"
245 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
247 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
248 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
250 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
251 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
253 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
254 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
256 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
257 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
260 11 ) echo -e "\nGetting AROS V0 core with Subversion...\n"
261 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/AROS "$srcdir_v0"
263 12 ) echo -e "\nGetting contrib V0 with Subversion...\n"
264 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/contrib "$srcdir_v0/contrib"
266 13 ) echo -e "\nGetting ports V0 with Subversion...\n"
267 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/ports "$srcdir_v0/ports"
269 14 ) echo -e "\nGetting documentation V1 with Subversion...\n"
270 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/documentation "$srcdir_v0/documentation"
272 15 ) echo -e "\nGetting binaries V1 with Subversion...\n"
273 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/binaries "$srcdir_v0/binaries"
276 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
277 git clone git://repo.or.cz/AROS.git "$srcdir"
279 22 ) echo -e "\nGetting contrib V1 with Git...\n"
280 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
282 23 ) echo -e "\nGetting ports V1 with Git...\n"
283 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
286 0 ) exit 0
288 esac
289 done
291 cd "$curdir"
294 input=""
295 until [ "$input" = "9" ]
297 cd "$curdir"
299 echo -e "\n\n\n\n\n"
300 echo -e "*********************"
301 echo -e "* Step 3: configure *"
302 echo -e "*********************"
303 echo -e "\nABI V1 | ABI V0 |"
304 echo -e "-------+--------+----------------------------"
305 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
306 echo -e " 2 | 12 | linux-i386 (32-bit)"
307 echo -e " 3 | 13 | linux-x86_64 (64-bit) debug"
308 echo -e " 4 | 14 | linux-x86_64 (64-bit)"
309 echo -e " 5 | 15 | pc-i386 (32-bit)"
310 echo -e " 6 | 16 | pc-x86_64 (64-bit)"
311 echo -e "\n9 .. Go to next step"
312 echo -e "0 .. Exit"
314 echo -e "\nEnter number and press <Enter>:"
316 read input
317 case "$input" in
318 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
319 mkdir -p "$portsdir"
320 mkdir -p aros-linux-i386-dbg
321 cd aros-linux-i386-dbg
322 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir"
324 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
325 mkdir -p "$portsdir"
326 mkdir -p aros-linux-i386
327 cd aros-linux-i386
328 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir"
330 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
331 mkdir -p "$portsdir"
332 mkdir -p aros-linux-x86_64-dbg
333 cd aros-linux-x86_64-dbg
334 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir"
336 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
337 mkdir -p "$portsdir"
338 mkdir -p aros-linux-x86_64
339 cd aros-linux-x86_64
340 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir"
342 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
343 mkdir -p "$portsdir"
344 mkdir -p aros-pc-i386
345 cd aros-pc-i386
346 "../$srcdir/configure" --target=pc-i386 --with-portssources="$portsdir"
348 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
349 mkdir -p "$portsdir"
350 mkdir -p aros-pc-x86_64
351 cd aros-pc-x86_64
352 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$portsdir"
355 11 ) echo -e "\nConfiguring linux-i386 V0 with full debug...\n"
356 mkdir -p "$portsdir"
357 mkdir -p aros-linux-i386-v0-dbg
358 cd aros-linux-i386-v0-dbg
359 "../$srcdir_v0/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir"
361 12 ) echo -e "\nConfiguring linux-i386 V0 without debug...\n"
362 mkdir -p "$portsdir"
363 mkdir -p aros-linux-i386-v0
364 cd aros-linux-i386-v0
365 "../$srcdir_v0/configure" --target=linux-i386 --with-portssources="$portsdir"
367 13 ) echo -e "\nConfiguring linux-x86_64 V0 with full debug...\n"
368 mkdir -p "$portsdir"
369 mkdir -p aros-linux-x86_64-v0-dbg
370 cd aros-linux-x86_64-v0-dbg
371 "../$srcdir_v0/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir"
373 14 ) echo -e "\nConfiguring linux-x86_64 V0 without debug...\n"
374 mkdir -p "$portsdir"
375 mkdir -p aros-linux-x86_64-v0
376 cd aros-linux-x86_64-v0
377 "../$srcdir_v0/configure" --target=linux-x86_64 --with-portssources="$portsdir"
379 15 ) echo -e "\nConfiguring pc-i386 V0...\n"
380 mkdir -p "$portsdir"
381 mkdir -p aros-pc-i386-v0
382 cd aros-pc-i386-v0
383 "../$srcdir_v0/configure" --target=pc-i386 --with-portssources="$portsdir"
385 16 ) echo -e "\nConfiguring pc-x86_64 V0...\n"
386 mkdir -p "$portsdir"
387 mkdir -p aros-pc-x86_64-v0
388 cd aros-pc-x86_64-v0
389 "../$srcdir_v0/configure" --target=pc-x86_64 --with-portssources="$portsdir"
392 0 ) exit 0
394 esac
395 done
398 cd "$curdir"
400 input=""
401 until [ "$input" = "9" ]
403 cd "$curdir"
405 echo -e "\n\n\n\n\n"
406 echo -e "*****************"
407 echo -e "* Step 4: build *"
408 echo -e "*****************"
409 echo -e "\nYou can only build what you've already configured."
410 echo -e "\nABI V1 | ABI V0 |"
411 echo -e "-------+--------+----------------------------"
412 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
413 echo -e " 2 | 12 | linux-i386 (32-bit)"
414 echo -e " 3 | 13 | linux-x86_64 (64-bit) debug"
415 echo -e " 4 | 14 | linux-x86_64 (64-bit)"
416 echo -e " 5 | 15 | pc-i386 (32-bit)"
417 echo -e " 6 | 16 | pc-x86_64 (64-bit)"
418 echo -e "\n9 .. Go to next step"
419 echo -e "0 .. Exit"
420 echo -e "\nEnter number and press <Enter>:"
422 read input
423 case "$input" in
424 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
425 cd aros-linux-i386-dbg
426 make $makeopts
427 echo -e "\nIf everything went well AROS will be available"
428 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
430 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
431 cd aros-linux-i386
432 make $makeopts
433 echo -e "\nIf everything went well AROS will be available"
434 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
436 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
437 cd aros-linux-x86_64-dbg
438 make $makeopts
439 echo -e "\nIf everything went well AROS will be available"
440 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
442 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
443 cd aros-linux-x86_64
444 make $makeopts
445 echo -e "\nIf everything went well AROS will be available"
446 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
448 5 ) echo -e "\nBuilding pc-i386 V1...\n"
449 cd aros-pc-i386
450 make $makeopts
451 make $makeopts bootiso
452 echo -e "\nIf everything went well AROS will be available"
453 echo -e "in the directory aros-pc-i386/bin/<target>/AROS"
455 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
456 cd aros-pc-x86_64
457 make $makeopts
458 make $makeopts bootiso
459 echo -e "\nIf everything went well AROS will be available"
460 echo -e "in the directory aros-pc-x86_64/bin/<target>/AROS"
464 11 ) echo -e "\nBuilding linux-i386 V0 with full debug...\n"
465 cd aros-linux-i386-v0-dbg
466 make $makeopts
467 echo -e "\nIf everything went well AROS will be available"
468 echo -e "in the directory aros-linux-i386-v0-dbg/bin/<target>/AROS"
470 12 ) echo -e "\nBuilding linux-i386 V0 without debug...\n"
471 cd aros-linux-i386-v0
472 make $makeopts
473 echo -e "\nIf everything went well AROS will be available"
474 echo -e "in the directory aros-linux-i386-v0/bin/<target>/AROS"
476 13 ) echo -e "\nBuilding linux-x86_64 V0 with full debug...\n"
477 cd aros-linux-x86_64-v0-dbg
478 make $makeopts
479 echo -e "\nIf everything went well AROS will be available"
480 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
482 14 ) echo -e "\nBuilding linux-x86_64 V0 without debug...\n"
483 cd aros-linux-x86_64-v0
484 make $makeopts
485 echo -e "\nIf everything went well AROS will be available"
486 echo -e "in the directory aros-linux-x86_64-v0/bin/<target>/AROS"
488 15 ) echo -e "\nBuilding pc-i386 V0...\n"
489 cd aros-pc-i386-v0
490 make $makeopts
491 make $makeopts bootiso
492 echo -e "\nIf everything went well AROS will be available"
493 echo -e "in the directory aros-pc-i386-v0/bin/<target>/AROS"
495 16 ) echo -e "\nBuilding pc-x86_64 V0...\n"
496 cd aros-pc-x86_64-v0
497 make $makeopts
498 make $makeopts bootiso
499 echo -e "\nIf everything went well AROS will be available"
500 echo -e "in the directory aros-pc-x86_64-v0/bin/<target>/AROS"
503 0 ) exit 0
505 esac
506 done
508 cd "$curdir"
510 exit 0