Bug 1031352 - share the logic for determining what MSVC DLLs to package; r=glandium

This commit is contained in:
Nathan Froyd 2014-06-27 11:24:29 -04:00
parent d1d52d93ee
commit df8d19459d
6 changed files with 22 additions and 40 deletions

View File

@ -23,7 +23,9 @@ DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
# Set MSVC dlls version to package, if any.
ifdef WIN32_REDIST_DIR
ifdef MOZ_NO_DEBUG_RTL
DEFINES += -DMOZ_MSVC_REDIST=$(_MSC_VER)
DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
endif
endif

View File

@ -69,15 +69,9 @@
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
#endif
#ifdef XP_WIN32
#if MOZ_MSVC_REDIST == 1600
@BINPATH@/msvcp100.dll
@BINPATH@/msvcr100.dll
#elif MOZ_MSVC_REDIST == 1700
@BINPATH@/msvcp110.dll
@BINPATH@/msvcr110.dll
#elif MOZ_MSVC_REDIST == 1800
@BINPATH@/msvcp120.dll
@BINPATH@/msvcr120.dll
#if MOZ_PACKAGE_MSVC_DLLS
@BINPATH@/@MSVC_C_RUNTIME_DLL@
@BINPATH@/@MSVC_CXX_RUNTIME_DLL@
#endif
#endif
#ifdef MOZ_SHARED_MOZGLUE

View File

@ -72,7 +72,9 @@ DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
# Set MSVC dlls version to package, if any.
ifdef WIN32_REDIST_DIR
ifdef MOZ_NO_DEBUG_RTL
DEFINES += -DMOZ_MSVC_REDIST=$(_MSC_VER)
DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
endif
endif

View File

@ -85,15 +85,9 @@
#endif
#ifdef XP_WIN32
@BINPATH@/plugin-hang-ui@BIN_SUFFIX@
#if MOZ_MSVC_REDIST == 1600
@BINPATH@/msvcp100.dll
@BINPATH@/msvcr100.dll
#elif MOZ_MSVC_REDIST == 1700
@BINPATH@/msvcp110.dll
@BINPATH@/msvcr110.dll
#elif MOZ_MSVC_REDIST == 1800
@BINPATH@/msvcp120.dll
@BINPATH@/msvcr120.dll
#if MOZ_PACKAGE_MSVC_DLLS
@BINPATH@/@MSVC_C_RUNTIME_DLL@
@BINPATH@/@MSVC_CXX_RUNTIME_DLL@
#endif
#endif
#ifndef MOZ_NATIVE_ICU

View File

@ -8,35 +8,17 @@ include $(topsrcdir)/config/rules.mk
ifdef WIN32_REDIST_DIR
ifeq (1600,$(_MSC_VER))
REDIST_FILES = \
msvcp100.dll \
msvcr100.dll \
$(MSVC_C_RUNTIME_DLL) \
$(MSVC_CXX_RUNTIME_DLL) \
$(NULL)
endif
ifeq (1700,$(_MSC_VER))
REDIST_FILES = \
msvcp110.dll \
msvcr110.dll \
$(NULL)
endif
ifeq (1800,$(_MSC_VER))
REDIST_FILES = \
msvcp120.dll \
msvcr120.dll \
$(NULL)
endif
ifdef REDIST_FILES
libs-preqs = \
$(call mkdir_deps,$(FINAL_TARGET)) \
$(NULL)
libs:: $(libs-preqs)
install --preserve-timestamps $(foreach f,$(REDIST_FILES),'$(WIN32_REDIST_DIR)'/$(f)) $(FINAL_TARGET)
endif
endif # WIN32_REDIST_DIR

View File

@ -481,16 +481,24 @@ case "$target" in
if test "$_CC_MAJOR_VERSION" = "16"; then
_CC_SUITE=10
MSVS_VERSION=2010
MSVC_C_RUNTIME_DLL=msvcr100.dll
MSVC_CXX_RUNTIME_DLL=msvcp100.dll
elif test "$_CC_MAJOR_VERSION" = "17"; then
_CC_SUITE=11
MSVS_VERSION=2012
MSVC_C_RUNTIME_DLL=msvcr110.dll
MSVC_CXX_RUNTIME_DLL=msvcp110.dll
elif test "$_CC_MAJOR_VERSION" = "18"; then
_CC_SUITE=12
MSVS_VERSION=2013
MSVC_C_RUNTIME_DLL=msvcr120.dll
MSVC_CXX_RUNTIME_DLL=msvcp120.dll
else
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
AC_SUBST(MSVS_VERSION)
AC_SUBST(MSVC_C_RUNTIME_DLL)
AC_SUBST(MSVC_CXX_RUNTIME_DLL)
# Disable SEH on clang-cl because it doesn't implement them yet.
if test -z "$CLANG_CL"; then