Commit second version of FS#9158 (Tomer Shalev) with spelling fix

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18168 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2008-08-01 11:19:29 +00:00
parent 72b8d7ad76
commit a33be543e0

View file

@ -23,12 +23,6 @@ else
make="make" make="make"
fi fi
# Use an alternative mirror in case you encounter a slow internet connection.
# List of other GNU mirrors available in http://www.gnu.org/prep/ftp.html
#
# Usage example:
# # GNU_MIRROR=http://mirrors.kernel.org/gnu ./rockboxdev.sh
#
if [ -z $GNU_MIRROR ] ; then if [ -z $GNU_MIRROR ] ; then
GNU_MIRROR=ftp://ftp.gnu.org/pub/gnu GNU_MIRROR=ftp://ftp.gnu.org/pub/gnu
fi fi
@ -49,7 +43,7 @@ findtool(){
IFS=":" IFS=":"
for path in $PATH for path in $PATH
do do
# echo "checks for $file in $path" >&2 # echo "Checks for $file in $path" >&2
if test -f "$path/$file"; then if test -f "$path/$file"; then
echo "$path/$file" echo "$path/$file"
return return
@ -70,28 +64,27 @@ getfile() {
tool=`findtool wget` tool=`findtool wget`
if test -n "$tool"; then if test -n "$tool"; then
# wget download # wget download
echo "ROCKBOXDEV: downloads $2/$1 using wget" echo "ROCKBOXDEV: Downloading $2/$1 using wget"
$tool -O $dlwhere/$1 $2/$1 $tool -O $dlwhere/$1 $2/$1
fi fi
else else
# curl download # curl download
echo "ROCKBOXDEV: downloads $2/$1 using curl" echo "ROCKBOXDEV: Downloading $2/$1 using curl"
$tool -Lo $dlwhere/$1 $2/$1 $tool -Lo $dlwhere/$1 $2/$1
fi fi
if test -z "$tool"; then if test -z "$tool"; then
echo "ROCKBOXDEV: couldn't find any downloader tool to use!" echo "ROCKBOXDEV: No downloader tool found!"
echo "ROCKBOXDEV: install curl or wget and re-run the script" echo "ROCKBOXDEV: Please install curl or wget and re-run the script"
exit exit
fi fi
} }
for t in $reqtools; do for t in $reqtools; do
tool=`findtool $t` tool=`findtool $t`
if test -z "$tool"; then if test -z "$tool"; then
echo "ROCKBOXDEV: $t is required for this script to work. Please" echo "ROCKBOXDEV: $t is required for this script to work."
echo "ROCKBOXDEV: install and re-run the script." echo "ROCKBOXDEV: Please install $t and re-run the script."
exit exit
fi fi
done done
@ -120,8 +113,8 @@ echo "Build dir: $builddir (edit script to change dir)"
# Verify that we can write in the prefix dir, as otherwise we will hardly # Verify that we can write in the prefix dir, as otherwise we will hardly
# be able to install there! # be able to install there!
if test ! -w $prefix; then if test ! -w $prefix; then
echo "WARNING: this script is set to install in $prefix but has no" echo "WARNING: This script is set to install in $prefix but has no write permissions for it"
echo "WARNING: write permission to do so! Please fix and re-run this script" echo "Please fix this and re-run this script"
exit exit
fi fi
@ -129,7 +122,8 @@ fi
########################################################################### ###########################################################################
# If there's already a build dir, we don't overwrite it # If there's already a build dir, we don't overwrite it
if test -d $builddir; then if test -d $builddir; then
echo "you have a $builddir dir already, please remove and rerun" echo "You already have a $builddir directory!"
echo "Please remove it and re-run the script"
exit exit
fi fi
@ -141,6 +135,7 @@ cleardir () {
buildone () { buildone () {
arch=$1
gccpatch="" # default is no gcc patch gccpatch="" # default is no gcc patch
gccver="4.0.3" # default gcc version gccver="4.0.3" # default gcc version
binutils="2.16.1" # The binutils version to use binutils="2.16.1" # The binutils version to use
@ -149,7 +144,7 @@ gccconfigure="" #default is nothing added to configure
system=`uname -s` system=`uname -s`
gccurl="http://www.rockbox.org/gcc" gccurl="http://www.rockbox.org/gcc"
case $1 in case $arch in
[Ss]) [Ss])
target="sh-elf" target="sh-elf"
gccpatch="gcc-4.0.3-rockbox-1.diff" gccpatch="gcc-4.0.3-rockbox-1.diff"
@ -184,7 +179,7 @@ case $1 in
gccconfigure="--disable-libssp" gccconfigure="--disable-libssp"
;; ;;
*) *)
echo "unsupported" echo "An unsupported architecture option: $arch"
exit exit
;; ;;
esac esac
@ -201,18 +196,30 @@ cd $builddir
summary="summary-$1" summary="summary-$1"
echo "== Summary ==" > $summary echo "============================ Summary ============================" > $summary
echo "Target: $target" >> $summary echo "target: $target" >> $summary
echo "gcc $gccver" >> $summary echo "gcc version: $gccver" >> $summary
if test -n "$gccpatch"; then if test -n "$gccpatch"; then
echo "gcc patch $gccpatch" >> $summary echo "gcc patch: $gccpatch" >> $summary
fi fi
echo "binutils $binutils" >> $summary echo "binutils: $binutils" >> $summary
echo "install in $prefix/$target" >> $summary echo "installation target: $prefix/$target" >> $summary
echo "when complete, make your PATH include $bindir" >> $summary echo "" >> $summary
echo "When done, append $bindir to PATH" >> $summary
echo "=================================================================" >> $summary
cat $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 if test -f "$dlwhere/binutils-$binutils.tar.bz2"; then
echo "binutils $binutils already downloaded" echo "binutils $binutils already downloaded"
else else
@ -276,13 +283,15 @@ cd .. # get out of $builddir
echo "" echo ""
echo "Select target arch:" echo "Select target arch:"
echo "s - sh (Archos models)" echo "s - sh (Archos models)"
echo "i - mips (Jz4740 and ATJ-based players)"
echo "m - m68k (iriver h1x0/h3x0, ifp7x0 and iaudio)" echo "m - m68k (iriver h1x0/h3x0, ifp7x0 and iaudio)"
echo "a - arm (ipods, iriver H10, Sansa, etc)" echo "a - arm (ipods, iriver H10, Sansa, etc)"
echo "i - mips (Jz4740 and ATJ-based players)"
echo "all - all three compilers" echo "all - all three compilers"
echo ""
arch=`input` arch=`input`
echo ""
case $arch in case $arch in
[Ss]) [Ss])
buildone $arch buildone $arch
@ -297,7 +306,8 @@ case $arch in
buildone $arch buildone $arch
;; ;;
all) all)
echo "build ALL compilers!" echo "Building all compilers..."
echo ""
buildone s buildone s
cleardir $builddir cleardir $builddir
@ -313,11 +323,12 @@ case $arch in
cat $builddir/summary-* cat $builddir/summary-*
;; ;;
*) *)
echo "unsupported architecture option" echo "An unsupported architecture option: $arch"
exit exit
;; ;;
esac esac
echo "done" echo ""
echo "Done!"
echo "" echo ""
echo "Make your PATH include $pathadd" echo "Make your PATH include $pathadd"