Bug 1460620 Have MinGW look for d3dcompiler_47.dll (so it will be packaged) r?Build draft
authorTom Ritter <tom@mozilla.com>
Thu, 10 May 2018 10:48:06 -0500
changeset 793964 a6196c4f53fa7aafa0eaba8eacd524f10834ba33
parent 793963 305a20eef129f7f81ceb44eb0dc7347928b98d95
child 793965 c79fa7a63aefc6c7efc12834ef8e7fed2ad3216b
child 795361 8c7829919595f92aa51a9afbc2464353d731e4f8
push id109543
push userbmo:tom@mozilla.com
push dateFri, 11 May 2018 03:12:45 +0000
reviewersBuild
bugs1460620
milestone60.0
Bug 1460620 Have MinGW look for d3dcompiler_47.dll (so it will be packaged) r?Build MozReview-Commit-ID: 6gwSSPhT3IA
build/moz.configure/toolchain.configure
old-configure.in
old mode 100755
new mode 100644
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1302,16 +1302,17 @@ def is_windows(target, host):
 
 include('windows.configure', when=is_windows)
 
 # Shader Compiler for Windows (and MinGW Cross Compile)
 # ==============================================================
 
 fxc = check_prog('FXC', ('fxc.exe', 'fxc2.exe'), when=depends(target)
                  (lambda t: t.kernel == 'WINNT'))
+add_old_configure_assignment('FXC', fxc)
 wine = check_prog('WINE', ['wine'], when=depends(target, host)
                   (lambda t, h: t.kernel == 'WINNT' and h.kernel == 'Linux'))
 
 # Security Hardening
 # ==============================================================
 
 js_option('--enable-address-sanitizer', help='Enable Address Sanitizer')
 
--- a/old-configure.in
+++ b/old-configure.in
@@ -2731,43 +2731,55 @@ if test -n "$MOZ_ANGLE_RENDERER"; then
     AC_MSG_ERROR([Couldn't determine MOZ_D3D_CPU_SUFFIX.])
   fi
 
   ######################################
   # 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*)
+  if test "$OS_ARCH" != "$HOST_OS_ARCH"; then
     MOZ_D3DCOMPILER_VISTA_DLL=d3dcompiler_47.dll
-    AC_MSG_RESULT([Found D3D compiler in Windows SDK.])
-  ;;
-  esac
+    AC_MSG_RESULT([Assuming D3D compiler will be in fxc2.])
+  else
+    case "$MOZ_WINSDK_MAXVER" in
+    0x0603*|0x0A00*)
+      MOZ_D3DCOMPILER_VISTA_DLL=d3dcompiler_47.dll
+      AC_MSG_RESULT([Found D3D compiler in Windows SDK.])
+    ;;
+    esac
+  fi
 
   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"
       if test -f "$MOZ_D3DCOMPILER_VISTA_DLL_PATH"; then
         AC_MSG_RESULT([Found MOZ_D3DCOMPILER_VISTA_DLL_PATH: $MOZ_D3DCOMPILER_VISTA_DLL_PATH])
         MOZ_HAS_WINSDK_WITH_D3D=1
       else
         AC_MSG_RESULT([MOZ_D3DCOMPILER_VISTA_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_VISTA_DLL_PATH])
         AC_MSG_ERROR([Windows SDK at "$WINDOWSSDKDIR" appears broken. Try updating to MozillaBuild 1.9 final or higher.])
         MOZ_D3DCOMPILER_VISTA_DLL_PATH=
       fi
     else
-      AC_MSG_RESULT([Windows SDK not found.])
+      MOZ_D3DCOMPILER_VISTA_DLL_PATH="$(dirname $FXC)/$MOZ_D3DCOMPILER_VISTA_DLL"
+      if test -f "$MOZ_D3DCOMPILER_VISTA_DLL_PATH"; then
+        AC_MSG_RESULT([Found MOZ_D3DCOMPILER_VISTA_DLL_PATH: $MOZ_D3DCOMPILER_VISTA_DLL_PATH])
+      else
+        AC_MSG_RESULT([MOZ_D3DCOMPILER_VISTA_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_VISTA_DLL_PATH])
+        AC_MSG_ERROR([fxc2 or "$MOZ_D3DCOMPILER_VISTA_DLL" seem to be missing from the expected location.])
+        MOZ_D3DCOMPILER_VISTA_DLL_PATH=
+      fi
     fi
   else
     if test "$OS_ARCH" = "$HOST_OS_ARCH"; then
       AC_MSG_ERROR([Couldn't find Windows SDK 8.1 or higher needed for ANGLE.])
     else
-      AC_MSG_RESULT([Windows SDK not needed for ANGLE in Linux MinGW build.])
+      AC_MSG_ERROR([We should need "$MOZ_D3DCOMPILER_VISTA_DLL" for ANGLE in Linux MinGW build, but we didn't look for it.])
     fi
   fi
 
   if test -z "$MOZ_D3DCOMPILER_VISTA_DLL_PATH"; then
     MOZ_D3DCOMPILER_VISTA_DLL=
   fi
 
   # On mingw, check if headers are provided by toolchain.
@@ -2779,20 +2791,18 @@ if test -n "$MOZ_ANGLE_RENDERER"; then
   # Check that we found what we needed.
   MOZ_FOUND_A_D3D_COMPILER=
 
   if test -n "$MOZ_D3DCOMPILER_VISTA_DLL"; then
     MOZ_FOUND_A_D3D_COMPILER=1
     AC_MSG_RESULT([Found d3dcompiler DLL for Vista+: $MOZ_D3DCOMPILER_VISTA_DLL])
   fi
 
-  if test -z "$CROSS_COMPILE"; then
-    if test -z "MOZ_FOUND_A_D3D_COMPILER"; then
-      AC_MSG_ERROR([Couldn't find an acceptable D3D compiler DLL.])
-    fi
+  if test -z "MOZ_FOUND_A_D3D_COMPILER"; then
+    AC_MSG_ERROR([Couldn't find an acceptable D3D compiler DLL.])
   fi
 fi # MOZ_ANGLE_RENDERER
 
 fi # COMPILE_ENVIRONMENT
 
 
 dnl ========================================================
 dnl Gamepad support