# HG changeset patch
# User nemo
# Date 1369763881 14400
# Node ID 604273fb8a5870092f5e202d5c2627cd72ed8b3b
# Parent  b055f250f1e633842da2e5000b87a78fe40bb639# Parent  24a2da6e5a22ff432c119cc6af793a46762e3599
*hate*

diff -r b055f250f1e6 -r 604273fb8a58 CMakeLists.txt
--- a/CMakeLists.txt	Tue May 28 13:57:11 2013 -0400
+++ b/CMakeLists.txt	Tue May 28 13:58:01 2013 -0400
@@ -211,6 +211,10 @@
 
 #set default flags values for all projects (unless MINIMAL_FLAGS is true)
 if(NOT ${MINIMAL_FLAGS})
+    if(WINDOWS)
+        #this flags prevents a few dll hell problems
+        set(CMAKE_C_FLAGS "-static-libgcc ${CMAKE_C_FLAGS}")
+    endif(WINDOWS)
     set(CMAKE_C_FLAGS "-pipe ${CMAKE_C_FLAGS}")
     set(CMAKE_C_FLAGS_RELEASE "-w -Os -fomit-frame-pointer ${CMAKE_C_FLAGS_RELEASE}")
     set(CMAKE_C_FLAGS_DEBUG "-Wall -O0 -g -DDEBUG ${CMAKE_C_FLAGS_DEBUG}")
diff -r b055f250f1e6 -r 604273fb8a58 tools/build_windows.bat
--- a/tools/build_windows.bat	Tue May 28 13:57:11 2013 -0400
+++ b/tools/build_windows.bat	Tue May 28 13:58:01 2013 -0400
@@ -13,7 +13,8 @@
 if %BUILD_TYPE%=="Debug" (
     for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
 )
-for %%G in (QtCore4 QtGui4 QtNetwork4 libgcc_s_dw2-1 mingwm10) do (
+:: should you libgcc dynamically you should try adding libgcc_s_dw2-1 and mingwm10
+for %%G in (QtCore4 QtGui4 QtNetwork4) do (
     xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
 )
 
diff -r b055f250f1e6 -r 604273fb8a58 tools/w32DownloadUnzip.vbs
--- a/tools/w32DownloadUnzip.vbs	Tue May 28 13:57:11 2013 -0400
+++ b/tools/w32DownloadUnzip.vbs	Tue May 28 13:58:01 2013 -0400
@@ -7,6 +7,7 @@
 ' References
 '   http://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line
 '   http://stackoverflow.com/questions/1021557/how-to-unzip-a-file-using-the-command-line
+'   http://stackoverflow.com/questions/424331/get-the-current-temporary-directory-path-in-vbscript
 
 Set ArgObj = WScript.Arguments
 
@@ -23,7 +24,8 @@
     End if
 End if
 
-strHDLocation = "C:\Windows\Temp\temp.zip"
+' Temporary directory
+strHDLocation = WScript.CreateObject("Scripting.FileSystemObject").GetSpecialFolder(2) + "\hwlibtemp.zip"
 
 ' Fetch the file
 WScript.Echo ( "Trying to download from " & strFileURL)
@@ -37,7 +39,7 @@
     objADOStream.Type = 1 'adTypeBinary
 
     objADOStream.Write objXMLHTTP.ResponseBody
-    objADOStream.Position = 0    'Set the stream position to the start
+    objADOStream.Position = 0 'Set the stream position to the start
 
     Set objFSO = Createobject("Scripting.FileSystemObject")
     If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
@@ -46,12 +48,12 @@
     objADOStream.SaveToFile strHDLocation
     objADOStream.Close
     Set objADOStream = Nothing
+    Set objXMLHTTP = Nothing
 Else
     WScript.Echo ("Error downloading file (error code: " & objXMLHTTP.Status & ")")
     Set objXMLHTTP = Nothing
     WScript.Quit
 End if
-Set objXMLHTTP = Nothing
 
 WScript.Echo ( "Extracting file to " & strOutputPath)
 Set objShell = CreateObject( "Shell.Application" )