Bug 1265627 - Remove now useless version-related assignments from old-configure. r=ted

Also simplify things around some remaining compiler version checks.
This commit is contained in:
Mike Hommey 2016-04-19 15:49:18 +09:00
Родитель dda4822d6f
Коммит b80757a0cb
3 изменённых файлов: 16 добавлений и 60 удалений

Просмотреть файл

@ -9,18 +9,9 @@ GNU_LD=
GNU_CC= GNU_CC=
GNU_CXX= GNU_CXX=
dnl moz.configure ensures that the compilers have the same version
CXX_VERSION=$CC_VERSION
if test "$CC_TYPE" = "gcc"; then if test "$CC_TYPE" = "gcc"; then
GNU_CC=1 GNU_CC=1
GNU_CXX=1 GNU_CXX=1
changequote(<<,>>)
GCC_VERSION_FULL="$CXX_VERSION"
GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/<<$>>1/;'`
GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>1 }'`
GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>2 }'`
changequote([,])
fi fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
@ -31,12 +22,6 @@ if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
GNU_LD=1 GNU_LD=1
fi fi
if test "$CC_TYPE" = "msvc"; then
MSVC_VERSION_FULL="$CXX_VERSION"
CC_VERSION=`echo ${CC_VERSION} | cut -c 1-4`
CXX_VERSION=`echo ${CXX_VERSION} | cut -c 1-4`
fi
CLANG_CC= CLANG_CC=
CLANG_CXX= CLANG_CXX=
CLANG_CL= CLANG_CL=
@ -51,9 +36,7 @@ if test "$CC_TYPE" = "clang-cl"; then
# We force clang-cl to emulate Visual C++ 2013 in configure.in, but that # We force clang-cl to emulate Visual C++ 2013 in configure.in, but that
# is based on the CLANG_CL variable defined here, so make sure that we're # is based on the CLANG_CL variable defined here, so make sure that we're
# getting the right version here manually. # getting the right version here manually.
CC_VERSION=1800 CC_VERSION=180030723
CXX_VERSION=1800
MSVC_VERSION_FULL=180030723
# Build on clang-cl with MSVC 2013 Update 3 with fallback emulation. # Build on clang-cl with MSVC 2013 Update 3 with fallback emulation.
CFLAGS="$CFLAGS -fms-compatibility-version=18.00.30723 -fallback" CFLAGS="$CFLAGS -fms-compatibility-version=18.00.30723 -fallback"
CXXFLAGS="$CXXFLAGS -fms-compatibility-version=18.00.30723 -fallback" CXXFLAGS="$CXXFLAGS -fms-compatibility-version=18.00.30723 -fallback"
@ -158,19 +141,5 @@ if test "$GNU_CXX"; then
fi fi
AC_SUBST(MOZ_NEEDS_LIBATOMIC) AC_SUBST(MOZ_NEEDS_LIBATOMIC)
fi fi
if test -n "$CROSS_COMPILE"; then
dnl moz.configure ensures that the compilers have the same version
HOST_CXX_VERSION=$HOST_CC_VERSION
if test "$HOST_CC_TYPE" = "gcc" ; then
changequote(<<,>>)
HOST_GCC_VERSION_FULL="$HOST_CXX_VERSION"
HOST_GCC_VERSION=`echo "$HOST_GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/<<$>>1/;'`
HOST_GCC_MAJOR_VERSION=`echo ${HOST_GCC_VERSION} | $AWK -F\. '{ print <<$>>1 }'`
HOST_GCC_MINOR_VERSION=`echo ${HOST_GCC_VERSION} | $AWK -F\. '{ print <<$>>2 }'`
changequote([,])
fi
fi
AC_LANG_C AC_LANG_C
]) ])

Просмотреть файл

