diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-11-29 10:39:30 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-11-29 10:39:30 +0000 |
commit | 3bc31e85b12fabcecdb30f894d514f42c2326998 (patch) | |
tree | 0f08e4aa44403a4c0881e7f36b3de4c3c5128af6 /toolchain | |
parent | cff93989619df834c3d869f1038df54c186c026e (diff) |
- move check for which(1) before it's first use
- fix printing a message when erroring out on non-existing HOSTCC
Diffstat (limited to 'toolchain')
-rwxr-xr-x | toolchain/dependencies/dependencies.sh | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/toolchain/dependencies/dependencies.sh b/toolchain/dependencies/dependencies.sh index 2e031b019..64c10530c 100755 --- a/toolchain/dependencies/dependencies.sh +++ b/toolchain/dependencies/dependencies.sh @@ -1,6 +1,5 @@ #!/bin/sh -set -e #set -x echo "" @@ -31,6 +30,19 @@ XSED=$HOST_SED_DIR/bin/sed ############################################################# # +# check build system 'which' +# +############################################################# +if ! which which > /dev/null ; then + echo "which installed: FALSE" + echo -e "\n\nYou must install 'which' on your build machine\n"; + exit 1; +fi; +echo "which installed: Ok" + + +############################################################# +# # check build system 'make' # ############################################################# @@ -64,12 +76,13 @@ echo "GNU make version '$MAKE_VERSION': Ok" COMPILER=$(which $HOSTCC) if [ -z "$COMPILER" ] ; then COMPILER=$(which cc) - if [ -z "$COMPILER" ] ; then - echo "gcc installed: FALSE" - echo -e "\n\nYou must install 'gcc' on your build machine\n"; - exit 1; - fi; fi; +if [ -z "$COMPILER" ] ; then + echo "C Compiler installed: FALSE" + echo -e "\n\nYou must install 'gcc' on your build machine\n"; + exit 1; +fi; + COMPILER_VERSION=$($COMPILER --version 2>&1 | head -n1 | $XSED -e 's/^.*(.CC) \([0-9\.]\)/\1/g' -e "s/[-\ ].*//g") if [ -z "$COMPILER_VERSION" ] ; then echo "gcc installed: FALSE" @@ -82,23 +95,10 @@ if [ $COMPILER_MAJOR -lt 3 -o $COMPILER_MAJOR -eq 2 -a $COMPILER_MINOR -lt 95 ] echo "You have gcc '$COMPILER_VERSION' installed. gcc >= 2.95 is required" exit 1; fi; -echo "gcc version '$COMPILER_VERSION': Ok" - - +echo "C compiler '$COMPILER'" +echo "C compiler version '$COMPILER_VERSION': Ok" -############################################################# -# -# check build system 'which' -# -############################################################# -if ! which which > /dev/null ; then - echo "which installed: FALSE" - echo -e "\n\nYou must install 'which' on your build machine\n"; - exit 1; -fi; -echo "which installed: Ok" - ############################################################# # |