1
0
Fork 0
forked from len0rd/rockbox

Added "select a language" stuff

Made the extra_defines a bit different (to prevent it from growing all
the time on "configure update" invokes)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2341 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2002-09-20 06:38:38 +00:00
parent 20963dd801
commit ebe963d554

113
tools/configure vendored
View file

@ -11,8 +11,6 @@
target=$1 target=$1
debug=$2 debug=$2
extra_defines="-"
if test "$1" = "--help"; then if test "$1" = "--help"; then
echo "Rockbox configure script." echo "Rockbox configure script."
echo "Invoke this in a directory to generate a Makefile to build Rockbox" echo "Invoke this in a directory to generate a Makefile to build Rockbox"
@ -92,8 +90,9 @@ sed > Makefile \
-e "s,@DISPLAY@,${display},g" \ -e "s,@DISPLAY@,${display},g" \
-e "s,@KEYPAD@,${keypad},g" \ -e "s,@KEYPAD@,${keypad},g" \
-e "s,@PWD@,${pwd},g" \ -e "s,@PWD@,${pwd},g" \
-e "s,@LANGUAGE@,${language},g" \
-e "s,@SIMVER@,${simver},g" \ -e "s,@SIMVER@,${simver},g" \
-e "s,@EXTRA_DEFINES@,\"${extra_defines}\",g" \ -e "s,@EXTRA_DEFINES@,${extra_defines},g" \
<<EOF <<EOF
## Automaticly generated. http://rockbox.haxx.se ## Automaticly generated. http://rockbox.haxx.se
@ -104,6 +103,7 @@ DISPLAY=@DISPLAY@
KEYPAD=@KEYPAD@ KEYPAD=@KEYPAD@
THISDIR="@PWD@" THISDIR="@PWD@"
SIMVER=@SIMVER@ SIMVER=@SIMVER@
LANGUAGE=@LANGUAGE@
VERSION=\$(shell date +%y%m%d-%H%M) VERSION=\$(shell date +%y%m%d-%H%M)
EXTRA_DEFINES=@EXTRA_DEFINES@ EXTRA_DEFINES=@EXTRA_DEFINES@
@ -112,7 +112,7 @@ EXTRA_DEFINES=@EXTRA_DEFINES@
all: sim all: sim
sim: sim:
\$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) EXTRA_DEFINES=\$(EXTRA_DEFINES) \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
clean: clean:
\$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean \$(MAKE) -C \$(SIMDIR) DISPLAY=\$(DISPLAY) KEYPAD=\$(KEYPAD) OBJDIR=\$(THISDIR) clean
@ -151,6 +151,7 @@ if [ "$target" = "update" ]; then
echo "Existing generated Makefile found. Getting defaults from it." echo "Existing generated Makefile found. Getting defaults from it."
target=`grep "^TARGET=" Makefile | cut -d= -f2-` target=`grep "^TARGET=" Makefile | cut -d= -f2-`
debug=`grep "^DEBUG=" Makefile | cut -d= -f2-` debug=`grep "^DEBUG=" Makefile | cut -d= -f2-`
language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-`
extra_defines=`grep "^EXTRA_DEFINES=" Makefile | cut -d= -f2-` extra_defines=`grep "^EXTRA_DEFINES=" Makefile | cut -d= -f2-`
if [ "$debug" = "SIMULATOR=1" ]; then if [ "$debug" = "SIMULATOR=1" ]; then
@ -206,28 +207,25 @@ if [ -z "$target" ]; then
esac esac
fi fi
if [ "-" = "$extra_defines" ]; then if [ -z "$extra_defines" ]; then
extra_defines="" if [ "-DARCHOS_RECORDER" = "$target" ] ; then
disable_demos="-DDISABLE_NOTHING"
disable_games=""
if [ "-DARCHOS_RECORDER" = "$target" ] ; then echo "Do you want to use Demos? (Y)"
getit=`input`;
if [ "n" = "$getit" -o "N" = "$getit" ] ; then
disable_demos="-DDISABLE_DEMOS"
fi
echo "Do you want to use Demos? (Y)" echo "Do you want to play Games? (Y)"
getit=`input`; getit=`input`;
if [ "n" = "$getit" -o "N" = "$getit" ] ; then if [ "n" = "$getit" -o "N" = "$getit" ] ; then
extra_defines="$extra_defines -DDISABLE_DEMOS" disable_games=" -DDISABLE_GAMES"
else fi
extra_defines="$extra_defines"
fi
echo "Do you want to play Games? (Y)" extra_defines="$disable_demos$disable_games"
getit=`input`; fi
if [ "n" = "$getit" -o "N" = "$getit" ] ; then
extra_defines="$extra_defines -DDISABLE_GAMES"
else
extra_defines="$extra_defines"
fi
fi
fi fi
@ -288,25 +286,68 @@ fi
appsfile="credits.c" # a file to check for in the apps root dir appsfile="credits.c" # a file to check for in the apps root dir
for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do
if [ -f $dir/$appsfile ]; then if [ -f $dir/$appsfile ]; then
appsdir=$dir appsdir=$dir
break break
fi fi
done done
if [ -z "$appsdir" ]; then if [ -z "$appsdir" ]; then
echo "This script couldn't find your apps directory. Please enter the" echo "This script couldn't find your apps directory. Please enter the"
echo "full path to the apps directory here:" echo "full path to the apps directory here:"
appsdir=`input` appsdir=`input`
fi fi
picklang() {
# figure out which languages that are around
for file in $appsdir/lang/*.lang; do
clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
langs="$langs $clean"
done
num=1
for one in $langs; do
echo "$num. $one"
num=`expr $num + 1`
done
read pick
return $pick;
}
whichlang() {
num=1
for one in $langs; do
if [ "$num" = "$pick" ]; then
echo $one
return
fi
num=`expr $num + 1`
done
}
if [ -z "$language" ]; then
echo "Select a number for the language to use (default is english)"
picklang
language=`whichlang`
if [ -z "$language" ]; then
# pick a default
language="english"
fi
fi
sed > Makefile \ sed > Makefile \
-e "s,@FIRMDIR@,${firmdir},g" \ -e "s,@FIRMDIR@,${firmdir},g" \
-e "s,@APPSDIR@,${appsdir},g" \ -e "s,@APPSDIR@,${appsdir},g" \
-e "s,@DEBUG@,${debug},g" \ -e "s,@DEBUG@,${debug},g" \
-e "s,@TARGET@,${target},g" \ -e "s,@TARGET@,${target},g" \
-e "s,@EXTRA_DEFINES@,\"${extra_defines}\",g" \ -e "s,@LANGUAGE@,${language},g" \
-e "s,@EXTRA_DEFINES@,${extra_defines},g" \
-e "s,@PWD@,${pwd},g" \ -e "s,@PWD@,${pwd},g" \
<<EOF <<EOF
## Automaticly generated. http://rockbox.haxx.se ## Automaticly generated. http://rockbox.haxx.se
@ -316,6 +357,7 @@ APPSDIR=@APPSDIR@
DEBUG=@DEBUG@ DEBUG=@DEBUG@
TARGET=@TARGET@ TARGET=@TARGET@
THISDIR="@PWD@" THISDIR="@PWD@"
LANGUAGE=@LANGUAGE@
VERSION=\$(shell date +%y%m%d-%H%M) VERSION=\$(shell date +%y%m%d-%H%M)
EXTRA_DEFINES=@EXTRA_DEFINES@ EXTRA_DEFINES=@EXTRA_DEFINES@
@ -324,10 +366,10 @@ EXTRA_DEFINES=@EXTRA_DEFINES@
all: firmware apps all: firmware apps
firmware: firmware:
\$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES=\$(EXTRA_DEFINES) \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES="\$(EXTRA_DEFINES)"
apps: apps:
\$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) EXTRA_DEFINES=\$(EXTRA_DEFINES) \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES=\$(EXTRA_DEFINES)
clean-firmware: clean-firmware:
\$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean
@ -350,8 +392,3 @@ tags:
EOF EOF
echo "Created Makefile" echo "Created Makefile"