summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/rockboxdev.sh58
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!
127if test ! -d $prefix; then 127if 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
131fi 131fi
132if test ! -w $prefix; then 132if 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
136fi 136fi
@@ -139,8 +139,10 @@ fi
139 139
140cleardir () { 140cleardir () {
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
146buildone () { 148buildone () {
@@ -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
246if test -d $builddir; then 248if 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
250else 253else
251 mkdir -p $builddir 254 mkdir -p $builddir
252 cd $builddir
253fi 255fi
254 256
257cd $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"
283fi 287fi
284 288
285echo "ROCKBOXDEV: mkdir build-binu" 289echo "ROCKBOXDEV: mkdir build-binu-$1"
286mkdir build-binu 290mkdir build-binu-$1
287echo "ROCKBOXDEV: cd build-binu" 291echo "ROCKBOXDEV: cd build-binu-$1"
288cd build-binu 292cd build-binu-$1
289echo "ROCKBOXDEV: binutils/configure" 293echo "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
295echo "ROCKBOXDEV: binutils/make install to $prefix/$target" 299echo "ROCKBOXDEV: binutils/make install to $prefix/$target"
296$make install 300$make install
297cd .. # get out of build-binu 301cd .. # get out of build-binu-$1
298PATH="$bindir:${PATH}" 302PATH="$bindir:${PATH}"
299SHELL=/bin/sh # seems to be needed by the gcc build in some cases 303SHELL=/bin/sh # seems to be needed by the gcc build in some cases
300 304
301echo "ROCKBOXDEV: mkdir build-gcc" 305echo "ROCKBOXDEV: mkdir build-gcc-$1"
302mkdir build-gcc 306mkdir build-gcc-$1
303echo "ROCKBOXDEV: cd build-gcc" 307echo "ROCKBOXDEV: cd build-gcc-$1"
304cd build-gcc 308cd build-gcc-$1
305echo "ROCKBOXDEV: gcc/configure" 309echo "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
313cd .. # get out of build-gcc 317cd .. # get out of build-gcc
314cd .. # get out of $builddir 318cd .. # get out of $builddir
315 319
316 # end of buildone() function 320} # buildone()
317}
318 321
319echo "" 322echo ""
320echo "Select target arch:" 323echo "Select target arch:"
@@ -323,7 +326,7 @@ echo "m - m68k (iriver h1x0/h3x0, ifp7x0 and iaudio)"
323echo "a - arm (ipods, iriver H10, Sansa, etc)" 326echo "a - arm (ipods, iriver H10, Sansa, etc)"
324echo "i - mips (Jz4740 and ATJ-based players)" 327echo "i - mips (Jz4740 and ATJ-based players)"
325echo "separate multiple targets with spaces" 328echo "separate multiple targets with spaces"
326echo "(i.e. \"s m a\" will build sh, m86k and arm)" 329echo "(Example: \"s m a\" will build sh, m86k and arm)"
327echo "" 330echo ""
328 331
329selarch=`input` 332selarch=`input`
@@ -334,30 +337,33 @@ echo ""
334case $arch in 337case $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 ;;
351esac 358esac
359done
360
361# show the summaries:
362cat $builddir/summary-*
363rm $builddir/summary-*
352 364
353echo "Cleaning up build folder"
354cleardir $builddir
355echo "" 365echo ""
356echo "Done!" 366echo "Done!"
357echo "" 367echo ""
358echo "Make your PATH include $pathadd" 368echo "Make your PATH include $pathadd"
359 369echo ""
360done
361
362# show the summaries:
363cat $builddir/summary-*