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.13 (03.09.2017)
15 portsdir
="$HOME/aros-ports-src"
16 tooldir
="$HOME/aros-toolchain"
18 configopts
="--with-binutils-version=2.25 --with-gcc-version=6.3.0 --disable-sdl-hidd --with-portssources="$portsdir""
24 echo "install_pkg() needs 2 arguments"
27 echo -e "\nInstalling " $2
31 echo -e "\n install failed. Script cancelled."
38 echo -e "***********************************************"
39 echo -e "* Script for downloading and building of AROS *"
40 echo -e "***********************************************"
42 echo -e "*********************************"
43 echo -e "* Step 1: install prerequisites *"
44 echo -e "*********************************"
45 echo -e "The build system needs some packages to do its job."
46 echo -e "If you are asked for a password enter you admin password."
47 echo -e "\n1 .. Get packages with apt-get for Debian and similar (e.g. Ubuntu)"
48 echo -e " for building 32-bit AROS on 32-bit Linux or 64-bit-AROS on 64-bit-Linux"
49 echo -e "2 .. As 1) but with additional packages for building 32-bit AROS"
50 echo -e " on 64-bit Linux"
51 echo -e "3 .. Get packages with yum for Fedora"
52 echo -e "4 .. Get packages with pacman for Arch"
53 echo -e "5 .. Get packages with zypper for openSuse"
54 echo -e "6 .. As 5) but with additional packages for building 32-bit AROS"
55 echo -e " on 64-bit Linux"
56 echo -e "99 ..Skip this step"
59 echo -e "\nEnter number and press <Enter>:"
63 1 ) echo -e "\nInstalling prerequisites with apt-get..."
64 install_pkg
"apt-get install" subversion
65 install_pkg
"apt-get install" git-core
66 install_pkg
"apt-get install" gcc
67 install_pkg
"apt-get install" g
++
68 install_pkg
"apt-get install" make
69 install_pkg
"apt-get install" gawk
70 install_pkg
"apt-get install" bison
71 install_pkg
"apt-get install" flex
72 install_pkg
"apt-get install" bzip2
73 install_pkg
"apt-get install" netpbm
74 install_pkg
"apt-get install" autoconf
75 install_pkg
"apt-get install" automake
76 install_pkg
"apt-get install" libx11-dev
77 install_pkg
"apt-get install" libxext-dev
78 install_pkg
"apt-get install" libc6-dev
79 install_pkg
"apt-get install" liblzo2-dev
80 install_pkg
"apt-get install" libxxf86vm-dev
81 install_pkg
"apt-get install" libpng-dev
82 install_pkg
"apt-get install" gcc-multilib
83 install_pkg
"apt-get install" libsdl1.2
-dev
84 install_pkg
"apt-get install" byacc
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
110 install_pkg
"apt-get install" libc6-dev-i386
111 install_pkg
"apt-get install" lib32gcc1
112 install_pkg
"apt-get install" ia32-libs
115 3 ) echo -e "\nInstalling prerequisites with yum..."
116 install_pkg
"yum install" subversion
117 install_pkg
"yum install" git-core
118 install_pkg
"yum install" gcc
119 install_pkg
"yum install" gawk
120 install_pkg
"yum install" bison
121 install_pkg
"yum install" flex
122 install_pkg
"yum install" bzip2
123 install_pkg
"yum install" netpbm
124 install_pkg
"yum install" autoconf
125 install_pkg
"yum install" automake
126 install_pkg
"yum install" libX11-devel
127 install_pkg
"yum install" glibc-devel
128 install_pkg
"yum install" lzo-devel
131 4 ) echo -e "\nInstalling prerequisites with pacman.."
132 echo -e "\nUpdating the List of software"
133 echo -e "\nEnter sudo password"
135 install_pkg
"pacman --needed --noconfirm -S" subversion
136 install_pkg
"pacman --needed --noconfirm -S" git-core
137 install_pkg
"pacman --needed --noconfirm -S" gcc
138 install_pkg
"pacman --needed --noconfirm -S" gawk
139 install_pkg
"pacman --needed --noconfirm -S" bison
140 install_pkg
"pacman --needed --noconfirm -S" flex
141 install_pkg
"pacman --needed --noconfirm -S" bzip2
142 install_pkg
"pacman --needed --noconfirm -S" netpbm
143 install_pkg
"pacman --needed --noconfirm -S" autoconf
144 install_pkg
"pacman --needed --noconfirm -S" automake
145 #it appears as though the libx11-dev,libc6-dev,liblzo2-dev is not needed on arch
148 5 ) echo -e "\nInstalling prerequisites with zypper..."
150 install_pkg
"zypper --non-interactive install" subversion
151 install_pkg
"zypper --non-interactive install" git-core
152 install_pkg
"zypper --non-interactive install" gcc
153 install_pkg
"zypper --non-interactive install" gcc-c
++
154 install_pkg
"zypper --non-interactive install" make
155 install_pkg
"zypper --non-interactive install" gawk
156 install_pkg
"zypper --non-interactive install" bison
157 install_pkg
"zypper --non-interactive install" flex
158 install_pkg
"zypper --non-interactive install" bzip2
159 install_pkg
"zypper --non-interactive install" netpbm
160 install_pkg
"zypper --non-interactive install" autoconf
161 install_pkg
"zypper --non-interactive install" automake
162 install_pkg
"zypper --non-interactive install" patch
163 install_pkg
"zypper --non-interactive install" cmake
164 install_pkg
"zypper --non-interactive install" gperf
165 install_pkg
"zypper --non-interactive install" perl-Switch
166 install_pkg
"zypper --non-interactive install" byacc
169 install_pkg
"zypper --non-interactive install" libXxf86vm1
170 install_pkg
"zypper --non-interactive install" alsa-plugins-pulse
173 install_pkg
"zypper --non-interactive install" libX11-devel
174 install_pkg
"zypper --non-interactive install" glibc-devel
175 install_pkg
"zypper --non-interactive install" libpng12-devel
176 install_pkg
"zypper --non-interactive install" alsa-devel
179 6 ) echo -e "\nInstalling prerequisites with zypper..."
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
200 install_pkg
"zypper --non-interactive install" libXxf86vm1
201 install_pkg
"zypper --non-interactive install" alsa-plugins-pulse
204 install_pkg
"zypper --non-interactive install" libX11-devel
205 install_pkg
"zypper --non-interactive install" glibc-devel
206 install_pkg
"zypper --non-interactive install" libpng12-devel
209 install_pkg
"zypper --non-interactive install" gcc-32bit
210 install_pkg
"zypper --non-interactive install" gcc-c
++-32bit
211 install_pkg
"zypper --non-interactive install" glibc-devel-32bit
212 install_pkg
"zypper --non-interactive install" libXxf86vm1-32bit
213 install_pkg
"zypper --non-interactive install" alsa-plugins-pulse-32bit
214 install_pkg
"zypper --non-interactive install" alsa-devel-32bit
224 until [ "$input" = "99" ]
227 echo -e "***********************************************"
228 echo -e "* Step 2: get the sources from the repository *"
229 echo -e "***********************************************"
230 echo -e "\nYou can either use Subversion or Git. Git doesn't require"
231 echo -e "a password, but you'll get only read-only access."
232 echo -e "The repositories will be checked out into the current directory."
233 echo -e "\nABI V1 with | ABI V1 |"
234 echo -e "Subversion | with GIT | Content"
235 echo -e "------------+----------+--------------------------"
236 echo -e " 1 | 21 | Get AROS core (required)"
237 echo -e " 2 | 22 | Get contrib (optional)"
238 echo -e "\n 3 | 23 | Get ports source (optional, needs contrib)"
239 echo -e "\n 4 | --- | Get documentation source (optional)"
240 echo -e " 5 | --- | Get binaries (wallpapers, logos etc.) (optional)"
241 echo -e "\n99 .. Go to next step"
244 echo -e "\nEnter number and press <Enter>:"
248 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
249 svn checkout https
://svn.aros.org
/svn
/aros
/trunk
/AROS
"$srcdir"
251 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
252 svn checkout https
://svn.aros.org
/svn
/aros
/trunk
/contrib
"$srcdir/contrib"
254 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
255 svn checkout https
://svn.aros.org
/svn
/aros
/trunk
/ports
"$srcdir/ports"
257 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
258 svn checkout https
://svn.aros.org
/svn
/aros
/trunk
/documentation
"$srcdir/documentation"
260 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
261 svn checkout https
://svn.aros.org
/svn
/aros
/trunk
/binaries
"$srcdir/binaries"
264 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
265 git clone git
://repo.or.cz
/AROS.git
"$srcdir"
267 22 ) echo -e "\nGetting contrib V1 with Git...\n"
268 git clone git
://repo.or.cz
/AROS-Contrib.git
"$srcdir/contrib"
270 23 ) echo -e "\nGetting ports V1 with Git...\n"
271 git clone git
://repo.or.cz
/AROS-Ports.git
"$srcdir/ports"
282 until [ "$input" = "99" ]
287 echo -e "*******************************"
288 echo -e "* Step 3: configure toolchain *"
289 echo -e "*******************************"
290 echo -e "\n 1 | i386 (32-bit)"
291 echo -e " 2 | x86_64 (64-bit)"
292 echo -e " 3 | m68k (32-bit)"
293 echo -e " 4 | armhf (32-bit)"
294 echo -e "\n99 .. Go to next step"
297 echo -e "\nEnter number and press <Enter>:"
301 1 ) echo -e "\nConfiguring i386 Toolchain...\n"
303 mkdir
-p aros-i386-toolchain-builddir
304 cd aros-i386-toolchain-builddir
305 "../$srcdir/configure" $configopts --target=linux-i386
--with-aros-toolchain-install="$tooldir"-i386
307 2 ) echo -e "\nConfiguring x86_64 Toolchain...\n"
309 mkdir
-p aros-x86_64-toolchain-builddir
310 cd aros-x86_64-toolchain-builddir
311 "../$srcdir/configure" $configopts --target=linux-x86_64
--with-aros-toolchain-install="$tooldir"-x86_64
313 3 ) echo -e "\nConfiguring m68k Toolchain...\n"
315 mkdir
-p aros-m68k-toolchain-builddir
316 cd aros-m68k-toolchain-builddir
317 "../$srcdir/configure" $configopts --target=amiga-m68k
--with-aros-toolchain-install="$tooldir"-m68k
319 4 ) echo -e "\nConfiguring armhf Toolchain...\n"
321 mkdir
-p aros-armhf-toolchain-builddir
322 cd aros-armhf-toolchain-builddir
323 "../$srcdir/configure" $configopts --target=raspi-armhf
--with-aros-toolchain-install="$tooldir"-armhf
335 until [ "$input" = "99" ]
340 echo -e "***************************"
341 echo -e "* Step 4: build toolchain *"
342 echo -e "***************************"
343 echo -e "\nYou can only build what you've already configured."
344 echo -e "\n 1 | i386 (32-bit)"
345 echo -e " 2 | x86_64 (64-bit)"
346 echo -e " 3 | m68k (32-bit)"
347 echo -e " 4 | armhf (32-bit)"
348 echo -e "\n9 .. Go to next step"
350 echo -e "\nEnter number and press <Enter>:"
354 1 ) echo -e "\nBuilding i386 Toolchain...\n"
355 cd aros-i386-toolchain-builddir
356 make $makeopts crosstools
358 rm -rf aros-i386-toolchain-builddir
360 2 ) echo -e "\nBuilding x86_64 Toolchain...\n"
361 cd aros-x86_64-toolchain-builddir
362 make $makeopts crosstools
364 rm -rf aros-x86_64-toolchain-builddir
366 3 ) echo -e "\nBuilding m68k Toolchain...\n"
367 cd aros-m68k-toolchain-builddir
368 make $makeopts crosstools
370 rm -rf aros-m68k-toolchain-builddir
372 4 ) echo -e "\nBuilding armhf Toolchain...\n"
373 cd aros-armhf-toolchain-builddir
374 make $makeopts crosstools
376 rm -rf aros-armhf-toolchain-builddir
388 until [ "$input" = "99" ]
393 echo -e "**************************"
394 echo -e "* Step 5: configure AROS *"
395 echo -e "**************************"
396 echo -e "\n 1 | linux-i386 (32-bit) debug"
397 echo -e " 2 | linux-i386 (32-bit)"
398 echo -e " 3 | linux-x86_64 (64-bit) debug"
399 echo -e " 4 | linux-x86_64 (64-bit)"
400 echo -e " 5 | pc-i386 (32-bit)"
401 echo -e " 6 | pc-x86_64 (64-bit)"
402 echo -e " 7 | pc-x86_64 SMP (64-bit)"
403 echo -e " 8 | amiga-m68k (32-bit)"
404 echo -e " 9 | raspi-armhf (32-bit)"
405 echo -e "\n99 .. Go to next step"
408 echo -e "\nEnter number and press <Enter>:"
412 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
414 mkdir
-p aros-linux-i386-dbg
415 cd aros-linux-i386-dbg
416 "../$srcdir/configure" $configopts --target=linux-i386
--enable-debug --with-aros-toolchain-install="$tooldir"-i386 --with-aros-toolchain=yes
418 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
420 mkdir
-p aros-linux-i386
422 "../$srcdir/configure" $configopts --target=linux-i386
--with-aros-toolchain-install="$tooldir"-i386 --with-aros-toolchain=yes
424 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
426 mkdir
-p aros-linux-x86_64-dbg
427 cd aros-linux-x86_64-dbg
428 "../$srcdir/configure" $configopts --target=linux-x86_64
--enable-debug --with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
430 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
432 mkdir
-p aros-linux-x86_64
434 "../$srcdir/configure" $configopts --target=linux-x86_64
--with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
436 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
438 mkdir
-p aros-pc-i386
440 "../$srcdir/configure" $configopts --target=pc-i386
--with-aros-toolchain-install="$tooldir"-i386 --with-aros-toolchain=yes
442 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
444 mkdir
-p aros-pc-x86_64
446 "../$srcdir/configure" $configopts --target=pc-x86_64
--with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
448 7 ) echo -e "\nConfiguring pc-x86_64 SMP V1...\n"
450 mkdir
-p aros-pc-x86_64-smp
451 cd aros-pc-x86_64-smp
452 "../$srcdir/configure" $configopts --target=pc-x86_64
--enable-target-variant=smp
--with-aros-toolchain-install="$tooldir"-x86_64 --with-aros-toolchain=yes
454 8 ) echo -e "\nConfiguring amiga-m68k V1...\n"
456 mkdir
-p aros-amiga-m68k
458 "../$srcdir/configure" $configopts --target=amiga-m68k
--with-serial-debug=yes --with-aros-toolchain-install="$tooldir"-m68k --with-aros-toolchain=yes
460 9 ) echo -e "\nConfiguring raspi-armhf V1...\n"
462 mkdir
-p aros-raspi-armhf
464 "../$srcdir/configure" $configopts --target=raspi-armhf
--with-aros-toolchain-install="$tooldir"-armhf --with-aros-toolchain=yes
476 until [ "$input" = "99" ]
481 echo -e "*****************"
482 echo -e "* Step 6: build *"
483 echo -e "*****************"
484 echo -e "\nYou can only build what you've already configured."
485 echo -e "\n 1 | linux-i386 (32-bit) debug"
486 echo -e " 2 | linux-i386 (32-bit)"
487 echo -e " 3 | linux-x86_64 (64-bit) debug"
488 echo -e " 4 | linux-x86_64 (64-bit)"
489 echo -e " 5 | pc-i386 (32-bit)"
490 echo -e " 6 | pc-x86_64 (64-bit)"
491 echo -e " 7 | pc-x86_64 SMP (64-bit)"
492 echo -e " 8 | amiga-m68k (32-bit)"
493 echo -e " 9 | raspi-armhf (32-bit)"
494 echo -e "\n99 .. Go to next step"
496 echo -e "\nEnter number and press <Enter>:"
500 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
501 cd aros-linux-i386-dbg
503 make $makeopts contrib
505 echo -e "\nIf everything went well AROS will be available"
506 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
508 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
511 make $makeopts contrib
513 echo -e "\nIf everything went well AROS will be available"
514 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
516 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
517 cd aros-linux-x86_64-dbg
519 make $makeopts contrib
521 echo -e "\nIf everything went well AROS will be available"
522 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
524 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
527 make $makeopts contrib
529 echo -e "\nIf everything went well AROS will be available"
530 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
532 5 ) echo -e "\nBuilding pc-i386 V1...\n"
535 make $makeopts contrib
537 make $makeopts distfiles
538 echo -e "\nIf everything went well AROS will be available"
539 echo -e "in the directory aros-pc-i386/distfiles"
541 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
544 make $makeopts contrib
546 make $makeopts distfiles
547 echo -e "\nIf everything went well AROS will be available"
548 echo -e "in the directory aros-pc-x86_64/distfiles"
550 7 ) echo -e "\nBuilding pc-x86_64 SMP V1...\n"
551 cd aros-pc-x86_64-smp
553 make $makeopts contrib
555 make $makeopts distfiles
556 echo -e "\nIf everything went well AROS will be available"
557 echo -e "in the directory aros-pc-x86_64-smp/distfiles"
559 8 ) echo -e "\nBuilding amiga-m68k V1...\n"
562 make $makeopts contrib
564 make $makeopts distfiles
565 echo -e "\nIf everything went well AROS will be available"
566 echo -e "in the directory aros-amiga-m68k/distfiles"
568 9 ) echo -e "\nBuilding raspi-armhf V1...\n"
571 make $makeopts contrib
573 make $makeopts distfiles
574 echo -e "\nIf everything went well AROS will be available"
575 echo -e "in the directory aros-raspi-armhf/distfiles"