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
15 portsdir
="$HOME/aros-ports-src"
16 tooldir
="$HOME/aros-toolchain"
23 echo "install_pkg() needs 2 arguments"
26 echo -e "\nInstalling " $2
30 echo -e "\n install failed. Script cancelled."
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"
52 echo -e "\nEnter number and press <Enter>:"
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"
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
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"
166 echo -e "\nEnter number and press <Enter>:"
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"
205 until [ "$input" = "9" ]
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"
216 echo -e "\nEnter number and press <Enter>:"
220 1 ) echo -e "\nConfiguring i386 Toolchain...\n"
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"
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"
242 until [ "$input" = "9" ]
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"
252 echo -e "\nEnter number and press <Enter>:"
256 1 ) echo -e "\nBuilding i386 Toolchain...\n"
257 cd aros-i386-toolchain-builddir
258 make $makeopts crosstools
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
266 rm -rf aros-x86_64-toolchain-builddir
278 until [ "$input" = "9" ]
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"
293 echo -e "\nEnter number and press <Enter>:"
297 1 ) echo -e "\nConfiguring linux-i386 V1 with full debug...\n"
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"
305 mkdir
-p 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"
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"
317 mkdir
-p 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"
323 mkdir
-p 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"
329 mkdir
-p aros-pc-x86_64
331 "../$srcdir/configure" --target=pc-x86_64
--with-portssources="$portsdir" --with-aros-toolchain-install="$tooldir" --with-aros-toolchain=yes
343 until [ "$input" = "9" ]
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"
357 echo -e "\nEnter number and press <Enter>:"
361 1 ) echo -e "\nBuilding linux-i386 V1 with full debug...\n"
362 cd aros-linux-i386-dbg
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"
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
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"
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"
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"
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"