From d389b625839d145d8aa49174a18edfb32f73ccf3 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 18 May 2015 11:54:33 -0700 Subject: Bug 1160125 - Fixed MSVC version detection when CC is set to a wrapper (like sccache). r=ted --- configure | 6 +++++- configure.in | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure b/configure index bb5d359d..11ef5fa9 100755 --- a/configure +++ b/configure @@ -7125,7 +7125,11 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p' - CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + if test -z "$CC_VERSION"; then + as_fn_error $? "Could not determine MSC version." "$LINENO" 5 + fi + _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'` _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'` _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'` diff --git a/configure.in b/configure.in index 8a90df88..78b2f9a6 100644 --- a/configure.in +++ b/configure.in @@ -1936,7 +1936,11 @@ tools are selected during the Xcode/Developer Tools installation.]) changequote(,) _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p' changequote([,]) - CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"` + if test -z "$CC_VERSION"; then + AC_MSG_ERROR([Could not determine MSC version.]) + fi + _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'` _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'` _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'` -- cgit v1.2.1