diff options
Diffstat (limited to 'misc/buildroot/toolchain/dependencies/dependencies.sh')
-rwxr-xr-x | misc/buildroot/toolchain/dependencies/dependencies.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/misc/buildroot/toolchain/dependencies/dependencies.sh b/misc/buildroot/toolchain/dependencies/dependencies.sh index 6f42a8746..c071fddc0 100755 --- a/misc/buildroot/toolchain/dependencies/dependencies.sh +++ b/misc/buildroot/toolchain/dependencies/dependencies.sh @@ -1,6 +1,6 @@ #!/bin/sh # vi: set sw=4 ts=4: -#set -x +# set -x echo "" echo "Checking build system dependencies:" @@ -165,7 +165,8 @@ if [ -z "$COMPILER" ] ; then exit 1; fi; -COMPILER_VERSION=$($COMPILER --version 2>&1 | head -n1 | $XSED -e 's/^.*(.CC) \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g") +COMPILER_VERSION=$($COMPILER -v 2>&1 | $XSED -n '/^gcc version/p' | + $XSED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') if [ -z "$COMPILER_VERSION" ] ; then echo "gcc installed: FALSE" /bin/echo -e "\n\nYou must install 'gcc' on your build machine\n"; @@ -182,9 +183,9 @@ echo "C compiler version '$COMPILER_VERSION': Ok" # check for host CXX -CXXCOMPILER=$(which $HOSTCXX) +CXXCOMPILER=$(which $HOSTCXX 2>/dev/null) if [ -z "$CXXCOMPILER" ] ; then - CXXCOMPILER=$(which c++) + CXXCOMPILER=$(which c++ 2>/dev/null) fi if [ -z "$CXXCOMPILER" ] ; then echo "C++ Compiler installed: FALSE" @@ -192,7 +193,8 @@ if [ -z "$CXXCOMPILER" ] ; then #exit 1 fi if [ ! -z "$CXXCOMPILER" ] ; then - CXXCOMPILER_VERSION=$($CXXCOMPILER --version 2>&1 | head -n1 | $XSED -e 's/^.*(.CC) \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g") + CXXCOMPILER_VERSION=$($CXXCOMPILER -v 2>&1 | $XSED -n '/^gcc version/p' | + $XSED -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q') if [ -z "$CXXCOMPILER_VERSION" ] ; then echo "c++ installed: FALSE" /bin/echo -e "\nYou may have to install 'g++' on your build machine\n" |