Bug 1314979 Support cross compilation with MINGW in windows.configure draft
authorTom Ritter <tom@mozilla.com>
Wed, 19 Apr 2017 10:18:01 -0500
changeset 565122 3ede6331d9aca8e1af06b4501d85b0e0d3e30218
parent 560921 f40e24f40b4c4556944c762d4764eace261297f5
child 624927 5a42748ceff9e94ccda0cedd381216c0c0ee2102
push id54797
push userbmo:tom@mozilla.com
push dateWed, 19 Apr 2017 15:18:24 +0000
bugs1314979
milestone55.0a1
Bug 1314979 Support cross compilation with MINGW in windows.configure MINGW builds do not need any of the checks that are performed in the windows.configure file. Nor do they the D3D compiler DLL that is needed for ANGLE, so we can skip that entire section in old-configure.in. MozReview-Commit-ID: DqufbgGoGy4
build/moz.configure/toolchain.configure
old-configure.in
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -962,13 +962,15 @@ def wrap_system_includes(target, visibil
 
 set_define('HAVE_VISIBILITY_HIDDEN_ATTRIBUTE',
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_define('HAVE_VISIBILITY_ATTRIBUTE',
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
 set_config('VISIBILITY_FLAGS', visibility_flags)
 
-@depends(target)
-def is_windows(target):
-    return target.kernel == 'WINNT'
+# We only want to include windows.configure when we are compiling on
+# Windows, for Windows.
+@depends(target, host)
+def is_windows(target, host):
+    return host.kernel == 'WINNT' and target.kernel == 'WINNT'
 
 include('windows.configure', when=is_windows)
--- a/old-configure.in
+++ b/old-configure.in
@@ -3113,29 +3113,31 @@ dnl ====================================
 MOZ_ARG_DISABLE_BOOL(universalchardet,
 [  --disable-universalchardet
                           Disable universal encoding detection],
   MOZ_UNIVERSALCHARDET=,
   MOZ_UNIVERSALCHARDET=1 )
 
 dnl ========================================================
 dnl = ANGLE OpenGL->D3D translator for WebGL
-dnl = * only applies to win32
+dnl = * only applies to win32 (and then, not MINGW)
 dnl ========================================================
 
 MOZ_ANGLE_RENDERER=
 MOZ_D3D_CPU_SUFFIX=
 MOZ_HAS_WINSDK_WITH_D3D=
 MOZ_D3DCOMPILER_VISTA_DLL=
 MOZ_D3DCOMPILER_VISTA_DLL_PATH=
 
 if test "$COMPILE_ENVIRONMENT" ; then
 case "$target_os" in
 *mingw*)
-    MOZ_ANGLE_RENDERER=1
+    if test "$OS_ARCH" = "$HOST_OS_ARCH"; then
+      MOZ_ANGLE_RENDERER=1
+    fi
     ;;
 esac
 
 # The DirectX SDK libraries are split into x86 and x64 sub-directories
 case "${target_cpu}" in
 i*86)
   MOZ_D3D_CPU_SUFFIX=x86
   ;;