revert previous incorrect version of commit and recommit correct version to allow...
[AROS.git] / scripts / gimmearos.sh
blobdb5e857709ac55ff3a842e4e63acf64e4892a042
1 #!/bin/bash
3 # Script for building AROS from the Subversion or GIT 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.14 (25.04.2019)
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" libpng-dev
81 install_pkg "apt-get install" libsdl1.2-dev
82 install_pkg "apt-get install" byacc
83 install_pkg "apt-get install" python-mako
84 install_pkg "apt-get install" libxcursor-dev
87 2 ) echo -e "\nInstalling prerequisites with apt-get..."
88 install_pkg "apt-get install" subversion
89 install_pkg "apt-get install" git-core
90 install_pkg "apt-get install" gcc
91 install_pkg "apt-get install" g++
92 install_pkg "apt-get install" make
93 install_pkg "apt-get install" gawk
94 install_pkg "apt-get install" bison
95 install_pkg "apt-get install" flex
96 install_pkg "apt-get install" bzip2
97 install_pkg "apt-get install" netpbm
98 install_pkg "apt-get install" autoconf
99 install_pkg "apt-get install" automake
100 install_pkg "apt-get install" libx11-dev
101 install_pkg "apt-get install" libxext-dev
102 install_pkg "apt-get install" libc6-dev
103 install_pkg "apt-get install" liblzo2-dev
104 install_pkg "apt-get install" libxxf86vm-dev
105 install_pkg "apt-get install" libpng-dev
106 install_pkg "apt-get install" gcc-multilib
107 install_pkg "apt-get install" libsdl1.2-dev
108 install_pkg "apt-get install" byacc
109 install_pkg "apt-get install" python-mako
110 install_pkg "apt-get install" libxcursor-dev
112 install_pkg "apt-get install" libc6-dev-i386
113 install_pkg "apt-get install" lib32gcc1
114 install_pkg "apt-get install" ia32-libs
117 3 ) echo -e "\nInstalling prerequisites with yum..."
118 install_pkg "yum install" subversion
119 install_pkg "yum install" git-core
120 install_pkg "yum install" gcc
121 install_pkg "yum install" gawk
122 install_pkg "yum install" bison
123 install_pkg "yum install" flex
124 install_pkg "yum install" bzip2
125 install_pkg "yum install" netpbm
126 install_pkg "yum install" autoconf
127 install_pkg "yum install" automake
128 install_pkg "yum install" libX11-devel
129 install_pkg "yum install" glibc-devel
130 install_pkg "yum install" lzo-devel
133 4 ) echo -e "\nInstalling prerequisites with pacman.."
134 echo -e "\nUpdating the List of software"
135 echo -e "\nEnter sudo password"
136 sudo pacman -Sy
137 install_pkg "pacman --needed --noconfirm -S" subversion
138 install_pkg "pacman --needed --noconfirm -S" git-core
139 install_pkg "pacman --needed --noconfirm -S" gcc
140 install_pkg "pacman --needed --noconfirm -S" gawk
141 install_pkg "pacman --needed --noconfirm -S" bison
142 install_pkg "pacman --needed --noconfirm -S" flex
143 install_pkg "pacman --needed --noconfirm -S" bzip2
144 install_pkg "pacman --needed --noconfirm -S" netpbm
145 install_pkg "pacman --needed --noconfirm -S" autoconf
146 install_pkg "pacman --needed --noconfirm -S" automake
147 #it appears as though the libx11-dev,libc6-dev,liblzo2-dev is not needed on arch
150 5 ) echo -e "\nInstalling prerequisites with zypper..."
151 # tools
152 install_pkg "zypper --non-interactive install" subversion
153 install_pkg "zypper --non-interactive install" git-core
154 install_pkg "zypper --non-interactive install" gcc
155 install_pkg "zypper --non-interactive install" gcc-c++
156 install_pkg "zypper --non-interactive install" make
157 install_pkg "zypper --non-interactive install" gawk
158 install_pkg "zypper --non-interactive install" bison
159 install_pkg "zypper --non-interactive install" flex
160 install_pkg "zypper --non-interactive install" bzip2
161 install_pkg "zypper --non-interactive install" netpbm
162 install_pkg "zypper --non-interactive install" autoconf
163 install_pkg "zypper --non-interactive install" automake
164 install_pkg "zypper --non-interactive install" patch
165 install_pkg "zypper --non-interactive install" cmake
166 install_pkg "zypper --non-interactive install" gperf
167 install_pkg "zypper --non-interactive install" perl-Switch
168 install_pkg "zypper --non-interactive install" byacc
170 # libs
171 install_pkg "zypper --non-interactive install" libXxf86vm1
173 #devel
174 install_pkg "zypper --non-interactive install" libX11-devel
175 install_pkg "zypper --non-interactive install" glibc-devel
176 install_pkg "zypper --non-interactive install" libpng12-devel
179 6 ) echo -e "\nInstalling prerequisites with zypper..."
180 # tools
181 install_pkg "zypper --non-interactive install" subversion
182 install_pkg "zypper --non-interactive install" git-core
183 install_pkg "zypper --non-interactive install" gcc
184 install_pkg "zypper --non-interactive install" gcc-c++
185 install_pkg "zypper --non-interactive install" make
186 install_pkg "zypper --non-interactive install" gawk
187 install_pkg "zypper --non-interactive install" bison
188 install_pkg "zypper --non-interactive install" flex
189 install_pkg "zypper --non-interactive install" bzip2
190 install_pkg "zypper --non-interactive install" netpbm
191 install_pkg "zypper --non-interactive install" autoconf
192 install_pkg "zypper --non-interactive install" automake
193 install_pkg "zypper --non-interactive install" patch
194 install_pkg "zypper --non-interactive install" cmake
195 install_pkg "zypper --non-interactive install" gperf
196 install_pkg "zypper --non-interactive install" perl-Switch
197 install_pkg "zypper --non-interactive install" byacc
199 # libs
200 install_pkg "zypper --non-interactive install" libXxf86vm1
202 #devel
203 install_pkg "zypper --non-interactive install" libX11-devel
204 install_pkg "zypper --non-interactive install" glibc-devel
205 install_pkg "zypper --non-interactive install" libpng12-devel
207 # 32-bit support
208 install_pkg "zypper --non-interactive install" gcc-32bit
209 install_pkg "zypper --non-interactive install" gcc-c++-32bit
210 install_pkg "zypper --non-interactive install" glibc-devel-32bit
211 install_pkg "zypper --non-interactive install" libXxf86vm1-32bit
214 0 ) exit 0
216 esac
218 cd "$curdir"
220 input=""
221 until [ "$input" = "9" ]
223 echo -e "\n\n\n\n\n"
224 echo -e "***********************************************"
225 echo -e "* Step 2: get the sources from the repository *"
226 echo -e "***********************************************"
227 echo -e "\nYou can either use Subversion or Git. Git doesn't require"
228 echo -e "a password, but you'll get only read-only access."
229 echo -e "The repositories will be checked out into the current directory."
230 echo -e "\nABI V1 is the current development version which is no longer"
231 echo -e "binary compatible with V0."
232 echo -e "\nABI V1 with | ABI V0 with | ABI V1 |"
233 echo -e "Subversion | Subversion | with GIT | Content"
234 echo -e "------------+-------------+----------+--------------------------"
235 echo -e " 1 | 11 | 21 | Get AROS core (required)"
236 echo -e " 2 | 12 | 22 | Get contrib (optional)"
237 echo -e "\n 3 | 13 | 23 | Get ports source (optional, needs contrib)"
238 echo -e "\n 4 | 14 | --- | Get documentation source (optional)"
239 echo -e " 5 | 15 | --- | Get binaries (wallpapers, logos etc.) (optional)"
240 echo -e "\n9 .. Go to next step"
241 echo -e "0 .. Exit"
243 echo -e "\nEnter number and press <Enter>:"
245 read input
246 case "$input" in
247 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
248 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
250 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
251 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
253 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
254 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
256 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
257 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
259 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
260 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
263 11 ) echo -e "\nGetting AROS V0 core with Subversion...\n"
264 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/AROS "$srcdir_v0"
266 12 ) echo -e "\nGetting contrib V0 with Subversion...\n"
267 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/contrib "$srcdir_v0/contrib"
269 13 ) echo -e "\nGetting ports V0 with Subversion...\n"
270 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/ports "$srcdir_v0/ports"
272 14 ) echo -e "\nGetting documentation V1 with Subversion...\n"
273 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/documentation "$srcdir_v0/documentation"
275 15 ) echo -e "\nGetting binaries V1 with Subversion...\n"
276 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/binaries "$srcdir_v0/binaries"
279 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
280 git clone git://repo.or.cz/AROS.git "$srcdir"
282 22 ) echo -e "\nGetting contrib V1 with Git...\n"
283 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
285 23 ) echo -e "\nGetting ports V1 with Git...\n"
286 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
289 0 ) exit 0
291 esac
292 done
294 cd "$curdir"
297 input=""
298 until [ "$input" = "9" ]
300 cd "$curdir"
302 echo -e "\n\n\n\n\n"
303 echo -e "*********************"
304 echo -e "* Step 3: configure *"
305 echo -e "*********************"
306 echo -e "\nABI V1 | ABI V0 |"
307 echo -e "-------+--------+----------------------------"
308 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
309 echo -e " 2 | 12 | linux-i386 (32-bit)"
310 echo -e " 3 | | linux-x86_64 (64-bit) debug"
311 echo -e " 4 | | linux-x86_64 (64-bit)"
312 echo -e " 5 | 15 | pc-i386 (32-bit)"
313 echo -e " 6 | | pc-x86_64 (64-bit)"
314 echo -e " 7 | | amiga-m68k (32-bit)"
315 echo -e " 8 | | raspi-armhf (32-bit)"
316 echo -e "\n9 .. Go to next step"
317 echo -e "0 .. Exit"
319 echo -e "\nEnter number and press <Enter>:"
321 read input
322 case "$input" in
323 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
324 mkdir -p "$portsdir"
325 mkdir -p aros-linux-i386-dbg
326 cd aros-linux-i386-dbg
327 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir"
329 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
330 mkdir -p "$portsdir"
331 mkdir -p aros-linux-i386
332 cd aros-linux-i386
333 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir"
335 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
336 mkdir -p "$portsdir"
337 mkdir -p aros-linux-x86_64-dbg
338 cd aros-linux-x86_64-dbg
339 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir"
341 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
342 mkdir -p "$portsdir"
343 mkdir -p aros-linux-x86_64
344 cd aros-linux-x86_64
345 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir"
347 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
348 mkdir -p "$portsdir"
349 mkdir -p aros-pc-i386
350 cd aros-pc-i386
351 "../$srcdir/configure" --target=pc-i386 --with-portssources="$portsdir"
353 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
354 mkdir -p "$portsdir"
355 mkdir -p aros-pc-x86_64
356 cd aros-pc-x86_64
357 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$portsdir"
359 7 ) echo -e "\nConfiguring amiga-m68k V1...\n"
360 mkdir -p "$portsdir"
361 mkdir -p aros-amiga-m68k
362 cd aros-amiga-m68k
363 "../$srcdir/configure" --target=amiga-m68k --with-serial-debug=yes --with-portssources="$portsdir"
365 8 ) echo -e "\nConfiguring raspi-armhf V1...\n"
366 mkdir -p "$portsdir"
367 mkdir -p aros-raspi-armhf
368 cd aros-raspi-armhf
369 "../$srcdir/configure" --target=raspi-armhf --with-portssources="$portsdir"
372 11 ) echo -e "\nConfiguring linux-i386 V0 with full debug...\n"
373 mkdir -p "$portsdir"
374 mkdir -p aros-linux-i386-v0-dbg
375 cd aros-linux-i386-v0-dbg
376 "../$srcdir_v0/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir"
378 12 ) echo -e "\nConfiguring linux-i386 V0 without debug...\n"
379 mkdir -p "$portsdir"
380 mkdir -p aros-linux-i386-v0
381 cd aros-linux-i386-v0
382 "../$srcdir_v0/configure" --target=linux-i386 --with-portssources="$portsdir"
384 15 ) echo -e "\nConfiguring pc-i386 V0...\n"
385 mkdir -p "$portsdir"
386 mkdir -p aros-pc-i386-v0
387 cd aros-pc-i386-v0
388 "../$srcdir_v0/configure" --target=pc-i386 --with-portssources="$portsdir"
391 0 ) exit 0
393 esac
394 done
397 cd "$curdir"
399 input=""
400 until [ "$input" = "9" ]
402 cd "$curdir"
404 echo -e "\n\n\n\n\n"
405 echo -e "*****************"
406 echo -e "* Step 4: build *"
407 echo -e "*****************"
408 echo -e "\nYou can only build what you've already configured."
409 echo -e "\nABI V1 | ABI V0 |"
410 echo -e "-------+--------+----------------------------"
411 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
412 echo -e " 2 | 12 | linux-i386 (32-bit)"
413 echo -e " 3 | | linux-x86_64 (64-bit) debug"
414 echo -e " 4 | | linux-x86_64 (64-bit)"
415 echo -e " 5 | 15 | pc-i386 (32-bit)"
416 echo -e " 6 | | pc-x86_64 (64-bit)"
417 echo -e " 7 | | amiga-m68k (32-bit)"
418 echo -e " 8 | | raspi-armhf (32-bit)"
419 echo -e "\n9 .. Go to next step"
420 echo -e "0 .. Exit"
421 echo -e "\nEnter number and press <Enter>:"
423 read input
424 case "$input" in
425 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
426 cd aros-linux-i386-dbg
427 make $makeopts
428 make $makeopts contrib
429 make $makeopts ports
430 echo -e "\nIf everything went well AROS will be available"
431 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
433 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
434 cd aros-linux-i386
435 make $makeopts
436 make $makeopts contrib
437 make $makeopts ports
438 echo -e "\nIf everything went well AROS will be available"
439 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
441 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
442 cd aros-linux-x86_64-dbg
443 make $makeopts
444 make $makeopts contrib
445 make $makeopts ports
446 echo -e "\nIf everything went well AROS will be available"
447 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
449 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
450 cd aros-linux-x86_64
451 make $makeopts
452 make $makeopts contrib
453 make $makeopts ports
454 echo -e "\nIf everything went well AROS will be available"
455 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
457 5 ) echo -e "\nBuilding pc-i386 V1...\n"
458 cd aros-pc-i386
459 make $makeopts
460 make $makeopts contrib
461 make $makeopts ports
462 make $makeopts distfiles
463 echo -e "\nIf everything went well AROS will be available"
464 echo -e "in the directory aros-pc-i386/distfiles"
466 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
467 cd aros-pc-x86_64
468 make $makeopts
469 make $makeopts contrib
470 make $makeopts ports
471 make $makeopts distfiles
472 echo -e "\nIf everything went well AROS will be available"
473 echo -e "in the directory aros-pc-x86_64/distfiles"
475 7 ) echo -e "\nBuilding amiga-m68k V1...\n"
476 cd aros-amiga-m68k
477 make $makeopts
478 make $makeopts contrib
479 make $makeopts ports
480 make $makeopts distfiles
481 echo -e "\nIf everything went well AROS will be available"
482 echo -e "in the directory aros-amiga-m68k/distfiles"
484 8 ) echo -e "\nBuilding raspi-armhf V1...\n"
485 cd aros-raspi-armhf
486 make $makeopts
487 make $makeopts contrib
488 make $makeopts ports
489 make $makeopts distfiles
490 echo -e "\nIf everything went well AROS will be available"
491 echo -e "in the directory aros-raspi-armhf/distfiles"
494 11 ) echo -e "\nBuilding linux-i386 V0 with full debug...\n"
495 cd aros-linux-i386-v0-dbg
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-v0-dbg/bin/<target>/AROS"
502 12 ) echo -e "\nBuilding linux-i386 V0 without debug...\n"
503 cd aros-linux-i386-v0
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-i386-v0/bin/<target>/AROS"
510 15 ) echo -e "\nBuilding pc-i386 V0...\n"
511 cd aros-pc-i386-v0
512 make $makeopts
513 make $makeopts contrib
514 make $makeopts ports
515 make $makeopts distfiles
516 echo -e "\nIf everything went well AROS will be available"
517 echo -e "in the directory aros-pc-i386-v0/distfiles"
520 0 ) exit 0
522 esac
523 done
525 cd "$curdir"
527 exit 0