Bug 1313787 - Find relevant dlls on Windows when packaging an artifact build. r=glandium draft
authorChris Manchester <cmanchester@mozilla.com>
Tue, 08 Nov 2016 11:29:03 -0800
changeset 435455 c6c05993f85ffd5ddc824f2f8d4efa1187a2dbce
parent 431796 8c9eed5227f8681cf08d2ee8fb3bfd5d743e4096
child 536322 08f91a1902c6a13ff7a4ae77c891779122f89627
push id35053
push userbmo:cmanchester@mozilla.com
push dateTue, 08 Nov 2016 19:29:16 +0000
reviewersglandium
bugs1313787
milestone52.0a1
Bug 1313787 - Find relevant dlls on Windows when packaging an artifact build. r=glandium MozReview-Commit-ID: KJq8ouh6Umi
browser/installer/Makefile.in
old-configure.in
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -145,16 +145,28 @@ endif
 ifeq (x86,$(CPU_ARCH))
 ifdef _MSC_VER
 ifndef CLANG_CL
 DEFINES += -DWOW_HELPER
 endif
 endif
 endif
 
+# When packaging an artifact build, we haven't gone through the configure
+# parts necessary to know about the dlls we might need, so for the following
+# dlls, their presence in the objdir is enough to mean they should be packaged.
+ifdef MOZ_ARTIFACT_BUILDS
+DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
+DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL_NAME)
+DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL_NAME)
+DEFINES += -DMOZ_PACKAGE_WIN_UCRT_DLLS=1
+DEFINES += -DMOZ_ANGLE_RENDERER=1
+DEFINES += -DMOZ_D3DCOMPILER_VISTA_DLL=$(MOZ_D3DCOMPILER_VISTA_DLL_NAME)
+DEFINES += -DMOZ_D3DCOMPILER_XP_DLL=$(notdir $(filter-out $(MOZ_D3DCOMPILER_VISTA_DLL_NAME),$(wildcard $(BINPATH)/D3DCompiler_*.dll)))
+endif
 
 # Builds using the hybrid FasterMake/RecursiveMake backend will
 # fail to produce a langpack. See bug 1255096.
 libs::
 ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
 	$(MAKE) -C $(DEPTH)/browser/locales langpack
 endif
 
--- a/old-configure.in
+++ b/old-configure.in
@@ -174,16 +174,23 @@ esac
 AC_SUBST(ANDROID_SOURCE)
 AC_SUBST(ANDROID_PACKAGE_NAME)
 AC_SUBST(OBJCOPY)
 
 dnl ========================================================
 dnl Checks for compilers.
 dnl ========================================================
 
+MSVC_C_RUNTIME_DLL_NAME=vcruntime140.dll
+MSVC_CXX_RUNTIME_DLL_NAME=msvcp140.dll
+MOZ_D3DCOMPILER_VISTA_DLL_NAME=d3dcompiler_47.dll
+AC_SUBST(MSVC_C_RUNTIME_DLL_NAME)
+AC_SUBST(MSVC_CXX_RUNTIME_DLL_NAME)
+AC_SUBST(MOZ_D3DCOMPILER_VISTA_DLL_NAME)
+
 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
 AR_FLAGS='crs $@'
 
 if test "$COMPILE_ENVIRONMENT"; then
 
 if test "$target" != "$host"; then
     MOZ_CROSS_COMPILER
 else
@@ -255,18 +262,18 @@ case "$target" in
         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.
 
         case "$CC_VERSION" in
         19*)
             _CC_SUITE=14
             MSVS_VERSION=2015
-            MSVC_C_RUNTIME_DLL=vcruntime140.dll
-            MSVC_CXX_RUNTIME_DLL=msvcp140.dll
+            MSVC_C_RUNTIME_DLL="$MSVC_C_RUNTIME_DLL_NAME"
+            MSVC_CXX_RUNTIME_DLL="$MSVC_CXX_RUNTIME_DLL_NAME"
 
             MOZ_CHECK_HEADER(dia2.h, MSVC_HAS_DIA_SDK=1)
             if test -n "$MSVC_HAS_DIA_SDK"; then
                 AC_DEFINE(MSVC_HAS_DIA_SDK)
             fi
 
             # C5026: move constructor was implicitly defined as deleted
             CXXFLAGS="$CXXFLAGS -wd5026"
@@ -3366,17 +3373,17 @@ if test -n "$MOZ_ANGLE_RENDERER"; then
 
   ######################################
   # Find _46+ for use by Vista+.
 
   # Find a D3D compiler DLL in a Windows SDK.
   MOZ_D3DCOMPILER_VISTA_DLL=
   case "$MOZ_WINSDK_MAXVER" in
   0x0603*|0x0A00*)
-    MOZ_D3DCOMPILER_VISTA_DLL=d3dcompiler_47.dll
+    MOZ_D3DCOMPILER_VISTA_DLL="$MOZ_D3DCOMPILER_VISTA_DLL_NAME"
     AC_MSG_RESULT([Found D3D compiler in Windows SDK.])
   ;;
   esac
 
   if test -n "$MOZ_D3DCOMPILER_VISTA_DLL"; then
     # We have a name, now track down the path.
     if test -n "$WINDOWSSDKDIR"; then
       MOZ_D3DCOMPILER_VISTA_DLL_PATH="$WINDOWSSDKDIR/Redist/D3D/$MOZ_D3D_CPU_SUFFIX/$MOZ_D3DCOMPILER_VISTA_DLL"