зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
dda4822d6f
Коммит
b80757a0cb
|
@ -9,18 +9,9 @@ GNU_LD=
|
|||
|
||||
GNU_CC=
|
||||
GNU_CXX=
|
||||
dnl moz.configure ensures that the compilers have the same version
|
||||
CXX_VERSION=$CC_VERSION
|
||||
if test "$CC_TYPE" = "gcc"; then
|
||||
GNU_CC=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
|
||||
|
||||
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
|
||||
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_CXX=
|
||||
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
|
||||
# is based on the CLANG_CL variable defined here, so make sure that we're
|
||||
# getting the right version here manually.
|
||||
CC_VERSION=1800
|
||||
CXX_VERSION=1800
|
||||
MSVC_VERSION_FULL=180030723
|
||||
CC_VERSION=180030723
|
||||
# Build on clang-cl with MSVC 2013 Update 3 with fallback emulation.
|
||||
CFLAGS="$CFLAGS -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
|
||||
AC_SUBST(MOZ_NEEDS_LIBATOMIC)
|
||||
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
|
||||
])
|
||||
|
|
|
@ -226,26 +226,19 @@ case "$target" in
|
|||
_MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
|
||||
changequote([,])
|
||||
|
||||
# Determine compiler version
|
||||
_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
|
||||
_MSC_VER=`echo ${CC_VERSION} | cut -c 1-4`
|
||||
|
||||
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
|
||||
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
|
||||
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
|
||||
MSVC_C_RUNTIME_DLL=msvcr120.dll
|
||||
MSVC_CXX_RUNTIME_DLL=msvcp120.dll
|
||||
elif test "$_CC_MAJOR_VERSION" = "19"; then
|
||||
;;
|
||||
19*)
|
||||
_CC_SUITE=14
|
||||
MSVC_C_RUNTIME_DLL=vcruntime140.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)
|
||||
# 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-"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(MSVC_C_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'
|
||||
changequote([,])
|
||||
|
||||
# Determine compiler version
|
||||
_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
|
||||
_MSC_VER=`echo ${CC_VERSION} | cut -c 1-4`
|
||||
|
||||
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
|
||||
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
|
||||
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
|
||||
MSVS_VERSION=2013
|
||||
MSVC_C_RUNTIME_DLL=msvcr120.dll
|
||||
MSVC_CXX_RUNTIME_DLL=msvcp120.dll
|
||||
elif test "$_CC_MAJOR_VERSION" = "19" -a "$_CC_BUILD_VERSION" -ge "23506"; then
|
||||
;;
|
||||
19*)
|
||||
_CC_SUITE=14
|
||||
MSVS_VERSION=2015
|
||||
MSVC_C_RUNTIME_DLL=vcruntime140.dll
|
||||
|
@ -404,7 +396,8 @@ case "$target" in
|
|||
fi
|
||||
WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd -W`
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(MSVS_VERSION)
|
||||
AC_SUBST(MSVC_HAS_DIA_SDK)
|
||||
AC_SUBST(MSVC_C_RUNTIME_DLL)
|
||||
|
@ -1530,7 +1523,7 @@ case "$target" in
|
|||
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE $cgthreads"
|
||||
LDFLAGS="$LDFLAGS -DYNAMICBASE"
|
||||
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 See https://connect.microsoft.com/VisualStudio/feedback/details/1044914/fatal-error-lnk1248
|
||||
LDFLAGS="$LDFLAGS -MaxILKSize:0x7FF00000"
|
||||
|
|
Загрузка…
Ссылка в новой задаче