Bug 1314979 Support cross compilation with MINGW in windows.configure r=glandium
authorTom Ritter <tom@mozilla.com>
Wed, 19 Apr 2017 10:18:01 -0500
changeset 353975 c943802a5256597fb7d68b324b2a19830b39864d
parent 353974 6b358acc1617db268cc31dea6bea25b94cfcad5a
child 353976 bfafda79fbd58907921a8b1fb59ac752b3d55fc4
push id31683
push usercbook@mozilla.com
push dateThu, 20 Apr 2017 09:11:32 +0000
treeherdermozilla-central@20325547884a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1314979
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1314979 Support cross compilation with MINGW in windows.configure r=glandium 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
@@ -3112,29 +3112,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
   ;;