diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/rockboxdev.sh | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh index 079c8c5c0e..1c9d794b07 100755 --- a/tools/rockboxdev.sh +++ b/tools/rockboxdev.sh | |||
@@ -125,12 +125,12 @@ echo "Build dir: $builddir (set RBDEV_BUILD to change dir)" | |||
125 | # Verify that the prefix dir exists and that we can write to it, | 125 | # Verify that the prefix dir exists and that we can write to it, |
126 | # as otherwise we will hardly be able to install there! | 126 | # as otherwise we will hardly be able to install there! |
127 | if test ! -d $prefix; then | 127 | if test ! -d $prefix; then |
128 | echo "WARNING: The installation destination does not exist." | 128 | echo "ERROR: The installation destination does not exist." |
129 | echo "Please create it and re-run this script" | 129 | echo "Please create it and re-run this script" |
130 | exit | 130 | exit |
131 | fi | 131 | fi |
132 | if test ! -w $prefix; then | 132 | if test ! -w $prefix; then |
133 | echo "WARNING: This script is set to install in $prefix but has no write permissions for it" | 133 | echo "ERROR: This script is set to install in $prefix but has no write permissions for it" |
134 | echo "Please fix this and re-run this script" | 134 | echo "Please fix this and re-run this script" |
135 | exit | 135 | exit |
136 | fi | 136 | fi |
@@ -139,8 +139,10 @@ fi | |||
139 | 139 | ||
140 | cleardir () { | 140 | cleardir () { |
141 | # $1 is the name of the build dir | 141 | # $1 is the name of the build dir |
142 | # $2 is the arch | ||
142 | # delete the build dirs and the source dirs | 143 | # delete the build dirs and the source dirs |
143 | rm -rf $1/build-gcc $1/build-binu $1/gcc* $1/binutils* | 144 | echo "Cleaning up build folder" |
145 | rm -rf $1/build-gcc-$2 $1/build-binu-$2 | ||
144 | } | 146 | } |
145 | 147 | ||
146 | buildone () { | 148 | buildone () { |
@@ -244,14 +246,16 @@ fi | |||
244 | ########################################################################### | 246 | ########################################################################### |
245 | # If there's already a build dir, we don't overwrite or delete it | 247 | # If there's already a build dir, we don't overwrite or delete it |
246 | if test -d $builddir; then | 248 | if test -d $builddir; then |
247 | echo "You already have a $builddir directory!" | 249 | if test ! -w $builddir; then |
248 | echo "Please remove it and re-run the script" | 250 | echo "ERROR: No write permissions for the build directory!" |
249 | exit | 251 | exit |
252 | fi | ||
250 | else | 253 | else |
251 | mkdir -p $builddir | 254 | mkdir -p $builddir |
252 | cd $builddir | ||
253 | fi | 255 | fi |
254 | 256 | ||
257 | cd $builddir | ||
258 | |||
255 | ########################################################################### | 259 | ########################################################################### |
256 | # Create a summary file for each toolchain, containing info about the version | 260 | # Create a summary file for each toolchain, containing info about the version |
257 | # and a remainder to append the compiler path to PATH | 261 | # and a remainder to append the compiler path to PATH |
@@ -282,10 +286,10 @@ if test -n "$gccpatch"; then | |||
282 | patch -p0 < "$dlwhere/$gccpatch" | 286 | patch -p0 < "$dlwhere/$gccpatch" |
283 | fi | 287 | fi |
284 | 288 | ||
285 | echo "ROCKBOXDEV: mkdir build-binu" | 289 | echo "ROCKBOXDEV: mkdir build-binu-$1" |
286 | mkdir build-binu | 290 | mkdir build-binu-$1 |
287 | echo "ROCKBOXDEV: cd build-binu" | 291 | echo "ROCKBOXDEV: cd build-binu-$1" |
288 | cd build-binu | 292 | cd build-binu-$1 |
289 | echo "ROCKBOXDEV: binutils/configure" | 293 | echo "ROCKBOXDEV: binutils/configure" |
290 | # we undefine _FORTIFY_SOURCE to make the binutils built run fine on recent | 294 | # we undefine _FORTIFY_SOURCE to make the binutils built run fine on recent |
291 | # Ubuntu installations | 295 | # Ubuntu installations |
@@ -294,14 +298,14 @@ echo "ROCKBOXDEV: binutils/make" | |||
294 | $make | 298 | $make |
295 | echo "ROCKBOXDEV: binutils/make install to $prefix/$target" | 299 | echo "ROCKBOXDEV: binutils/make install to $prefix/$target" |
296 | $make install | 300 | $make install |
297 | cd .. # get out of build-binu | 301 | cd .. # get out of build-binu-$1 |
298 | PATH="$bindir:${PATH}" | 302 | PATH="$bindir:${PATH}" |
299 | SHELL=/bin/sh # seems to be needed by the gcc build in some cases | 303 | SHELL=/bin/sh # seems to be needed by the gcc build in some cases |
300 | 304 | ||
301 | echo "ROCKBOXDEV: mkdir build-gcc" | 305 | echo "ROCKBOXDEV: mkdir build-gcc-$1" |
302 | mkdir build-gcc | 306 | mkdir build-gcc-$1 |
303 | echo "ROCKBOXDEV: cd build-gcc" | 307 | echo "ROCKBOXDEV: cd build-gcc-$1" |
304 | cd build-gcc | 308 | cd build-gcc-$1 |
305 | echo "ROCKBOXDEV: gcc/configure" | 309 | echo "ROCKBOXDEV: gcc/configure" |
306 | # we undefine _FORTIFY_SOURCE to make the gcc build go through fine on | 310 | # we undefine _FORTIFY_SOURCE to make the gcc build go through fine on |
307 | # recent Ubuntu installations | 311 | # recent Ubuntu installations |
@@ -313,8 +317,7 @@ $make install | |||
313 | cd .. # get out of build-gcc | 317 | cd .. # get out of build-gcc |
314 | cd .. # get out of $builddir | 318 | cd .. # get out of $builddir |
315 | 319 | ||
316 | # end of buildone() function | 320 | } # buildone() |
317 | } | ||
318 | 321 | ||
319 | echo "" | 322 | echo "" |
320 | echo "Select target arch:" | 323 | echo "Select target arch:" |
@@ -323,7 +326,7 @@ echo "m - m68k (iriver h1x0/h3x0, ifp7x0 and iaudio)" | |||
323 | echo "a - arm (ipods, iriver H10, Sansa, etc)" | 326 | echo "a - arm (ipods, iriver H10, Sansa, etc)" |
324 | echo "i - mips (Jz4740 and ATJ-based players)" | 327 | echo "i - mips (Jz4740 and ATJ-based players)" |
325 | echo "separate multiple targets with spaces" | 328 | echo "separate multiple targets with spaces" |
326 | echo "(i.e. \"s m a\" will build sh, m86k and arm)" | 329 | echo "(Example: \"s m a\" will build sh, m86k and arm)" |
327 | echo "" | 330 | echo "" |
328 | 331 | ||
329 | selarch=`input` | 332 | selarch=`input` |
@@ -334,30 +337,33 @@ echo "" | |||
334 | case $arch in | 337 | case $arch in |
335 | [Ss]) | 338 | [Ss]) |
336 | buildone $arch | 339 | buildone $arch |
340 | cleardir $builddir $arch | ||
337 | ;; | 341 | ;; |
338 | [Ii]) | 342 | [Ii]) |
339 | buildone $arch | 343 | buildone $arch |
344 | cleardir $builddir $arch | ||
340 | ;; | 345 | ;; |
341 | [Mm]) | 346 | [Mm]) |
342 | buildone $arch | 347 | buildone $arch |
348 | cleardir $builddir $arch | ||
343 | ;; | 349 | ;; |
344 | [Aa]) | 350 | [Aa]) |
345 | buildone $arch | 351 | buildone $arch |
352 | cleardir $builddir $arch | ||
346 | ;; | 353 | ;; |
347 | *) | 354 | *) |
348 | echo "An unsupported architecture option: $arch" | 355 | echo "An unsupported architecture option: $arch" |
349 | exit | 356 | exit |
350 | ;; | 357 | ;; |
351 | esac | 358 | esac |
359 | done | ||
360 | |||
361 | # show the summaries: | ||
362 | cat $builddir/summary-* | ||
363 | rm $builddir/summary-* | ||
352 | 364 | ||
353 | echo "Cleaning up build folder" | ||
354 | cleardir $builddir | ||
355 | echo "" | 365 | echo "" |
356 | echo "Done!" | 366 | echo "Done!" |
357 | echo "" | 367 | echo "" |
358 | echo "Make your PATH include $pathadd" | 368 | echo "Make your PATH include $pathadd" |
359 | 369 | echo "" | |
360 | done | ||
361 | |||
362 | # show the summaries: | ||
363 | cat $builddir/summary-* | ||