Bug 988271 - Fixed D3D SDK detection on mingw. r=mshal,jgilbert
authorJacek Caban <jacek@codeweavers.com>
Mon, 31 Mar 2014 13:21:38 +0200
changeset 194704 c7f461dce4c977372d2c740dfa5c13c6a57a98a5
parent 194703 7807eb5117413480bad9a3744b4e0d10297e9606
child 194705 177637fe281f2b3e8c4609b400ede14c2a591b37
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal, jgilbert
bugs988271
milestone31.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 988271 - Fixed D3D SDK detection on mingw. r=mshal,jgilbert
configure.in
gfx/angle/Makefile.in
gfx/angle/src/libGLESv2/Makefile.in
toolkit/library/Makefile.in
--- a/configure.in
+++ b/configure.in
@@ -5835,16 +5835,20 @@ if test "$OS_TARGET" = "WINNT" -a -z "$C
   if test -n "$MOZ_DIRECTX_SDK_PATH" &&
      test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
     AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
   else
     AC_MSG_RESULT([Couldn't find the DirectX SDK.])
   fi
 fi
 
+# On mingw, check if headers are provided by toolchain.
+if test "$OS_TARGET" = "WINNT" -a -n "$GNU_CC"; then
+  MOZ_CHECK_HEADER(d3d10.h, MOZ_HAS_WINSDK_WITH_D3D=1)
+fi
 
 dnl ========================================================
 dnl D3D compiler DLL
 dnl ========================================================
 
 if test -n "$MOZ_ANGLE_RENDERER"; then
   # Check that our DirectX SDK is acceptable.
   if test -n "$MOZ_DIRECTX_SDK_PATH"; then
@@ -5909,17 +5913,17 @@ if test -n "$MOZ_ANGLE_RENDERER"; then
       AC_MSG_RESULT([Couldn't determine the D3DX9 version for the DirectX SDK.])
     fi
 
     if test -z "$MOZ_D3DCOMPILER_CAB"; then
       AC_MSG_RESULT([Couldn't find a CAB containing the D3D compiler DLL.])
     fi
   fi
 
-  if test -z "$MOZ_D3DCOMPILER_DLL_PATH" -a -z "$MOZ_D3DCOMPILER_CAB"; then
+  if test -z "$MOZ_D3DCOMPILER_DLL_PATH" -a -z "$MOZ_D3DCOMPILER_CAB" -a -z "$CROSS_COMPILE"; then
     AC_MSG_ERROR([Couldn't find an acceptable D3D compiler DLL. Either install Windows SDK 8.0+ and reconfigure with --enable-winsdk-directx, install DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.])
   fi
 fi
 
 
 dnl ========================================================
 dnl Gamepad support
 dnl ========================================================
--- a/gfx/angle/Makefile.in
+++ b/gfx/angle/Makefile.in
@@ -1,16 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 ifdef MOZ_ANGLE_RENDERER
 
 libs::
-ifdef MOZ_HAS_WINSDK_WITH_D3D
+ifdef MOZ_D3DCOMPILER_DLL_PATH
 	cp -fp "$(MOZ_D3DCOMPILER_DLL_PATH)" "$(DIST)/bin"
 else
 ifdef MOZ_D3DCOMPILER_CAB
 	expand '$(MOZ_D3DCOMPILER_CAB)' -F:$(MOZ_D3DCOMPILER_DLL) '$(DIST)/bin'
 endif
 endif
 
 endif
--- a/gfx/angle/src/libGLESv2/Makefile.in
+++ b/gfx/angle/src/libGLESv2/Makefile.in
@@ -1,33 +1,25 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 ifndef GNU_CC
 # Enable unwind semantics for exception handlers in response to warning C4530.
 OS_CPPFLAGS += -EHsc
+else
+OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions
 endif
 
 # End build_angle.gypi transcription.
 
 include $(topsrcdir)/config/rules.mk
 
 ifndef MOZ_HAS_WINSDK_WITH_D3D
 CXXFLAGS += -I'$(MOZ_DIRECTX_SDK_PATH)/include'
 endif
 
-ifdef GNU_CC
-
-OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions
-OS_LIBS += -ld3d9 -ldxguid
-
+ifdef MOZ_HAS_WINSDK_WITH_D3D
+EXTRA_DSO_LDOPTS = $(call EXPAND_LIBNAME,d3d9 dxguid)
 else
-
-ifdef MOZ_HAS_WINSDK_WITH_D3D
-EXTRA_DSO_LDOPTS = d3d9.lib dxguid.lib delayimp.lib
-else
-EXTRA_DSO_LDOPTS = '$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)/d3d9.lib' \
-                   '$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)/dxguid.lib' \
-                   delayimp.lib
+EXTRA_DSO_LDOPTS = $(call EXPAND_LIBNAME_PATH,d3d9 dxguid,$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX))
 endif
-
-endif
+EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME,delayimp)
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -228,28 +228,20 @@ ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet wbemuuid wintrust)
 ifdef ACCESSIBILITY
 OS_LIBS += $(call EXPAND_LIBNAME,oleacc)
 endif
 ifdef MOZ_METRO
 OS_LIBS += $(call EXPAND_LIBNAME,uiautomationcore runtimeobject)
 endif
 ifdef MOZ_GAMEPAD
-ifndef GNU_CC
 ifdef MOZ_HAS_WINSDK_WITH_D3D
-OS_LIBS += dxguid.lib dinput8.lib
+OS_LIBS += $(call EXPAND_LIBNAME,dxguid dinput8)
 else
-DXSDK := $(subst \,/,$(MOZ_DIRECTX_SDK_PATH))/Lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)
-OS_LIBS += \
-  '$(DXSDK)/dxguid.lib' \
-  '$(DXSDK)/dinput8.lib' \
-  $(NULL)
-endif
-else
-OS_LIBS += $(call EXPAND_LIBNAME,dxguid dinput8)
+OS_LIBS += $(call EXPAND_LIBNAME_PATH,dxguid dinput8, $(subst \,/,$(MOZ_DIRECTX_SDK_PATH))/Lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX))
 endif
 endif
 endif # WINNT
 
 ifdef MOZ_JPROF
 EXTRA_DSO_LDOPTS += -ljprof
 endif