Commit 5d027b5b authored by Jim Harris's avatar Jim Harris
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I44680ac83f165f8d4d8ef6448c0a7d7aa93b85e7

Reviewed-on: https://review.gerrithub.io/399262


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 15e2fa5d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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