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
This commit is contained in:
Jens Arnold 2008-10-06 23:04:31 +00:00
parent 20fb47ec77
commit 7433f843e7

23
tools/configure vendored
View file

@ -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@