From 5d027b5b06292bb72369e26e919064811ffa0459 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 9 Feb 2018 15:09:03 -0700 Subject: [PATCH] build: fix detect_cc.sh script for icc icc -v prints out its version string like this: icc version 18.0.1 (gcc version 5.0.0 compatibility) detect_cc.sh gets confused and does this in the generated mk/cc.mk: CC_TYPE=icc gcc So fix detect_cc.sh to only use the first entry with head -1. Signed-off-by: Jim Harris Change-Id: I44680ac83f165f8d4d8ef6448c0a7d7aa93b85e7 Reviewed-on: https://review.gerrithub.io/399262 Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System --- scripts/detect_cc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/detect_cc.sh b/scripts/detect_cc.sh index 6c13213b0..1c2742a0f 100755 --- a/scripts/detect_cc.sh +++ b/scripts/detect_cc.sh @@ -52,8 +52,8 @@ for i in "$@"; do esac done -CC_TYPE=$($CC -v 2>&1 | grep -o -E '\w+ version' | awk '{ print $1 }') -CXX_TYPE=$($CXX -v 2>&1 | grep -o -E '\w+ version' | awk '{ print $1 }') +CC_TYPE=$($CC -v 2>&1 | grep -o -E '\w+ version' | head -1 | awk '{ print $1 }') +CXX_TYPE=$($CXX -v 2>&1 | grep -o -E '\w+ version' | head -1 | awk '{ print $1 }') LD_TYPE=$(ld -v 2>&1 | awk '{print $2}') if [ "$CC_TYPE" != "$CXX_TYPE" ]; then