@ -226,26 +226,19 @@ case "$target" in
_MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p' _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
changequote([,]) changequote([,])
# Determine compiler version _MSC_VER=`echo ${CC_VERSION} | cut -c 1-4`
_CC_MAJOR_VERSION=`echo ${CC_VERSION} | cut -c 1-2`
_CC_MINOR_VERSION=`echo ${CC_VERSION} | cut -c 3-4`
_MSC_VER=${CC_VERSION}
_CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | cut -c 1-2`
if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
fi
AC_DEFINE(_CRT_SECURE_NO_WARNINGS) AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS) AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI. AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
if test "$_CC_MAJOR_VERSION" = "18"; then case "$CC_VERSION" in
18*)
_CC_SUITE=12 _CC_SUITE=12
MSVC_C_RUNTIME_DLL=msvcr120.dll MSVC_C_RUNTIME_DLL=msvcr120.dll
MSVC_CXX_RUNTIME_DLL=msvcp120.dll MSVC_CXX_RUNTIME_DLL=msvcp120.dll
elif test "$_CC_MAJOR_VERSION" = "19"; then ;;
19*)
_CC_SUITE=14 _CC_SUITE=14
MSVC_C_RUNTIME_DLL=vcruntime140.dll MSVC_C_RUNTIME_DLL=vcruntime140.dll
MSVC_CXX_RUNTIME_DLL=msvcp140.dll MSVC_CXX_RUNTIME_DLL=msvcp140.dll
@ -262,7 +255,8 @@ case "$target" in
# Disable C++11 thread-safe statics due to crashes on XP (bug 1204752) # Disable C++11 thread-safe statics due to crashes on XP (bug 1204752)
# See https://connect.microsoft.com/VisualStudio/feedback/details/1789709/visual-c-2015-runtime-broken-on-windows-server-2003-c-11-magic-statics # See https://connect.microsoft.com/VisualStudio/feedback/details/1789709/visual-c-2015-runtime-broken-on-windows-server-2003-c-11-magic-statics
CXXFLAGS="$CXXFLAGS -Zc:threadSafeInit-" CXXFLAGS="$CXXFLAGS -Zc:threadSafeInit-"
fi ;;
esac
AC_SUBST(MSVC_C_RUNTIME_DLL) AC_SUBST(MSVC_C_RUNTIME_DLL)
AC_SUBST(MSVC_CXX_RUNTIME_DLL) AC_SUBST(MSVC_CXX_RUNTIME_DLL)

Просмотреть файл

@ -347,28 +347,20 @@ case "$target" in
_MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p' _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
changequote([,]) changequote([,])
# Determine compiler version _MSC_VER=`echo ${CC_VERSION} | cut -c 1-4`
_CC_MAJOR_VERSION=`echo ${MSVC_VERSION_FULL} | cut -c 1-2`
_CC_MINOR_VERSION=`echo ${MSVC_VERSION_FULL} | cut -c 3-4`
_CC_BUILD_VERSION=`echo ${MSVC_VERSION_FULL} | cut -c 5-`
_MSC_VER=${CC_VERSION}
_CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | cut -c 1-2`
if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
fi
AC_DEFINE(_CRT_SECURE_NO_WARNINGS) AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS) AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI. AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" -ge "30723"; then case "$CC_VERSION" in
18*)
_CC_SUITE=12 _CC_SUITE=12
MSVS_VERSION=2013 MSVS_VERSION=2013
MSVC_C_RUNTIME_DLL=msvcr120.dll MSVC_C_RUNTIME_DLL=msvcr120.dll
MSVC_CXX_RUNTIME_DLL=msvcp120.dll MSVC_CXX_RUNTIME_DLL=msvcp120.dll
elif test "$_CC_MAJOR_VERSION" = "19" -a "$_CC_BUILD_VERSION" -ge "23506"; then ;;
19*)
_CC_SUITE=14 _CC_SUITE=14
MSVS_VERSION=2015 MSVS_VERSION=2015
MSVC_C_RUNTIME_DLL=vcruntime140.dll MSVC_C_RUNTIME_DLL=vcruntime140.dll
@ -404,7 +396,8 @@ case "$target" in
fi fi
WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd -W` WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd -W`
fi fi
fi ;;
esac
AC_SUBST(MSVS_VERSION) AC_SUBST(MSVS_VERSION)
AC_SUBST(MSVC_HAS_DIA_SDK) AC_SUBST(MSVC_HAS_DIA_SDK)
AC_SUBST(MSVC_C_RUNTIME_DLL) AC_SUBST(MSVC_C_RUNTIME_DLL)
@ -1530,7 +1523,7 @@ case "$target" in
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE $cgthreads" PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE $cgthreads"
LDFLAGS="$LDFLAGS -DYNAMICBASE" LDFLAGS="$LDFLAGS -DYNAMICBASE"
RCFLAGS="-nologo" RCFLAGS="-nologo"
if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" = "31101"; then if test "$CC_VERSION" = "180031101"; then
dnl Use MaxILKSize as a workaround for LNK1248 in VS2013update4 dnl Use MaxILKSize as a workaround for LNK1248 in VS2013update4
dnl See https://connect.microsoft.com/VisualStudio/feedback/details/1044914/fatal-error-lnk1248 dnl See https://connect.microsoft.com/VisualStudio/feedback/details/1044914/fatal-error-lnk1248
LDFLAGS="$LDFLAGS -MaxILKSize:0x7FF00000" LDFLAGS="$LDFLAGS -MaxILKSize:0x7FF00000"