Another m68k BPTR fix.
[AROS.git] / scripts / gimmearos-v1.sh
blob181f279c47adbff7513bb5cbeef103b13e3b8d2d
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-v1.sh 1.12 (08.02.2015) WIP
13 curdir="`pwd`"
14 srcdir="aros-src"
15 portsdir="$HOME/aros-ports-src"
16 tooldir="$HOME/aros-toolchain"
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 with | ABI V1 |"
228 echo -e "Subversion | with GIT | Content"
229 echo -e "------------+----------+--------------------------"
230 echo -e " 1 | 21 | Get AROS core (required)"
231 echo -e " 2 | 22 | Get contrib (optional)"
232 echo -e "\n 3 | 23 | Get ports source (optional, needs contrib)"
233 echo -e "\n 4 | --- | Get documentation source (optional)"
234 echo -e " 5 | --- | Get binaries (wallpapers, logos etc.) (optional)"
235 echo -e "\n9 .. Go to next step"
236 echo -e "0 .. Exit"
238 echo -e "\nEnter number and press <Enter>:"
240 read input
241 case "$input" in
242 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
243 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
245 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
246 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
248 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
249 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
251 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
252 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
254 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
255 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
258 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
259 git clone git://repo.or.cz/AROS.git "$srcdir"
261 22 ) echo -e "\nGetting contrib V1 with Git...\n"
262 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
264 23 ) echo -e "\nGetting ports V1 with Git...\n"
265 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
268 0 ) exit 0
270 esac
271 done
273 cd "$curdir"
275 input=""
276 until [ "$input" = "9" ]
278 cd "$curdir"
280 echo -e "\n\n\n\n\n"
281 echo -e "*******************************"
282 echo -e "* Step 3: configure toolchain *"
283 echo -e "*******************************"
284 echo -e "\n 1 | i386 (32-bit)"
285 echo -e " 2 | x86_64 (64-bit)"
286 echo -e " 3 | m68k (32-bit)"
287 echo -e " 4 | armhf (32-bit)"
288 echo -e "\n9 .. Go to next step"
289 echo -e "0 .. Exit"
291 echo -e "\nEnter number and press <Enter>:"
293 read input
294 case "$input" in
295 1 ) echo -e "\nConfiguring i386 Toolchain...\n"
296 mkdir -p "$portsdir"
297 mkdir -p aros-i386-toolchain-builddir
298 cd aros-i386-toolchain-builddir
299 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
301 2 ) echo -e "\nConfiguring x86_64 Toolchain...\n"
302 mkdir -p "$portsdir"
303 mkdir -p aros-x86_64-toolchain-builddir
304 cd aros-x86_64-toolchain-builddir
305 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
307 3 ) echo -e "\nConfiguring m68k Toolchain...\n"
308 mkdir -p "$portsdir"
309 mkdir -p aros-m68k-toolchain-builddir
310 cd aros-m68k-toolchain-builddir
311 "../$srcdir/configure" --target=amiga-m68k --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
313 4 ) echo -e "\nConfiguring armhf Toolchain...\n"
314 mkdir -p "$portsdir"
315 mkdir -p aros-armhf-toolchain-builddir
316 cd aros-armhf-toolchain-builddir
317 "../$srcdir/configure" --target=raspi-armhf --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
320 0 ) exit 0
322 esac
323 done
326 cd "$curdir"
328 input=""
329 until [ "$input" = "9" ]
331 cd "$curdir"
333 echo -e "\n\n\n\n\n"
334 echo -e "***************************"
335 echo -e "* Step 4: build toolchain *"
336 echo -e "***************************"
337 echo -e "\nYou can only build what you've already configured."
338 echo -e "\n 1 | i386 (32-bit)"
339 echo -e " 2 | x86_64 (64-bit)"
340 echo -e " 3 | m68k (32-bit)"
341 echo -e " 4 | armhf (32-bit)"
342 echo -e "\n9 .. Go to next step"
343 echo -e "0 .. Exit"
344 echo -e "\nEnter number and press <Enter>:"
346 read input
347 case "$input" in
348 1 ) echo -e "\nBuilding i386 Toolchain...\n"
349 cd aros-i386-toolchain-builddir
350 make $makeopts crosstools
351 cd "$curdir"
352 rm -rf aros-i386-toolchain-builddir
354 2 ) echo -e "\nBuilding x86_64 Toolchain...\n"
355 cd aros-x86_64-toolchain-builddir
356 make $makeopts crosstools
357 cd "$curdir"
358 rm -rf aros-x86_64-toolchain-builddir
360 3 ) echo -e "\nBuilding m68k Toolchain...\n"
361 cd aros-m68k-toolchain-builddir
362 make $makeopts crosstools
363 cd "$curdir"
364 rm -rf aros-m68k-toolchain-builddir
366 4 ) echo -e "\nBuilding armhf Toolchain...\n"
367 cd aros-armhf-toolchain-builddir
368 make $makeopts crosstools
369 cd "$curdir"
370 rm -rf aros-armhf-toolchain-builddir
373 0 ) exit 0
375 esac
376 done
379 cd "$curdir"
381 input=""
382 until [ "$input" = "9" ]
384 cd "$curdir"
386 echo -e "\n\n\n\n\n"
387 echo -e "**************************"
388 echo -e "* Step 5: configure AROS *"
389 echo -e "**************************"
390 echo -e "\n 1 | linux-i386 (32-bit) debug"
391 echo -e " 2 | linux-i386 (32-bit)"
392 echo -e " 3 | linux-x86_64 (64-bit) debug"
393 echo -e " 4 | linux-x86_64 (64-bit)"
394 echo -e " 5 | pc-i386 (32-bit)"
395 echo -e " 6 | pc-x86_64 (64-bit)"
396 echo -e " 7 | amiga-m68k (32-bit)"
397 echo -e " 8 | raspi-armhf (32-bit)"
398 echo -e "\n9 .. Go to next step"
399 echo -e "0 .. Exit"
401 echo -e "\nEnter number and press <Enter>:"
403 read input
404 case "$input" in
405 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
406 mkdir -p "$portsdir"
407 mkdir -p aros-linux-i386-dbg
408 cd aros-linux-i386-dbg
409 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
411 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
412 mkdir -p "$portsdir"
413 mkdir -p aros-linux-i386
414 cd aros-linux-i386
415 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
417 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
418 mkdir -p "$portsdir"
419 mkdir -p aros-linux-x86_64-dbg
420 cd aros-linux-x86_64-dbg
421 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
423 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
424 mkdir -p "$portsdir"
425 mkdir -p aros-linux-x86_64
426 cd aros-linux-x86_64
427 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
429 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
430 mkdir -p "$portsdir"
431 mkdir -p aros-pc-i386
432 cd aros-pc-i386
433 "../$srcdir/configure" --target=pc-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
435 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
436 mkdir -p "$portsdir"
437 mkdir -p aros-pc-x86_64
438 cd aros-pc-x86_64
439 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
441 7 ) echo -e "\nConfiguring amiga-m68k V1...\n"
442 mkdir -p "$portsdir"
443 mkdir -p aros-amiga-m68k
444 cd aros-amiga-m68k
445 "../$srcdir/configure" --target=amiga-m68k --with-serial-debug=yes --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
447 8 ) echo -e "\nConfiguring raspi-armhf V1...\n"
448 mkdir -p "$portsdir"
449 mkdir -p aros-raspi-armhf
450 cd aros-raspi-armhf
451 "../$srcdir/configure" --target=raspi-armhf --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
454 0 ) exit 0
456 esac
457 done
460 cd "$curdir"
462 input=""
463 until [ "$input" = "9" ]
465 cd "$curdir"
467 echo -e "\n\n\n\n\n"
468 echo -e "*****************"
469 echo -e "* Step 6: build *"
470 echo -e "*****************"
471 echo -e "\nYou can only build what you've already configured."
472 echo -e "\n 1 | linux-i386 (32-bit) debug"
473 echo -e " 2 | linux-i386 (32-bit)"
474 echo -e " 3 | linux-x86_64 (64-bit) debug"
475 echo -e " 4 | linux-x86_64 (64-bit)"
476 echo -e " 5 | pc-i386 (32-bit)"
477 echo -e " 6 | pc-x86_64 (64-bit)"
478 echo -e " 7 | amiga-m68k (32-bit)"
479 echo -e " 8 | raspi-armhf (32-bit)"
480 echo -e "\n9 .. Go to next step"
481 echo -e "0 .. Exit"
482 echo -e "\nEnter number and press <Enter>:"
484 read input
485 case "$input" in
486 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
487 cd aros-linux-i386-dbg
488 make $makeopts
489 make $makeopts contrib
490 make $makeopts ports
491 echo -e "\nIf everything went well AROS will be available"
492 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
494 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
495 cd aros-linux-i386
496 make $makeopts
497 make $makeopts contrib
498 make $makeopts ports
499 echo -e "\nIf everything went well AROS will be available"
500 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
502 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
503 cd aros-linux-x86_64-dbg
504 make $makeopts
505 make $makeopts contrib
506 make $makeopts ports
507 echo -e "\nIf everything went well AROS will be available"
508 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
510 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
511 cd aros-linux-x86_64
512 make $makeopts
513 make $makeopts contrib
514 make $makeopts ports
515 echo -e "\nIf everything went well AROS will be available"
516 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
518 5 ) echo -e "\nBuilding pc-i386 V1...\n"
519 cd aros-pc-i386
520 make $makeopts
521 make $makeopts contrib
522 make $makeopts ports
523 make $makeopts distfiles
524 echo -e "\nIf everything went well AROS will be available"
525 echo -e "in the directory aros-pc-i386/bin/<target>/AROS"
527 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
528 cd aros-pc-x86_64
529 make $makeopts
530 make $makeopts contrib
531 make $makeopts ports
532 make $makeopts distfiles
533 echo -e "\nIf everything went well AROS will be available"
534 echo -e "in the directory aros-pc-x86_64/bin/<target>/AROS"
536 7 ) echo -e "\nBuilding amiga-m68k V1...\n"
537 cd aros-amiga-m68k
538 make $makeopts
539 make $makeopts contrib
540 make $makeopts ports
541 make $makeopts distfiles
542 echo -e "\nIf everything went well AROS will be available"
543 echo -e "in the directory aros-amiga-m68k/distfiles"
545 8 ) echo -e "\nBuilding raspi-armhf V1...\n"
546 cd aros-raspi-armhf
547 make $makeopts
548 make $makeopts contrib
549 make $makeopts ports
550 make $makeopts distfiles
551 echo -e "\nIf everything went well AROS will be available"
552 echo -e "in the directory aros-raspi-armhf/distfiles"
555 0 ) exit 0
557 esac
558 done
560 cd "$curdir"
562 exit 0