From eb149041e833afa918d624d219c0e0311f590b3e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 26 Feb 2016 06:33:16 +0100 Subject: prereq: fatal error when no C/C++ compiler found --- scripts/prereq.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/prereq.sh') diff --git a/scripts/prereq.sh b/scripts/prereq.sh index 3bcc8a361..97a0bc136 100755 --- a/scripts/prereq.sh +++ b/scripts/prereq.sh @@ -114,12 +114,17 @@ for compilerbin in $compilerbins; do if which $compilerbin >/dev/null; then printf "found\n" CC=$compilerbin + CCFOUND=1 break else printf "not found\n" continue fi done +if [ -z "$CCFOUND" ]; then + printf "ERROR: no C compiler found. Fatal error.\n" + exit 1 +fi # check for c++ compiler compilerbins="clang++ c++ g++" @@ -128,12 +133,17 @@ for compilerbin in $compilerbins; do if which $compilerbin >/dev/null; then printf "found\n" CXX=$compilerbin + CXXFOUND=1 break else printf "not found\n" continue fi done +if [ -z "$CXXFOUND" ]; then + printf "ERROR: no C++ compiler found. Fatal error.\n" + exit 1 +fi gnu_host_name=$(${CC} -dumpmachine) -- cgit v1.2.3