1
0
Fork 0
forked from len0rd/rockbox

Simplied the directory usage. This script now checks for (or asks if it

doesn't find it) the Rockbox source code root directory. All the directories
are then assumed to be placed "correctly" within that source tree.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4705 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2004-05-26 11:07:16 +00:00
parent 4bd2702cad
commit 5c9c16f32f

136
tools/configure vendored
View file

@ -44,30 +44,8 @@ fi
simul () { simul () {
##################################################################
# Figure out where the firmware code is!
#
# a file to check for in the uisimulator root dir
simfile="$simver/lcd-$simver.c"
for dir in uisimulator . .. ../uisimulator ../../uisimulator; do
if [ -f "$dir/$simfile" ]; then
simdir="$dir/$simver"
break
fi
done
if [ -z "$simdir" ]; then
echo "This script couldn't find your uisimulator/$simver directory. Please enter the"
echo "full path to your uisimulator/$simver directory here:"
simdir=`input`
fi
sed > Makefile \ sed > Makefile \
-e "s,@SIMDIR@,${simdir},g" \ -e "s,@ROOTDIR@,${rootdir},g" \
-e "s,@TOOLSDIR@,${toolsdir},g" \
-e "s,@TARGET@,${target},g" \ -e "s,@TARGET@,${target},g" \
-e "s,@ARCHOS@,${archos},g" \ -e "s,@ARCHOS@,${archos},g" \
-e "s,@DEBUG@,${debug},g" \ -e "s,@DEBUG@,${debug},g" \
@ -80,8 +58,9 @@ sed > Makefile \
## Automaticly generated. http://rockbox.haxx.se ## Automaticly generated. http://rockbox.haxx.se
ARCHOS=@ARCHOS@ ARCHOS=@ARCHOS@
SIMDIR=@SIMDIR@ ROOTDIR=@ROOTDIR@
TOOLSDIR=@TOOLSDIR@ SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@
TOOLSDIR=\$(ROOTDIR)/tools
DEBUG=@DEBUG@ DEBUG=@DEBUG@
TARGET=@TARGET@ TARGET=@TARGET@
DISPLAY=@DISPLAY@ DISPLAY=@DISPLAY@
@ -120,7 +99,7 @@ EOF
picklang() { picklang() {
# figure out which languages that are around # figure out which languages that are around
for file in $appsdir/lang/*.lang; do for file in $rootdir/apps/lang/*.lang; do
clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1` clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
langs="$langs $clean" langs="$langs $clean"
done done
@ -200,6 +179,7 @@ if [ "$target" = "update" ]; then
debug=`grep "^DEBUG=" Makefile | cut -d= -f2-` debug=`grep "^DEBUG=" Makefile | cut -d= -f2-`
language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-` language=`grep "^LANGUAGE=" Makefile | cut -d= -f2-`
memory=`grep "^MEMORYSIZE=" Makefile | cut -d= -f2-` memory=`grep "^MEMORYSIZE=" Makefile | cut -d= -f2-`
rootdir=`grep "^ROOTDIR=" Makefile | cut -d= -f2-`
if [ "$debug" = "SIMULATOR=1" ]; then if [ "$debug" = "SIMULATOR=1" ]; then
simulator="yes" simulator="yes"
@ -330,81 +310,38 @@ if [ -z "$debug" ]; then
esac esac
fi fi
################################################################## if [ -z "$rootdir" ]; then
# Figure out where the firmware code is! ##################################################################
# # Figure out where the source code root is!
#
firmfile="crt0.S" # a file to check for in the firmware root dir firmfile="crt0.S" # a file to check for in the firmware root dir
for dir in firmware . .. ../firmware ../../firmware; do for dir in . .. ../..; do
if [ -f $dir/$firmfile ]; then if [ -f $dir/firmware/$firmfile ]; then
firmdir=$dir rootdir=$dir
break break
fi
done
if [ -z "$firmdir" ]; then
echo "This script couldn't find your firmware directory. Please enter the"
echo "full path to the firmware directory here:"
firmdir=`input`
fi
##################################################################
# Figure out where the apps code is!
#
appsfile="credits.c" # a file to check for in the apps root dir
for dir in apps . .. ../apps ../../apps $firmdir/apps $firmdir/../apps; do
if [ -f $dir/$appsfile ]; then
appsdir=$dir
break
fi
done
if [ -z "$appsdir" ]; then
echo "This script couldn't find your apps directory. Please enter the"
echo "full path to the apps directory here:"
appsdir=`input`
fi
##################################################################
# Figure out where the tools directory is!
#
toolsfile="descramble.c" # a file to check for in the tools root dir
for dir in tools . .. ../tools ../../tools $firmdir/tools $firmdir/../tools; do
if [ -f $dir/$toolsfile ]; then
toolsdir="$dir"
break
fi
done
if [ -z "$toolsdir" ]; then
# no file found, check if (some of) the necessary tools are in the PATH
# already
toolsexe="scramble"
for dir in `echo $PATH | tr ':' ' '`; do
if [ -x "$dir/$toolsexe" ]; then
echo "found $toolsexe in $dir"
toolsdir="$dir"
break
fi fi
done done
if [ -z "$rootdir" ]; then
echo "This script couldn't find your source code root directory. Please enter the"
echo "full path to the source code directory here:"
firmdir=`input`
fi
#####################################################################
# Convert the possibly relative directory name to an absolute version
#
now=`pwd`
cd $rootdir
rootdir=`pwd`
# cd back to the build dir
cd $now
fi fi
if [ -z "$toolsdir" ]; then
echo "This script couldn't find your tools directory. Please enter the"
echo "full path to the tools directory here:"
toolsdir=`input`
fi
if [ -z "$language" ]; then if [ -z "$language" ]; then
@ -427,9 +364,7 @@ if [ "yes" = "$simulator" ]; then
fi fi
sed > Makefile \ sed > Makefile \
-e "s,@FIRMDIR@,${firmdir},g" \ -e "s,@ROOTDIR@,${rootdir},g" \
-e "s,@APPSDIR@,${appsdir},g" \
-e "s,@TOOLSDIR@,${toolsdir},g" \
-e "s,@DEBUG@,${debug},g" \ -e "s,@DEBUG@,${debug},g" \
-e "s,@MEMORY@,${memory},g" \ -e "s,@MEMORY@,${memory},g" \
-e "s,@TARGET@,${target},g" \ -e "s,@TARGET@,${target},g" \
@ -439,9 +374,10 @@ sed > Makefile \
<<EOF <<EOF
## Automaticly generated. http://rockbox.haxx.se ## Automaticly generated. http://rockbox.haxx.se
FIRMDIR=@FIRMDIR@ ROOTDIR=@ROOTDIR@
APPSDIR=@APPSDIR@ FIRMDIR=\$(ROOTDIR)/firmware
TOOLSDIR=@TOOLSDIR@ APPSDIR=\$(ROOTDIR)/apps
TOOLSDIR=\$(ROOTDIR)/tools
DEBUG=@DEBUG@ DEBUG=@DEBUG@
ARCHOS=@ARCHOS@ ARCHOS=@ARCHOS@
TARGET=@TARGET@ TARGET=@TARGET@