From 31e0cd67ff903bd2ea592dfeb9b2119ad556f03c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 22 Apr 2003 22:18:57 +0000 Subject: made the script detect the toolsdir and pass that on to the sub-makefiles git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3579 a1c6a512-1295-4272-9138-f99709370657 --- tools/configure | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'tools/configure') diff --git a/tools/configure b/tools/configure index e3f678a95c..99f1d7dbf6 100755 --- a/tools/configure +++ b/tools/configure @@ -375,6 +375,42 @@ if [ -z "$appsdir" ]; then 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 + done + +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 echo "Select a number for the language to use (default is english)" @@ -398,6 +434,7 @@ fi sed > Makefile \ -e "s,@FIRMDIR@,${firmdir},g" \ -e "s,@APPSDIR@,${appsdir},g" \ + -e "s,@TOOLSDIR@,${toolsdir},g" \ -e "s,@DEBUG@,${debug},g" \ -e "s,@MEMORY@,${memory},g" \ -e "s,@TARGET@,${target},g" \ @@ -410,6 +447,7 @@ sed > Makefile \ FIRMDIR=@FIRMDIR@ APPSDIR=@APPSDIR@ +TOOLSDIR=@TOOLSDIR@ DEBUG=@DEBUG@ ARCHOS=@ARCHOS@ TARGET=@TARGET@ @@ -424,10 +462,10 @@ EXTRA_DEFINES=@EXTRA_DEFINES@ all: firmware apps firmware: - \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES="\$(EXTRA_DEFINES)" MEM=\$(MEMORYSIZE) + \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) EXTRA_DEFINES="\$(EXTRA_DEFINES)" MEM=\$(MEMORYSIZE) TOOLSDIR=\$(TOOLSDIR) apps: - \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES="\$(EXTRA_DEFINES)" MEM=\$(MEMORYSIZE) + \$(MAKE) -C \$(APPSDIR) TARGET=\$(TARGET) \$(DEBUG) OBJDIR=\$(THISDIR) VERSION=\$(VERSION) LANGUAGE=\$(LANGUAGE) EXTRA_DEFINES="\$(EXTRA_DEFINES)" MEM=\$(MEMORYSIZE) TOOLSDIR=\$(TOOLSDIR) clean-firmware: \$(MAKE) -C \$(FIRMDIR) TARGET=\$(TARGET) OBJDIR=\$(THISDIR) clean -- cgit v1.2.3