diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/configure | 147 |
1 files changed, 85 insertions, 62 deletions
diff --git a/tools/configure b/tools/configure index f02866d652..620d9941a7 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -8,34 +8,10 @@ | |||
8 | # $Id$ | 8 | # $Id$ |
9 | # | 9 | # |
10 | 10 | ||
11 | target=$1 | ||
12 | debug=$2 | ||
13 | |||
14 | if test "$1" = "--help"; then | ||
15 | echo "Rockbox configure script." | ||
16 | echo "Invoke this in a directory to generate a Makefile to build Rockbox" | ||
17 | echo "Do *NOT* run this within the tools directory!" | ||
18 | exit | ||
19 | fi | ||
20 | |||
21 | if test -r "configure"; then | ||
22 | # this is a check for a configure script in the current directory, it there | ||
23 | # is one, try to figure out if it is this one! | ||
24 | |||
25 | if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then | ||
26 | echo "WEEEEEEEEP. Don't run this configure script within the tools directory." | ||
27 | echo "It will only cause you pain and grief. Instead do this:" | ||
28 | echo "" | ||
29 | echo " cd .." | ||
30 | echo " mkdir build-dir" | ||
31 | echo " cd build-dir" | ||
32 | echo " ../tools/configure" | ||
33 | echo "" | ||
34 | echo "Much happiness will arise from this. Enjoy" | ||
35 | exit | ||
36 | fi | ||
37 | fi | ||
38 | 11 | ||
12 | # | ||
13 | # Begin Function Definitions | ||
14 | # | ||
39 | input() { | 15 | input() { |
40 | read response | 16 | read response |
41 | echo $response | 17 | echo $response |
@@ -67,7 +43,8 @@ fi | |||
67 | # Figure out where the firmware code is! | 43 | # Figure out where the firmware code is! |
68 | # | 44 | # |
69 | 45 | ||
70 | simfile="$simver/lcd-$simver.c" # a file to check for in the uisimulator root dir | 46 | # a file to check for in the uisimulator root dir |
47 | simfile="$simver/lcd-$simver.c" | ||
71 | 48 | ||
72 | for dir in uisimulator . .. ../uisimulator ../../uisimulator; do | 49 | for dir in uisimulator . .. ../uisimulator ../../uisimulator; do |
73 | if [ -f "$dir/$simfile" ]; then | 50 | if [ -f "$dir/$simfile" ]; then |
@@ -134,6 +111,67 @@ EOF | |||
134 | 111 | ||
135 | } | 112 | } |
136 | 113 | ||
114 | picklang() { | ||
115 | # figure out which languages that are around | ||
116 | for file in $appsdir/lang/*.lang; do | ||
117 | clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1` | ||
118 | langs="$langs $clean" | ||
119 | done | ||
120 | |||
121 | num=1 | ||
122 | for one in $langs; do | ||
123 | echo "$num. $one" | ||
124 | num=`expr $num + 1` | ||
125 | done | ||
126 | |||
127 | read pick | ||
128 | return $pick; | ||
129 | } | ||
130 | |||
131 | whichlang() { | ||
132 | num=1 | ||
133 | for one in $langs; do | ||
134 | if [ "$num" = "$pick" ]; then | ||
135 | echo $one | ||
136 | return | ||
137 | fi | ||
138 | num=`expr $num + 1` | ||
139 | done | ||
140 | } | ||
141 | |||
142 | |||
143 | # | ||
144 | # Beging Build Script | ||
145 | # | ||
146 | |||
147 | target=$1 | ||
148 | debug=$2 | ||
149 | |||
150 | if test "$1" = "--help"; then | ||
151 | echo "Rockbox configure script." | ||
152 | echo "Invoke this in a directory to generate a Makefile to build Rockbox" | ||
153 | echo "Do *NOT* run this within the tools directory!" | ||
154 | exit | ||
155 | fi | ||
156 | |||
157 | if test -r "configure"; then | ||
158 | # this is a check for a configure script in the current directory, it there | ||
159 | # is one, try to figure out if it is this one! | ||
160 | |||
161 | if { grep "^# Jukebox" configure >/dev/null 2>&1 ; } then | ||
162 | echo "WEEEEEEEEP. Don't run this configure script within the tools directory." | ||
163 | echo "It will only cause you pain and grief. Instead do this:" | ||
164 | echo "" | ||
165 | echo " cd .." | ||
166 | echo " mkdir build-dir" | ||
167 | echo " cd build-dir" | ||
168 | echo " ../tools/configure" | ||
169 | echo "" | ||
170 | echo "Much happiness will arise from this. Enjoy" | ||
171 | exit | ||
172 | fi | ||
173 | fi | ||
174 | |||
137 | if [ "$target" = "--help" -o \ | 175 | if [ "$target" = "--help" -o \ |
138 | "$target" = "-h" ]; then | 176 | "$target" = "-h" ]; then |
139 | echo "Just invoke the script and answer the questions." | 177 | echo "Just invoke the script and answer the questions." |
@@ -286,33 +324,11 @@ if [ -z "$appsdir" ]; then | |||
286 | appsdir=`input` | 324 | appsdir=`input` |
287 | fi | 325 | fi |
288 | 326 | ||
289 | picklang() { | 327 | if [ "yes" = "$simulator" ]; then |
290 | # figure out which languages that are around | 328 | # we have already dealt with the simulator Makefile separately |
291 | for file in $appsdir/lang/*.lang; do | 329 | simul |
292 | clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1` | 330 | exit |
293 | langs="$langs $clean" | 331 | fi |
294 | done | ||
295 | |||
296 | num=1 | ||
297 | for one in $langs; do | ||
298 | echo "$num. $one" | ||
299 | num=`expr $num + 1` | ||
300 | done | ||
301 | |||
302 | read pick | ||
303 | return $pick; | ||
304 | } | ||
305 | |||
306 | whichlang() { | ||
307 | num=1 | ||
308 | for one in $langs; do | ||
309 | if [ "$num" = "$pick" ]; then | ||
310 | echo $one | ||
311 | return | ||
312 | fi | ||
313 | num=`expr $num + 1` | ||
314 | done | ||
315 | } | ||
316 | 332 | ||
317 | if [ -z "$language" ]; then | 333 | if [ -z "$language" ]; then |
318 | 334 | ||
@@ -327,13 +343,6 @@ if [ -z "$language" ]; then | |||
327 | fi | 343 | fi |
328 | fi | 344 | fi |
329 | 345 | ||
330 | |||
331 | if [ "yes" = "$simulator" ]; then | ||
332 | # we deal with the simulator Makefile separately | ||
333 | simul | ||
334 | exit | ||
335 | fi | ||
336 | |||
337 | sed > Makefile \ | 346 | sed > Makefile \ |
338 | -e "s,@FIRMDIR@,${firmdir},g" \ | 347 | -e "s,@FIRMDIR@,${firmdir},g" \ |
339 | -e "s,@APPSDIR@,${appsdir},g" \ | 348 | -e "s,@APPSDIR@,${appsdir},g" \ |
@@ -385,3 +394,17 @@ tags: | |||
385 | EOF | 394 | EOF |
386 | 395 | ||
387 | echo "Created Makefile" | 396 | echo "Created Makefile" |
397 | |||
398 | |||
399 | |||
400 | |||
401 | |||
402 | |||
403 | |||
404 | |||
405 | |||
406 | |||
407 | |||
408 | |||
409 | |||
410 | |||