Fixed high memory flags, now that trackdisk.device buffer requirements
[AROS.git] / scripts / gimmearos-v1.sh
blob16fad9de7057dd7b26560e3370a1e57db61f13a3
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.11 (28.12.2013) 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
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 with | ABI V1 |"
156 echo -e "Subversion | with GIT | Content"
157 echo -e "------------+----------+--------------------------"
158 echo -e " 1 | 21 | Get AROS core (required)"
159 echo -e " 2 | 22 | Get contrib (optional)"
160 echo -e "\n 3 | 23 | Get ports source (optional, needs contrib)"
161 echo -e "\n 4 | --- | Get documentation source (optional)"
162 echo -e " 5 | --- | Get binaries (wallpapers, logos etc.) (optional)"
163 echo -e "\n9 .. Leave loop, goto next step"
164 echo -e "0 .. Exit"
166 echo -e "\nEnter number and press <Enter>:"
168 read input
169 case "$input" in
170 1 ) echo -e "\nGetting AROS V1 core with Subversion...\n"
171 svn checkout https://svn.aros.org/svn/aros/trunk/AROS "$srcdir"
173 2 ) echo -e "\nGetting contrib V1 with Subversion...\n"
174 svn checkout https://svn.aros.org/svn/aros/trunk/contrib "$srcdir/contrib"
176 3 ) echo -e "\nGetting ports V1 with Subversion...\n"
177 svn checkout https://svn.aros.org/svn/aros/trunk/ports "$srcdir/ports"
179 4 ) echo -e "\nGetting documentation V1 with Subversion...\n"
180 svn checkout https://svn.aros.org/svn/aros/trunk/documentation "$srcdir/documentation"
182 5 ) echo -e "\nGetting binaries V1 with Subversion...\n"
183 svn checkout https://svn.aros.org/svn/aros/trunk/binaries "$srcdir/binaries"
186 21 ) echo -e "\nGetting AROS V1 core with Git...\n"
187 git clone git://repo.or.cz/AROS.git "$srcdir"
189 22 ) echo -e "\nGetting contrib V1 with Git...\n"
190 git clone git://repo.or.cz/AROS-Contrib.git "$srcdir/contrib"
192 23 ) echo -e "\nGetting ports V1 with Git...\n"
193 git clone git://repo.or.cz/AROS-Ports.git "$srcdir/ports"
196 0 ) exit 0
198 esac
199 done
202 cd "$curdir"
204 input=""
205 until [ "$input" = "9" ]
207 cd "$curdir"
209 echo -e "\nStep 3: Configuring Toolchain"
210 echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
211 echo -e " 1 | i386 (32-bit)"
212 echo -e " 2 | x86_64 (64-bit)"
213 echo -e "\n9 .. Leave loop, goto next step"
214 echo -e "0 .. Exit"
216 echo -e "\nEnter number and press <Enter>:"
218 read input
219 case "$input" in
220 1 ) echo -e "\nConfiguring i386 Toolchain...\n"
221 mkdir -p "$portsdir"
222 mkdir -p aros-i386-toolchain-builddir
223 cd aros-i386-toolchain-builddir
224 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
226 2 ) echo -e "\nConfiguring x86_64 Toolchain...\n"
227 mkdir -p "$portsdir"
228 mkdir -p aros-x86_64-toolchain-builddir
229 cd aros-x86_64-toolchain-builddir
230 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir"
233 0 ) exit 0
235 esac
236 done
239 cd "$curdir"
241 input=""
242 until [ "$input" = "9" ]
244 cd "$curdir"
245 echo -e "\nStep 4: Building Toolchain"
246 echo -e "~~~~~~~~~~~~~~~~~~~~~~~~~~"
247 echo -e "\nYou can only build what you've already configured."
248 echo -e " 1 | i386 (32-bit)"
249 echo -e " 2 | x86_64 (64-bit)"
250 echo -e "\n9 .. Leave loop, goto next step"
251 echo -e "0 .. Exit"
252 echo -e "\nEnter number and press <Enter>:"
254 read input
255 case "$input" in
256 1 ) echo -e "\nBuilding i386 Toolchain...\n"
257 cd aros-i386-toolchain-builddir
258 make $makeopts crosstools
259 cd "$curdir"
260 rm -rf aros-i386-toolchain-builddir
262 2 ) echo -e "\nBuilding x86_64 Toolchain...\n"
263 cd aros-x86_64-toolchain-builddir
264 make $makeopts crosstools
265 cd "$curdir"
266 rm -rf aros-x86_64-toolchain-builddir
269 0 ) exit 0
271 esac
272 done
275 cd "$curdir"
277 input=""
278 until [ "$input" = "9" ]
280 cd "$curdir"
282 echo -e "\nStep 5: Configuring"
283 echo -e "~~~~~~~~~~~~~~~~~~~"
284 echo -e "\n 1 | linux-i386 (32-bit) debug"
285 echo -e " 2 | linux-i386 (32-bit)"
286 echo -e " 3 | linux-x86_64 (64-bit) debug"
287 echo -e " 4 | linux-x86_64 (64-bit)"
288 echo -e " 5 | pc-i386 (32-bit)"
289 echo -e " 6 | pc-x86_64 (64-bit)"
290 echo -e "\n9 .. Leave loop, goto next step"
291 echo -e "0 .. Exit"
293 echo -e "\nEnter number and press <Enter>:"
295 read input
296 case "$input" in
297 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
298 mkdir -p "$portsdir"
299 mkdir -p aros-linux-i386-dbg
300 cd aros-linux-i386-dbg
301 "../$srcdir/configure" --target=linux-i386 --enable-debug=all --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
303 2 ) echo -e "\nConfiguring linux-i386 V1 without debug...\n"
304 mkdir -p "$portsdir"
305 mkdir -p aros-linux-i386
306 cd aros-linux-i386
307 "../$srcdir/configure" --target=linux-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
309 3 ) echo -e "\nConfiguring linux-x86_64 V1 with full debug...\n"
310 mkdir -p "$portsdir"
311 mkdir -p aros-linux-x86_64-dbg
312 cd aros-linux-x86_64-dbg
313 "../$srcdir/configure" --target=linux-x86_64 --enable-debug=all --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
315 4 ) echo -e "\nConfiguring linux-x86_64 V1 without debug...\n"
316 mkdir -p "$portsdir"
317 mkdir -p aros-linux-x86_64
318 cd aros-linux-x86_64
319 "../$srcdir/configure" --target=linux-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
321 5 ) echo -e "\nConfiguring pc-i386 V1...\n"
322 mkdir -p "$portsdir"
323 mkdir -p aros-pc-i386
324 cd aros-pc-i386
325 "../$srcdir/configure" --target=pc-i386 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
327 6 ) echo -e "\nConfiguring pc-x86_64 V1...\n"
328 mkdir -p "$portsdir"
329 mkdir -p aros-pc-x86_64
330 cd aros-pc-x86_64
331 "../$srcdir/configure" --target=pc-x86_64 --with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
334 0 ) exit 0
336 esac
337 done
340 cd "$curdir"
342 input=""
343 until [ "$input" = "9" ]
345 cd "$curdir"
346 echo -e "\nStep 6: Building"
347 echo -e "~~~~~~~~~~~~~~~~"
348 echo -e "\nYou can only build what you've already configured."
349 echo -e "\n 1 | linux-i386 (32-bit) debug"
350 echo -e " 2 | linux-i386 (32-bit)"
351 echo -e " 3 | linux-x86_64 (64-bit) debug"
352 echo -e " 4 | linux-x86_64 (64-bit)"
353 echo -e " 5 | pc-i386 (32-bit)"
354 echo -e " 6 | pc-x86_64 (64-bit)"
355 echo -e "\n9 .. Leave loop, goto next step"
356 echo -e "0 .. Exit"
357 echo -e "\nEnter number and press <Enter>:"
359 read input
360 case "$input" in
361 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
362 cd aros-linux-i386-dbg
363 make $makeopts
364 #make default-x11keymaptable
365 echo -e "\nIf everything went well AROS will be available"
366 echo -e "in the directory aros-linux-i386-dbg/bin/<target>/AROS"
368 2 ) echo -e "\nBuilding linux-i386 V1 without debug...\n"
369 cd aros-linux-i386
370 make $makeopts
371 #make default-x11keymaptable
372 echo -e "\nIf everything went well AROS will be available"
373 echo -e "in the directory aros-linux-i386/bin/<target>/AROS"
375 3 ) echo -e "\nBuilding linux-x86_64 V1 with full debug...\n"
376 cd aros-linux-x86_64-dbg
377 make $makeopts
378 #make default-x11keymaptable
379 echo -e "\nIf everything went well AROS will be available"
380 echo -e "in the directory aros-linux-x86_64-dbg/bin/<target>/AROS"
382 4 ) echo -e "\nBuilding linux-x86_64 V1 without debug...\n"
383 cd aros-linux-x86_64
384 make $makeopts
385 #make default-x11keymaptable
386 echo -e "\nIf everything went well AROS will be available"
387 echo -e "in the directory aros-linux-x86_64/bin/<target>/AROS"
389 5 ) echo -e "\nBuilding pc-i386 V1...\n"
390 cd aros-pc-i386
391 make $makeopts
392 make $makeopts bootiso
393 echo -e "\nIf everything went well AROS will be available"
394 echo -e "in the directory aros-pc-i386/bin/<target>/AROS"
396 6 ) echo -e "\nBuilding pc-x86_64 V1...\n"
397 cd aros-pc-x86_64
398 make $makeopts
399 make $makeopts bootiso
400 echo -e "\nIf everything went well AROS will be available"
401 echo -e "in the directory aros-pc-x86_64/bin/<target>/AROS"
404 0 ) exit 0
406 esac
407 done
409 cd "$curdir"
411 exit 0