Build "ports" and "contrib" because they are no longer
[AROS.git] / scripts / gimmearos-v1.sh
blob906001ce7b01c6eb5d4f3f3516c54cbc942675f2
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 (30.12.2014) 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 "\n9 .. Go to next step"
287 echo -e "0 .. Exit"
289 echo -e "\nEnter number and press <Enter>:"
291 read input
292 case "$input" in
293 1 ) echo -e "\nConfiguring i386 Toolchain...\n"
294 mkdir -p "$portsdir"
295 mkdir -p aros-i386-toolchain-builddir
296 cd aros-i386-toolchain-builddir
297 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
299 2 ) echo -e "\nConfiguring x86_64 Toolchain...\n"
300 mkdir -p "$portsdir"
301 mkdir -p aros-x86_64-toolchain-builddir
302 cd aros-x86_64-toolchain-builddir
303 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
306 0 ) exit 0
308 esac
309 done
312 cd "$curdir"
314 input=""
315 until [ "$input" = "9" ]
317 cd "$curdir"
319 echo -e "\n\n\n\n\n"
320 echo -e "***************************"
321 echo -e "* Step 4: build toolchain *"
322 echo -e "***************************"
323 echo -e "\nYou can only build what you've already configured."
324 echo -e "\n 1 | i386 (32-bit)"
325 echo -e " 2 | x86_64 (64-bit)"
326 echo -e "\n9 .. Go to next step"
327 echo -e "0 .. Exit"
328 echo -e "\nEnter number and press <Enter>:"
330 read input
331 case "$input" in
332 1 ) echo -e "\nBuilding i386 Toolchain...\n"
333 cd aros-i386-toolchain-builddir
334 make $makeopts crosstools
335 cd "$curdir"
336 rm -rf aros-i386-toolchain-builddir
338 2 ) echo -e "\nBuilding x86_64 Toolchain...\n"
339 cd aros-x86_64-toolchain-builddir
340 make $makeopts crosstools
341 cd "$curdir"
342 rm -rf aros-x86_64-toolchain-builddir
345 0 ) exit 0
347 esac
348 done
351 cd "$curdir"
353 input=""
354 until [ "$input" = "9" ]
356 cd "$curdir"
358 echo -e "\n\n\n\n\n"
359 echo -e "**************************"
360 echo -e "* Step 5: configure AROS *"
361 echo -e "**************************"
362 echo -e "\n 1 | linux-i386 (32-bit) debug"
363 echo -e " 2 | linux-i386 (32-bit)"
364 echo -e " 3 | linux-x86_64 (64-bit) debug"
365 echo -e " 4 | linux-x86_64 (64-bit)"
366 echo -e " 5 | pc-i386 (32-bit)"
367 echo -e " 6 | pc-x86_64 (64-bit)"
368 echo -e "\n9 .. Go to next step"
369 echo -e "0 .. Exit"
371 echo -e "\nEnter number and press <Enter>:"
373 read input
374 case "$input" in
375 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
376 mkdir -p "$portsdir"
377 mkdir -p aros-linux-i386-dbg
378 cd aros-linux-i386-dbg
379 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
381 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
382 mkdir -p "$portsdir"
383 mkdir -p aros-linux-i386
384 cd aros-linux-i386
385 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
387 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
388 mkdir -p "$portsdir"
389 mkdir -p aros-linux-x86_64-dbg
390 cd aros-linux-x86_64-dbg
391 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
393 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
394 mkdir -p "$portsdir"
395 mkdir -p aros-linux-x86_64
396 cd aros-linux-x86_64
397 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
399 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
400 mkdir -p "$portsdir"
401 mkdir -p aros-pc-i386
402 cd aros-pc-i386
403 "../$srcdir/configure" --target=pc-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
405 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
406 mkdir -p "$portsdir"
407 mkdir -p aros-pc-x86_64
408 cd aros-pc-x86_64
409 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
412 0 ) exit 0
414 esac
415 done
418 cd "$curdir"
420 input=""
421 until [ "$input" = "9" ]
423 cd "$curdir"
425 echo -e "\n\n\n\n\n"
426 echo -e "*****************"
427 echo -e "* Step 6: build *"
428 echo -e "*****************"
429 echo -e "\nYou can only build what you've already configured."
430 echo -e "\n 1 | linux-i386 (32-bit) debug"
431 echo -e " 2 | linux-i386 (32-bit)"
432 echo -e " 3 | linux-x86_64 (64-bit) debug"
433 echo -e " 4 | linux-x86_64 (64-bit)"
434 echo -e " 5 | pc-i386 (32-bit)"
435 echo -e " 6 | pc-x86_64 (64-bit)"
436 echo -e "\n9 .. Go to next step"
437 echo -e "0 .. Exit"
438 echo -e "\nEnter number and press <Enter>:"
440 read input
441 case "$input" in
442 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
443 cd aros-linux-i386-dbg
444 make $makeopts . contrib ports
445 echo -e "\nIf everything went well AROS will be available"
446 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
448 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
449 cd aros-linux-i386
450 make $makeopts . contrib ports
451 echo -e "\nIf everything went well AROS will be available"
452 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
454 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
455 cd aros-linux-x86_64-dbg
456 make $makeopts . contrib ports
457 echo -e "\nIf everything went well AROS will be available"
458 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
460 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
461 cd aros-linux-x86_64
462 make $makeopts . contrib ports
463 echo -e "\nIf everything went well AROS will be available"
464 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
466 5 ) echo -e "\nBuilding pc-i386 V1...\n"
467 cd aros-pc-i386
468 make $makeopts . contrib ports
469 make $makeopts bootiso
470 echo -e "\nIf everything went well AROS will be available"
471 echo -e "in the directory aros-pc-i386/bin/<target>/AROS"
473 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
474 cd aros-pc-x86_64
475 make $makeopts . contrib ports
476 make $makeopts bootiso
477 echo -e "\nIf everything went well AROS will be available"
478 echo -e "in the directory aros-pc-x86_64/bin/<target>/AROS"
481 0 ) exit 0
483 esac
484 done
486 cd "$curdir"
488 exit 0