summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/rockboxdev.sh67
1 files changed, 38 insertions, 29 deletions
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index d322ef1..fba56d2 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -122,8 +122,13 @@ echo "Install prefix: $prefix/[target] (set RBDEV_PREFIX to change dir)"
echo "Build dir: $builddir (set RBDEV_BUILD to change dir)"
###########################################################################
-# Verify that we can write in the prefix dir, as otherwise we will hardly
-# be able to install there!
+# Verify that the prefix dir exists and that we can write to it,
+# as otherwise we will hardly be able to install there!
+if test ! -d $prefix; then
+ echo "WARNING: The installation destination does not exist."
+ echo "Please create it and re-run this script"
+ exit
+fi
if test ! -w $prefix; then
echo "WARNING: This script is set to install in $prefix but has no write permissions for it"
echo "Please fix this and re-run this script"
@@ -206,32 +211,6 @@ else
pathadd="$bindir"
fi
-summary="summary-$1"
-
-echo "============================ Summary ============================" > $summary
-echo "target: $target" >> $summary
-echo "gcc version: $gccver" >> $summary
-if test -n "$gccpatch"; then
- echo "gcc patch: $gccpatch" >> $summary
-fi
-echo "binutils: $binutils" >> $summary
-echo "installation target: $prefix/$target" >> $summary
-echo "" >> $summary
-echo "When done, append $bindir to PATH" >> $summary
-echo "=================================================================" >> $summary
-
-cat $summary
-
-echo ""
-echo "In case you encounter a slow internet connection, you can use an alternative mirror."
-echo "A list of other GNU mirrors is available here: http://www.gnu.org/prep/ftp.html"
-echo ""
-echo "Usage: GNU_MIRROR=[URL] ./rockboxdev.sh"
-echo ""
-echo "Example:"
-echo "$ GNU_MIRROR=http://mirrors.kernel.org/gnu ./rockboxdev.sh"
-echo ""
-
if test -f "$dlwhere/binutils-$binutils.tar.bz2"; then
echo "binutils $binutils already downloaded"
else
@@ -253,7 +232,7 @@ if test -n "$gccpatch"; then
fi
###########################################################################
-# If there's already a build dir, we don't overwrite it
+# If there's already a build dir, we don't overwrite or delete it
if test -d $builddir; then
echo "You already have a $builddir directory!"
echo "Please remove it and re-run the script"
@@ -263,6 +242,36 @@ else
cd $builddir
fi
+###########################################################################
+# Create a summary file for each toolchain, containing info about the version
+# and a remainder to append the compiler path to PATH
+
+summary="summary-$1"
+
+echo "============================ Summary ============================" > $summary
+echo "target: $target" >> $summary
+echo "gcc version: $gccver" >> $summary
+if test -n "$gccpatch"; then
+ echo "gcc patch: $gccpatch" >> $summary
+fi
+echo "binutils: $binutils" >> $summary
+echo "installation target: $prefix/$target" >> $summary
+echo "" >> $summary
+echo "When done, append $bindir to PATH" >> $summary
+echo "=================================================================" >> $summary
+
+cat $summary
+
+echo ""
+echo "In case you encounter a slow internet connection, you can use an alternative mirror."
+echo "A list of other GNU mirrors is available here: http://www.gnu.org/prep/ftp.html"
+echo ""
+echo "Usage: GNU_MIRROR=[URL] ./rockboxdev.sh"
+echo ""
+echo "Example:"
+echo "$ GNU_MIRROR=http://mirrors.kernel.org/gnu ./rockboxdev.sh"
+echo ""
+
echo "ROCKBOXDEV: extracting binutils-$binutils in $builddir"
tar xjf $dlwhere/binutils-$binutils.tar.bz2