Bug 1521691 - Remove _MSC_VER from configure. r=chmanchester

The only use in configure itself is for a MSVC version check that is now
always true (we don't accept versions < 19.15 anymore).

The only uses in the build system are in code that could just use
CC_TYPE instead.

Differential Revision: https://phabricator.services.mozilla.com/D17207

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-01-23 00:35:10 +00:00
Родитель b4fc89763a
Коммит 03a6fa8570
6 изменённых файлов: 24 добавлений и 36 удалений

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

@ -106,13 +106,13 @@ VERSION_NUMBER = 50
CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
ifdef _MSC_VER
ifeq (msvc,$(CC_TYPE))
# clang-cl is smart enough to generate dependencies directly.
ifeq (,$(CLANG_CL)$(MOZ_USING_SCCACHE))
ifeq (,$(MOZ_USING_SCCACHE))
CC_WRAPPER ?= $(call py_action,cl)
CXX_WRAPPER ?= $(call py_action,cl)
endif # CLANG_CL/MOZ_USING_SCCACHE
endif # _MSC_VER
endif # MOZ_USING_SCCACHE
endif # CC_TYPE
CC := $(CC_WRAPPER) $(CC)
CXX := $(CXX_WRAPPER) $(CXX)
@ -300,7 +300,7 @@ WIN32_EXE_LDFLAGS += $(WIN32_CONSOLE_EXE_LDFLAGS)
endif
endif # WINNT
ifdef _MSC_VER
ifneq (,$(filter msvc clang-cl,$(CC_TYPE)))
ifeq ($(CPU_ARCH),x86_64)
# Normal operation on 64-bit Windows needs 2 MB of stack. (Bug 582910)
# ASAN requires 6 MB of stack.

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

@ -674,7 +674,7 @@ endif
$(HOST_SHARED_LIBRARY): Makefile
$(REPORT_BUILD)
$(RM) $@
ifdef _MSC_VER
ifneq (,$(filter msvc clang-cl,$(HOST_CC_TYPE)))
$(HOST_LINKER) -NOLOGO -DLL -OUT:$@ $($(notdir $@)_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LINKER_LIBPATHS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CXX) $(HOST_OUTOPTION)$@ $($(notdir $@)_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)

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

@ -159,21 +159,17 @@ case "$target" in
_MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
changequote([,])
_MSC_VER=`echo ${CC_VERSION} | cut -c 1-2,4-5`
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 "$_MSC_VER" -ge "1910"; then # VS2017+
# C5038: Enable initializer list order warnings
# The -w1#### flag treats warning C#### as if it was a warning level
# 1 warning, and thus enables it because we enable /W3 warnings. We
# don't use -we#### because it would enable warning C#### but treat
# it as an error, even in third-party code.
# https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level
CXXFLAGS="$CXXFLAGS -w15038"
fi
# C5038: Enable initializer list order warnings
# The -w1#### flag treats warning C#### as if it was a warning level
# 1 warning, and thus enables it because we enable /W3 warnings. We
# don't use -we#### because it would enable warning C#### but treat
# it as an error, even in third-party code.
# https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level
CXXFLAGS="$CXXFLAGS -w15038"
_CC_SUITE=14
MSVC_C_RUNTIME_DLL=vcruntime140.dll
@ -266,8 +262,6 @@ if test -n "$SBCONF"; then
fi
AC_SUBST(QEMU_CANT_RUN_JS_SHELL)
AC_SUBST(_MSC_VER)
AC_SUBST(GNU_CC)
AC_SUBST(GNU_CXX)

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

@ -160,8 +160,6 @@ case "$target" in
_MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
changequote([,])
_MSC_VER=`echo ${CC_VERSION} | cut -c 1-2,4-5`
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.
@ -175,15 +173,13 @@ case "$target" in
AC_DEFINE(MSVC_HAS_DIA_SDK)
fi
if test "$_MSC_VER" -ge "1910"; then # VS2017+
# C5038: Enable initializer list order warnings
# The -w1#### flag treats warning C#### as if it was a warning level
# 1 warning, and thus enables it because we enable /W3 warnings. We
# don't use -we#### because it would enable warning C#### but treat
# it as an error, even in third-party code.
# https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level
CXXFLAGS="$CXXFLAGS -w15038"
fi
# C5038: Enable initializer list order warnings
# The -w1#### flag treats warning C#### as if it was a warning level
# 1 warning, and thus enables it because we enable /W3 warnings. We
# don't use -we#### because it would enable warning C#### but treat
# it as an error, even in third-party code.
# https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level
CXXFLAGS="$CXXFLAGS -w15038"
# C5026: move constructor was implicitly defined as deleted
CXXFLAGS="$CXXFLAGS -wd5026"
@ -295,8 +291,6 @@ fi
fi # COMPILE_ENVIRONMENT
AC_SUBST(_MSC_VER)
AC_SUBST(GNU_CC)
AC_SUBST(GNU_CXX)

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

@ -172,7 +172,7 @@ def check_nsmodules(target, binary):
if target is HOST or not is_libxul(binary):
raise Skip()
symbols = []
if buildconfig.substs.get('_MSC_VER'):
if buildconfig.substs.get('CC_TYPE') in ('msvc', 'clang-cl'):
for line in get_output('dumpbin.exe', '-exports', binary):
data = line.split(None, 3)
if data and len(data) == 4 and data[0].isdigit() and \
@ -240,7 +240,7 @@ def check_nsmodules(target, binary):
# MSVC linker, when doing incremental linking, adds padding when
# merging sections. Allow there to be more space between the NSModule
# symbols, as long as they are in the right order.
test_msvc = (buildconfig.substs.get('_MSC_VER') and \
test_msvc = (buildconfig.substs.get('CC_TYPE') in ('msvc', 'clang-cl') and \
buildconfig.substs.get('DEVELOPER_OPTIONS'))
test_clang = (buildconfig.substs.get('CC_TYPE') == 'clang' and \
buildconfig.substs.get('OS_ARCH') == 'WINNT')

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

@ -243,7 +243,7 @@ def process_gyp_result(gyp_result, gyp_dir_attrs, path, config, output,
context['UNIFIED_SOURCES'] = alphabetical_sorted(unified_sources)
defines = target_conf.get('defines', [])
if bool(config.substs['_MSC_VER']) and no_chromium:
if config.substs['CC_TYPE'] in ('msvc', 'clang-cl') and no_chromium:
msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, {})
defines.extend(msvs_settings.GetComputedDefines(c))
for define in defines:
@ -380,7 +380,7 @@ class GypProcessor(object):
# gyp expects plain str instead of unicode. The frontend code gives us
# unicode strings, so convert them.
path = encode(path)
if bool(config.substs['_MSC_VER']):
if config.substs['CC_TYPE'] in ('msvc', 'clang-cl'):
# This isn't actually used anywhere in this generator, but it's needed
# to override the registry detection of VC++ in gyp.
os.environ['GYP_MSVS_OVERRIDE_PATH'] = 'fake_path'