summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-05-30 08:38:02 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-05-30 08:38:02 +0000
commit2731afa12f8890f541538f677c1cc1b51dda9426 (patch)
tree90154909dca69713181e7bacb603ad1e562473ba /tools
parentd9069ef1de8e56507cac7ee1362b34222232786d (diff)
downloadrockbox-2731afa12f8890f541538f677c1cc1b51dda9426.tar.gz
rockbox-2731afa12f8890f541538f677c1cc1b51dda9426.zip
Added an "all" option that builds all cross-compiler in one go. Expect it to
take a while... ;-) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10017 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/rockboxdev.sh109
1 files changed, 81 insertions, 28 deletions
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index d7328c54c6..42aa5a30d4 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -10,8 +10,9 @@ dlwhere="$HOME/tmp"
10# exists. 10# exists.
11prefix="/usr/local" 11prefix="/usr/local"
12 12
13# The binutils version to use 13# This directory is used to extract all files and to build everything in. It
14binutils="2.16.1" 14# must not exist before this script is invoked (as a security measure).
15builddir="$HOME/build-rbdev"
15 16
16############################################################################## 17##############################################################################
17 18
@@ -76,6 +77,7 @@ fi
76 77
77echo "Download directory: $dlwhere (edit script to change dir)" 78echo "Download directory: $dlwhere (edit script to change dir)"
78echo "Install prefix: $prefix/[target] (edit script to change dir)" 79echo "Install prefix: $prefix/[target] (edit script to change dir)"
80echo "Build dir: $builddir (edit script to change dir)"
79 81
80########################################################################### 82###########################################################################
81# Verify that we can write in the prefix dir, as otherwise we will hardly 83# Verify that we can write in the prefix dir, as otherwise we will hardly
@@ -88,23 +90,26 @@ fi
88 90
89########################################################################### 91###########################################################################
90# If there's already a build dir, we don't overwrite it 92# If there's already a build dir, we don't overwrite it
91if test -d build-rbdev; then 93if test -d $builddir; then
92 echo "you have a build-rbdev dir already, please remove and rerun" 94 echo "you have a $builddir dir already, please remove and rerun"
93 exit 95 exit
94fi 96fi
95 97
96echo "" 98cleardir () {
97echo "Select target arch:" 99 # $1 is the name of the build dir
98echo "s. sh" 100 # delete the build dirs and the source dirs
99echo "m. m68k" 101 rm -rf $1/build-gcc $1/build-binu $1/gcc* $1/binutils*
100echo "a. arm" 102}
101 103
102arch=`input` 104buildone () {
103 105
104case $arch in 106gccpatch="" # default is no gcc patch
107gccver="4.0.3" # default gcc version
108binutils="2.16.1" # The binutils version to use
109
110case $1 in
105 [Ss]) 111 [Ss])
106 target="sh-elf" 112 target="sh-elf"
107 gccver="4.0.3"
108 gccurl="http://www.rockbox.org/twiki/pub/Main/CrossCompiler" 113 gccurl="http://www.rockbox.org/twiki/pub/Main/CrossCompiler"
109 gccpatch="gcc-4.0.3-rockbox-1.diff" 114 gccpatch="gcc-4.0.3-rockbox-1.diff"
110 ;; 115 ;;
@@ -114,7 +119,6 @@ case $arch in
114 ;; 119 ;;
115 [Aa]) 120 [Aa])
116 target="arm-elf" 121 target="arm-elf"
117 gccver="4.0.3"
118 ;; 122 ;;
119 *) 123 *)
120 echo "unsupported" 124 echo "unsupported"
@@ -123,20 +127,28 @@ case $arch in
123esac 127esac
124 128
125bindir="$prefix/$target/bin" 129bindir="$prefix/$target/bin"
126echo "== Summary ==" 130if test -n $pathadd; then
127echo "Target: $target" 131 pathadd="$pathadd:$bindir"
128echo "gcc $gccver" 132else
129if test -n "$gccpatch"; then 133 pathadd="$bindir"
130 echo "gcc patch $gccpatch"
131fi 134fi
132echo "binutils $binutils"
133echo "install in $prefix/$target"
134 135
135echo "when complete, make your PATH include $bindir" 136mkdir $builddir
137cd $builddir
136 138
137echo "" 139summary="summary-$1"
138echo "press ENTER to start" 140
139read input 141echo "== Summary ==" > $summary
142echo "Target: $target" >> $summary
143echo "gcc $gccver" >> $summary
144if test -n "$gccpatch"; then
145 echo "gcc patch $gccpatch" >> $summary
146fi
147echo "binutils $binutils" >> $summary
148echo "install in $prefix/$target" >> $summary
149echo "when complete, make your PATH include $bindir" >> $summary
150
151cat $summary
140 152
141if test -f "$dlwhere/binutils-$binutils.tar.bz2"; then 153if test -f "$dlwhere/binutils-$binutils.tar.bz2"; then
142 echo "binutils $binutils already downloaded" 154 echo "binutils $binutils already downloaded"
@@ -158,8 +170,6 @@ if test -n "$gccpatch"; then
158 fi 170 fi
159fi 171fi
160 172
161mkdir build-rbdev
162cd build-rbdev
163echo "extracting binutils" 173echo "extracting binutils"
164tar xjf $dlwhere/binutils-$binutils.tar.bz2 174tar xjf $dlwhere/binutils-$binutils.tar.bz2
165echo "extracting gcc" 175echo "extracting gcc"
@@ -175,16 +185,59 @@ cd build-binu
175../binutils-$binutils/configure --target=$target --prefix=$prefix/$target 185../binutils-$binutils/configure --target=$target --prefix=$prefix/$target
176make 186make
177make install 187make install
188cd .. # get out of build-binu
178PATH="${PATH}:$bindir" 189PATH="${PATH}:$bindir"
179SHELL=/bin/sh # seems to be needed by the gcc build in some cases 190SHELL=/bin/sh # seems to be needed by the gcc build in some cases
180 191
181cd ../
182mkdir build-gcc 192mkdir build-gcc
183cd build-gcc 193cd build-gcc
184../gcc-$gccver/configure --target=$target --prefix=$prefix/$target --enable-languages=c 194../gcc-$gccver/configure --target=$target --prefix=$prefix/$target --enable-languages=c
185make 195make
186make install 196make install
197cd .. # get out of build-gcc
198cd .. # get out of $builddir
199
200 # end of buildone() function
201}
202
203echo ""
204echo "Select target arch:"
205echo "s - sh"
206echo "m - m68k"
207echo "a - arm"
208echo "all - all three compilers"
209
210arch=`input`
211
212case $arch in
213 [Ss])
214 buildone $arch
215 ;;
216 [Mm])
217 buildone $arch
218 ;;
219 [Aa])
220 buildone $arch
221 ;;
222 all)
223 echo "build ALL compilers!"
224 buildone s
225 cleardir $builddir
226
227 buildone m
228 cleardir $builddir
229
230 buildone a
231
232 # show the summaries:
233 cat $builddir/summary-*
234 ;;
235 *)
236 echo "unsupported architecture option"
237 exit
238 ;;
239esac
187 240
188echo "done" 241echo "done"
189echo "" 242echo ""
190echo "Set your PATH to point to $bindir" 243echo "Make your PATH include $pathadd"