Use a global directory for the port's sources.
[AROS.git] / scripts / gimmearos.sh
blobdbc1eac7e2937e6cbc9ff5899cd2702fb750903e
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 (28.12.2013) WIP
13 curdir="`pwd`"
14 srcdir="aros-src"
15 srcdir_v0="aros-src-v0"
16 portsdir="$HOME/aros-ports-src"
17 cpucoresforcompile="2"
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
37 echo -e "\n\nScript for downloading and building of AROS"
38 echo -e "============================================"
39 echo -e "\nStep 1: install prerequisites"
40 echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
41 echo -e "The build system needs some packages to do its job."
42 echo -e "If you are asked for a password enter you admin password."
43 echo -e "\n1 .. Get packages with apt-get for Debian and similar (e.g. Ubuntu)"
44 echo -e " for building 32-bit AROS on 32-bit Linux or 64-bit-AROS on 64-bit-Linux"
45 echo -e "2 .. As 1) but with additional packages for building 32-bit AROS"
46 echo -e " on 64-bit Linux"
47 echo -e "3 .. Get packages with yum for Fedora"
48 echo -e "4 .. Get packages with pacman for Arch"
49 echo -e "9 .. Skip this step"
50 echo -e "0 .. Exit"
52 echo -e "\nEnter number and press <Enter>:"
54 read input
55 case "$input" in
56 1 ) echo -e "\nInstalling prerequisites with apt-get..."
57 install_pkg "apt-get install" subversion
58 install_pkg "apt-get install" git-core
59 install_pkg "apt-get install" gcc
60 install_pkg "apt-get install" g++
61 install_pkg "apt-get install" make
62 install_pkg "apt-get install" gawk
63 install_pkg "apt-get install" bison
64 install_pkg "apt-get install" flex
65 install_pkg "apt-get install" bzip2
66 install_pkg "apt-get install" netpbm
67 install_pkg "apt-get install" autoconf
68 install_pkg "apt-get install" automake
69 install_pkg "apt-get install" libx11-dev
70 install_pkg "apt-get install" libxext-dev
71 install_pkg "apt-get install" libc6-dev
72 install_pkg "apt-get install" liblzo2-dev
73 install_pkg "apt-get install" libxxf86vm-dev
74 install_pkg "apt-get install" libpng12-dev
75 install_pkg "apt-get install" gcc-multilib
76 install_pkg "apt-get install" libsdl1.2-dev
77 install_pkg "apt-get install" byacc
80 2 ) echo -e "\nInstalling prerequisites with apt-get..."
81 install_pkg "apt-get install" subversion
82 install_pkg "apt-get install" git-core
83 install_pkg "apt-get install" gcc
84 install_pkg "apt-get install" g++
85 install_pkg "apt-get install" make
86 install_pkg "apt-get install" gawk
87 install_pkg "apt-get install" bison
88 install_pkg "apt-get install" flex
89 install_pkg "apt-get install" bzip2
90 install_pkg "apt-get install" netpbm
91 install_pkg "apt-get install" autoconf
92 install_pkg "apt-get install" automake
93 install_pkg "apt-get install" libx11-dev
94 install_pkg "apt-get install" libxext-dev
95 install_pkg "apt-get install" libc6-dev
96 install_pkg "apt-get install" liblzo2-dev
97 install_pkg "apt-get install" libxxf86vm-dev
98 install_pkg "apt-get install" libpng12-dev
99 install_pkg "apt-get install" gcc-multilib
100 install_pkg "apt-get install" libsdl1.2-dev
101 install_pkg "apt-get install" byacc
103 install_pkg "apt-get install" libc6-dev-i386
104 install_pkg "apt-get install" lib32gcc1
105 install_pkg "apt-get install" ia32-libs
108 3 ) echo -e "\nInstalling prerequisites with yum..."
109 install_pkg "yum install" subversion
110 install_pkg "yum install" git-core
111 install_pkg "yum install" gcc
112 install_pkg "yum install" gawk
113 install_pkg "yum install" bison
114 install_pkg "yum install" flex
115 install_pkg "yum install" bzip2
116 install_pkg "yum install" netpbm
117 install_pkg "yum install" autoconf
118 install_pkg "yum install" automake
119 install_pkg "yum install" libX11-devel
120 install_pkg "yum install" glibc-devel
121 install_pkg "yum install" lzo-devel
124 4 ) echo -e "\nInstalling prerequisites with pacman.."
125 echo -e "\nUpdating the List of software"
126 echo -e "\nEnter sudo password"
127 sudo pacman -Sy
128 install_pkg "pacman --needed --noconfirm -S" subversion
129 install_pkg "pacman --needed --noconfirm -S" git-core
130 install_pkg "pacman --needed --noconfirm -S" gcc
131 install_pkg "pacman --needed --noconfirm -S" gawk
132 install_pkg "pacman --needed --noconfirm -S" bison
133 install_pkg "pacman --needed --noconfirm -S" flex
134 install_pkg "pacman --needed --noconfirm -S" bzip2
135 install_pkg "pacman --needed --noconfirm -S" netpbm
136 install_pkg "pacman --needed --noconfirm -S" autoconf
137 install_pkg "pacman --needed --noconfirm -S" automake
138 #it appears as though the libx11-dev,libc6-dev,liblzo2-dev is not needed on arch
141 0 ) exit 0
143 esac
145 cd "$curdir"
147 input=""
148 until [ "$input" = "9" ]
150 echo -e "\nStep 2: Get the sources from the repository"
151 echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
152 echo -e "\nYou can either use Subversion or Git. Git doesn't require"
153 echo -e "a password, but you'll get only read-only access."
154 echo -e "The repositories will be checked out into the current directory."
155 echo -e "\nABI V1 is the current development version which is no longer"
156 echo -e "binary compatible with V0."
157 echo -e "\nABI V1 with | ABI V0 with | ABI V1 |"
158 echo -e "Subversion | Subversion | with GIT | Content"
159 echo -e "------------+-------------+----------+--------------------------"
160 echo -e " 1 | 11 | 21 | Get AROS core (required)"
161 echo -e " 2 | 12 | 22 | Get contrib (optional)"
162 echo -e "\n 3 | 13 | 23 | Get ports source (optional, needs contrib)"
163 echo -e "\n 4 | 14 | --- | Get documentation source (optional)"
164 echo -e " 5 | 15 | --- | Get binaries (wallpapers, logos etc.) (optional)"
165 echo -e "\n9 .. Leave loop, goto next step"
166 echo -e "0 .. Exit"
168 echo -e "\nEnter number and press <Enter>:"
170 read input
171 case "$input" in
172 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
173 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
175 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
176 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
178 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
179 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
181 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
182 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
184 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
185 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
188 11 ) echo -e "\nGetting AROS V0 core with Subversion...\n"
189 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/AROS "$srcdir_v0"
191 12 ) echo -e "\nGetting contrib V0 with Subversion...\n"
192 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/contrib "$srcdir_v0/contrib"
194 13 ) echo -e "\nGetting ports V0 with Subversion...\n"
195 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/ports "$srcdir_v0/ports"
197 14 ) echo -e "\nGetting documentation V1 with Subversion...\n"
198 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/documentation "$srcdir_v0/documentation"
200 15 ) echo -e "\nGetting binaries V1 with Subversion...\n"
201 svn checkout https://svn.aros.org/svn/aros/branches/ABI_V0/binaries "$srcdir_v0/binaries"
204 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
205 git clone git://repo.or.cz/AROS.git "$srcdir"
207 22 ) echo -e "\nGetting contrib V1 with Git...\n"
208 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
210 23 ) echo -e "\nGetting ports V1 with Git...\n"
211 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
214 0 ) exit 0
216 esac
217 done
219 cd "$curdir"
222 input=""
223 until [ "$input" = "9" ]
225 cd "$curdir"
227 echo -e "\nStep 3: Configuring"
228 echo -e "~~~~~~~~~~~~~~~~~~~"
229 echo -e "\nABI V1 | ABI V0 |"
230 echo -e "-------+--------+----------------------------"
231 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
232 echo -e " 2 | 12 | linux-i386 (32-bit)"
233 echo -e " 3 | 13 | linux-x86_64 (64-bit) debug"
234 echo -e " 4 | 14 | linux-x86_64 (64-bit)"
235 echo -e " 5 | 15 | pc-i386 (32-bit)"
236 echo -e " 6 | 16 | pc-x86_64 (64-bit)"
237 echo -e "\n9 .. Leave loop, goto 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 "\nConfiguring linux-i386 V1 with full debug...\n"
245 mkdir -p "$portsdir"
246 mkdir -p aros-linux-i386-dbg
247 cd aros-linux-i386-dbg
248 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir"
250 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
251 mkdir -p "$portsdir"
252 mkdir -p aros-linux-i386
253 cd aros-linux-i386
254 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir"
256 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
257 mkdir -p "$portsdir"
258 mkdir -p aros-linux-x86_64-dbg
259 cd aros-linux-x86_64-dbg
260 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir"
262 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
263 mkdir -p "$portsdir"
264 mkdir -p aros-linux-x86_64
265 cd aros-linux-x86_64
266 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir"
268 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
269 mkdir -p "$portsdir"
270 mkdir -p aros-pc-i386
271 cd aros-pc-i386
272 "../$srcdir/configure" --target=pc-i386 --with-portssources="$portsdir"
274 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
275 mkdir -p "$portsdir"
276 mkdir -p aros-pc-x86_64
277 cd aros-pc-x86_64
278 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$portsdir"
281 11 ) echo -e "\nConfiguring linux-i386 V0 with full debug...\n"
282 mkdir -p "$portsdir"
283 mkdir -p aros-linux-i386-v0-dbg
284 cd aros-linux-i386-v0-dbg
285 "../$srcdir_v0/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir"
287 12 ) echo -e "\nConfiguring linux-i386 V0 without debug...\n"
288 mkdir -p "$portsdir"
289 mkdir -p aros-linux-i386-v0
290 cd aros-linux-i386-v0
291 "../$srcdir_v0/configure" --target=linux-i386 --with-portssources="$portsdir"
293 13 ) echo -e "\nConfiguring linux-x86_64 V0 with full debug...\n"
294 mkdir -p "$portsdir"
295 mkdir -p aros-linux-x86_64-v0-dbg
296 cd aros-linux-x86_64-v0-dbg
297 "../$srcdir_v0/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir"
299 14 ) echo -e "\nConfiguring linux-x86_64 V0 without debug...\n"
300 mkdir -p "$portsdir"
301 mkdir -p aros-linux-x86_64-v0
302 cd aros-linux-x86_64-v0
303 "../$srcdir_v0/configure" --target=linux-x86_64 --with-portssources="$portsdir"
305 15 ) echo -e "\nConfiguring pc-i386 V0...\n"
306 mkdir -p "$portsdir"
307 mkdir -p aros-pc-i386-v0
308 cd aros-pc-i386-v0
309 "../$srcdir_v0/configure" --target=pc-i386 --with-portssources="$portsdir"
311 16 ) echo -e "\nConfiguring pc-x86_64 V0...\n"
312 mkdir -p "$portsdir"
313 mkdir -p aros-pc-x86_64-v0
314 cd aros-pc-x86_64-v0
315 "../$srcdir_v0/configure" --target=pc-x86_64 --with-portssources="$portsdir"
318 0 ) exit 0
320 esac
321 done
325 cd "$curdir"
327 input=""
328 until [ "$input" = "9" ]
330 cd "$curdir"
331 echo -e "\nStep 4: Building"
332 echo -e "~~~~~~~~~~~~~~~~"
333 echo -e "\nYou can only build what you've already configured."
334 echo -e "\nABI V1 | ABI V0 |"
335 echo -e "-------+--------+----------------------------"
336 echo -e " 1 | 11 | linux-i386 (32-bit) debug"
337 echo -e " 2 | 12 | linux-i386 (32-bit)"
338 echo -e " 3 | 13 | linux-x86_64 (64-bit) debug"
339 echo -e " 4 | 14 | linux-x86_64 (64-bit)"
340 echo -e " 5 | 15 | pc-i386 (32-bit)"
341 echo -e " 6 | 16 | pc-x86_64 (64-bit)"
342 echo -e "\n9 .. Leave loop, exit"
344 echo -e "\nEnter number and press <Enter>:"
346 read input
347 case "$input" in
348 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
349 cd aros-linux-i386-dbg
350 make -j$cpucoresforcompile
351 make default-x11keymaptable
352 echo -e "\nIf everything went well AROS will be available"
353 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
355 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
356 cd aros-linux-i386
357 make -j$cpucoresforcompile
358 make default-x11keymaptable
359 echo -e "\nIf everything went well AROS will be available"
360 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
362 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
363 cd aros-linux-x86_64-dbg
364 make -j$cpucoresforcompile
365 make default-x11keymaptable
366 echo -e "\nIf everything went well AROS will be available"
367 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
369 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
370 cd aros-linux-x86_64
371 make -j$cpucoresforcompile
372 make default-x11keymaptable
373 echo -e "\nIf everything went well AROS will be available"
374 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
376 5 ) echo -e "\nBuilding pc-i386 V1...\n"
377 cd aros-pc-i386
378 make -j$cpucoresforcompile
379 make -j$cpucoresforcompile bootiso
380 echo -e "\nIf everything went well AROS will be available"
381 echo -e "in the directory aros-pc-i386/bin/<target>/AROS"
383 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
384 cd aros-pc-x86_64
385 make -j$cpucoresforcompile
386 make -j$cpucoresforcompile bootiso
387 echo -e "\nIf everything went well AROS will be available"
388 echo -e "in the directory aros-pc-x86_64/bin/<target>/AROS"
392 11 ) echo -e "\nBuilding linux-i386 V0 with full debug...\n"
393 cd aros-linux-i386-v0-dbg
394 make -j$cpucoresforcompile
395 make default-x11keymaptable
396 echo -e "\nIf everything went well AROS will be available"
397 echo -e "in the directory aros-linux-i386-v0-dbg/bin/<target>/AROS"
399 12 ) echo -e "\nBuilding linux-i386 V0 without debug...\n"
400 cd aros-linux-i386-v0
401 make -j$cpucoresforcompile
402 make default-x11keymaptable
403 echo -e "\nIf everything went well AROS will be available"
404 echo -e "in the directory aros-linux-i386-v0/bin/<target>/AROS"
406 13 ) echo -e "\nBuilding linux-x86_64 V0 with full debug...\n"
407 cd aros-linux-x86_64-v0-dbg
408 make -j$cpucoresforcompile
409 make default-x11keymaptable
410 echo -e "\nIf everything went well AROS will be available"
411 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
413 14 ) echo -e "\nBuilding linux-x86_64 V0 without debug...\n"
414 cd aros-linux-x86_64-v0
415 make -j$cpucoresforcompile
416 make default-x11keymaptable
417 echo -e "\nIf everything went well AROS will be available"
418 echo -e "in the directory aros-linux-x86_64-v0/bin/<target>/AROS"
420 15 ) echo -e "\nBuilding pc-i386 V0...\n"
421 cd aros-pc-i386-v0
422 make -j$cpucoresforcompile
423 make -j$cpucoresforcompile bootiso
424 echo -e "\nIf everything went well AROS will be available"
425 echo -e "in the directory aros-pc-i386-v0/bin/<target>/AROS"
427 16 ) echo -e "\nBuilding pc-x86_64 V0...\n"
428 cd aros-pc-x86_64-v0
429 make -j$cpucoresforcompile
430 make -j$cpucoresforcompile bootiso
431 echo -e "\nIf everything went well AROS will be available"
432 echo -e "in the directory aros-pc-x86_64-v0/bin/<target>/AROS"
435 0 ) exit 0
437 esac
438 done
441 cd "$curdir"
443 exit 0