summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-10-06 23:04:31 +0000
committerJens Arnold <amiconn@rockbox.org>2008-10-06 23:04:31 +0000
commit7433f843e78d98f63ea0d94e88e3861b36da8000 (patch)
tree1022ce0948a57cba89dce9c89c885285c12e512f
parent20fb47ec778abe215ca69692434ff753596319e6 (diff)
downloadrockbox-7433f843e78d98f63ea0d94e88e3861b36da8000.zip
rockbox-7433f843e78d98f63ea0d94e88e3861b36da8000.tar.gz
rockbox-7433f843e78d98f63ea0d94e88e3861b36da8000.tar.bz2
rockbox-7433f843e78d98f63ea0d94e88e3861b36da8000.tar.xz
Let 'configure' figure out the full path to the various tools if possible. This has the advantage that the toolchain doesn't need to be in the path at build time if it was in the path at configure time, and at the same time it speeds up the build (to a varying degree - most noticeable on Cygwin and Interix).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18723 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xtools/configure23
1 files changed, 21 insertions, 2 deletions
diff --git a/tools/configure b/tools/configure
index 8ce44b0..a3497ac 100755
--- a/tools/configure
+++ b/tools/configure
@@ -64,6 +64,10 @@ findtool(){
return
fi
done
+ # check whether caller wants literal return value if not found
+ if [ "$2" = "--lit" ]; then
+ echo "$file"
+ fi
}
# parse the argument list, returns the value after the = in case of a
@@ -2149,6 +2153,19 @@ else
fi
fi
+# figure out the full path to the various commands if possible
+HOSTCC=`findtool gcc --lit`
+HOSTAR=`findtool ar --lit`
+CC=`findtool ${CC} --lit`
+LD=`findtool ${AR} --lit`
+AR=`findtool ${AR} --lit`
+AS=`findtool ${AS} --lit`
+OC=`findtool ${OC} --lit`
+WINDRES=`findtool ${WINDRES} --lit`
+DLLTOOL=`findtool ${DLLTOOL} --lit`
+DLLWRAP=`findtool ${DLLWRAP} --lit`
+RANLIB=`findtool ${RANLIB} --lit`
+
if test -n "$ccache"; then
CC="$ccache $CC"
fi
@@ -2222,6 +2239,8 @@ sed > Makefile \
-e "s,@LANGUAGE@,${language},g" \
-e "s:@VOICELANGUAGE@:${voicelanguage}:g" \
-e "s,@PWD@,${pwd},g" \
+ -e "s,@HOSTCC@,${HOSTCC},g" \
+ -e "s,@HOSTAR@,${HOSTAR},g" \
-e "s,@CC@,${CC},g" \
-e "s,@LD@,${LD},g" \
-e "s,@AR@,${AR},g" \
@@ -2315,8 +2334,8 @@ export APPEXTRA=@APPEXTRA@
export ENABLEDPLUGINS=@PLUGINS@
export SOFTWARECODECS=@CODECS@
export EXTRA_DEFINES=@EXTRADEF@
-export HOSTCC=gcc
-export HOSTAR=ar
+export HOSTCC=@HOSTCC@
+export HOSTAR=@HOSTAR@
export CC=@CC@
export LD=@LD@
export AR=@AR@