From 6d61821e3ca6fec96e9e0e5cb2cb827877351cf0 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 2 Sep 2015 09:51:42 -0700 Subject: [PATCH] Visual Studio Projects: Add XP build support when building with Visual Studio 2012+ ONLY when Visual Studio XP support is available. --- Visual Studio Projects/BESM6.vcproj | 6 --- Visual Studio Projects/BuildROMs.vcproj | 6 --- Visual Studio Projects/FrontPanelTest.vcproj | 6 --- Visual Studio Projects/MicroVAX2.vcproj | 2 +- Visual Studio Projects/PDP10.vcproj | 8 +-- Visual Studio Projects/PDP11.vcproj | 6 ++- Visual Studio Projects/Pre-Build-Event.cmd | 50 +++++++++++++------ Visual Studio Projects/VAX.vcproj | 1 + Visual Studio Projects/VAX730.vcproj | 2 + Visual Studio Projects/VAX750.vcproj | 4 +- Visual Studio Projects/VAX780.vcproj | 1 + Visual Studio Projects/VAX8600.vcproj | 1 + .../Win32-Development-Binaries/BuildAll.cmd | 2 +- Visual Studio Projects/isys8010.vcproj | 6 --- Visual Studio Projects/isys8020.vcproj | 6 --- Visual Studio Projects/rtVAX1000.vcproj | 1 + 16 files changed, 52 insertions(+), 56 deletions(-) diff --git a/Visual Studio Projects/BESM6.vcproj b/Visual Studio Projects/BESM6.vcproj index 43463736..b9584ccf 100644 --- a/Visual Studio Projects/BESM6.vcproj +++ b/Visual Studio Projects/BESM6.vcproj @@ -35,9 +35,6 @@ - @@ -119,9 +116,6 @@ - diff --git a/Visual Studio Projects/BuildROMs.vcproj b/Visual Studio Projects/BuildROMs.vcproj index c10374ea..5fc46025 100644 --- a/Visual Studio Projects/BuildROMs.vcproj +++ b/Visual Studio Projects/BuildROMs.vcproj @@ -33,9 +33,6 @@ - @@ -115,9 +112,6 @@ - diff --git a/Visual Studio Projects/FrontPanelTest.vcproj b/Visual Studio Projects/FrontPanelTest.vcproj index 97408243..0e30f2af 100644 --- a/Visual Studio Projects/FrontPanelTest.vcproj +++ b/Visual Studio Projects/FrontPanelTest.vcproj @@ -35,9 +35,6 @@ - @@ -119,9 +116,6 @@ - diff --git a/Visual Studio Projects/MicroVAX2.vcproj b/Visual Studio Projects/MicroVAX2.vcproj index 5148a2c1..5882c94d 100644 --- a/Visual Studio Projects/MicroVAX2.vcproj +++ b/Visual Studio Projects/MicroVAX2.vcproj @@ -161,7 +161,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" - LinkTimeCodeGeneration="0" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/PDP10.vcproj b/Visual Studio Projects/PDP10.vcproj index d7b77e24..2b40715c 100644 --- a/Visual Studio Projects/PDP10.vcproj +++ b/Visual Studio Projects/PDP10.vcproj @@ -35,9 +35,6 @@ - @@ -119,9 +116,6 @@ - @@ -130,6 +124,7 @@ Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="true" + WholeProgramOptimization="true" AdditionalIncludeDirectories="./;../;../PDP10/;../PDP11/;../VAX/;"../../windows-build/PCRE/include/"" PreprocessorDefinitions="USE_INT64;VM_PDP10;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC" StringPooling="true" @@ -160,6 +155,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/PDP11.vcproj b/Visual Studio Projects/PDP11.vcproj index f75077c9..3298a293 100644 --- a/Visual Studio Projects/PDP11.vcproj +++ b/Visual Studio Projects/PDP11.vcproj @@ -124,6 +124,7 @@ Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="true" + WholeProgramOptimization="true" AdditionalIncludeDirectories="./;../;../PDP11/;"../../windows-build/winpcap/Wpdpack/Include";"../../windows-build/PCRE/include/";"../../windows-build/pthreads"" PreprocessorDefinitions="USE_SHARED;USE_DISPLAY;VM_PDP11;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;PTW32_STATIC_LIB;SIM_ASYNCH_IO;USE_READER_THREAD;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC" StringPooling="true" @@ -150,10 +151,11 @@ AdditionalLibraryDirectories=""../../windows-build/winpcap/Wpdpack/Lib/";"../../windows-build/PCRE/lib/"" GenerateDebugInformation="false" SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" StackReserveSize="10485760" StackCommitSize="10485760" + OptimizeReferences="2" + EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/Pre-Build-Event.cmd b/Visual Studio Projects/Pre-Build-Event.cmd index 2ad7336f..1449f386 100644 --- a/Visual Studio Projects/Pre-Build-Event.cmd +++ b/Visual Studio Projects/Pre-Build-Event.cmd @@ -34,27 +34,47 @@ rem if "%~x1" == ".vcproj" goto _done_xp_check if not "%~x1" == ".vcxproj" goto _next_arg +findstr PlatformToolset %1 >NUL +if ERRORLEVEL 1 goto _next_arg findstr PlatformToolset %1 | findstr _xp >NUL if not ERRORLEVEL 1 goto _done_xp_check echo ********************************************************* echo ********************************************************* -echo ** The %~n1.exe binary can't run on windows XP. ** -echo ** Adding Windows XP suppport to the %~n1 project file** +echo warning: The %~n1.exe binary can't run on windows XP. +echo warning: Adding Windows XP suppport to all of the project files echo ********************************************************* echo ********************************************************* +set _XP_Support_Available= +for /r "%PROGRAMDATA%" %%z in (packages\XPSupport\Win_XPSupport.msi) do if exist "%%z" set _XP_Support_Available=1 +if "" == "%_XP_Support_Available%" goto _done_xp_check -echo Set objFSO = CreateObject("Scripting.FileSystemObject") >>%1.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1) >>%1.fix.vbs -echo. >>%1.fix.vbs -echo strText = objFile.ReadAll >>%1.fix.vbs -echo objFile.Close >>%1.fix.vbs -echo strNewText = Replace(strText, "", "_xp") >>%1.fix.vbs -echo. >>%1.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>%1.fix.vbs -echo objFile.Write strNewText >>%1.fix.vbs -echo objFile.Close >>%1.fix.vbs -cscript %1.fix.vbs %1 -del %1.fix.vbs +echo Set objFSO = CreateObject("Scripting.FileSystemObject") >>PlatformToolset.fix.vbs +echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1) >>PlatformToolset.fix.vbs +echo. >>PlatformToolset.fix.vbs +echo strText = objFile.ReadAll >>PlatformToolset.fix.vbs +echo objFile.Close >>PlatformToolset.fix.vbs +echo strNewText = Replace(strText, "", "_xp") >>PlatformToolset.fix.vbs +echo. >>PlatformToolset.fix.vbs +echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>PlatformToolset.fix.vbs +echo objFile.Write strNewText >>PlatformToolset.fix.vbs +echo objFile.Close >>PlatformToolset.fix.vbs +cd +for %%f in (*.vcxproj) do call :_Fix_PlatformToolset %%f +del PlatformToolset.fix.vbs +echo ********************************************************* +echo ********************************************************* +echo Error: Reload the changed projects and start the build again +echo ********************************************************* +echo ********************************************************* +exit /B 1 +:_Fix_PlatformToolset +findstr PlatformToolset %1 >NUL +if ERRORLEVEL 1 exit /B 0 +findstr PlatformToolset %1 | findstr _xp >NUL +if not ERRORLEVEL 1 exit /B 0 +echo Adding XP support to project %1 +cscript PlatformToolset.fix.vbs %1 > NUL 2>&1 +exit /B 0 :_done_xp_check shift @@ -119,7 +139,7 @@ if ERRORLEVEL 1 goto _notice2 if "%_X_LIBSDL%" == "" goto _done_libsdl if not exist ../../windows-build/libSDL/SDL2-2.0.3/include/SDL.h goto _notice2 if not exist "../../windows-build/libSDL/Microsoft DirectX SDK (June 2010)/Lib/x86/dxguid.lib" goto _notice2 -findstr "/c:__FLTUSED__" ..\..\windows-build\libSDL\SDL2-2.0.3\VisualC\SDL_Static\SDL_VS2008.vcproj >NUL +findstr "/c:HAVE_FTOL2_SSE" ..\..\windows-build\libSDL\SDL2-2.0.3\VisualC\SDL_Static\SDL_VS2008.vcproj >NUL if ERRORLEVEL 1 goto _notice2 :_done_libsdl if "%_X_LIBPCRE%" == "" goto _done_libpcre diff --git a/Visual Studio Projects/VAX.vcproj b/Visual Studio Projects/VAX.vcproj index 1f2a2cf0..6d8c96d0 100644 --- a/Visual Studio Projects/VAX.vcproj +++ b/Visual Studio Projects/VAX.vcproj @@ -163,6 +163,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/VAX730.vcproj b/Visual Studio Projects/VAX730.vcproj index 1742d15e..6ecd1c16 100644 --- a/Visual Studio Projects/VAX730.vcproj +++ b/Visual Studio Projects/VAX730.vcproj @@ -126,6 +126,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" + WholeProgramOptimization="true" AdditionalIncludeDirectories="./;../;../VAX/;../pdp11/;"../../windows-build/winpcap/Wpdpack/Include";"../../windows-build/PCRE/include/";"../../windows-build/pthreads"" PreprocessorDefinitions="USE_INT64;USE_ADDR64;VM_VAX;VAX_730;USE_SHARED;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;PTW32_STATIC_LIB;USE_READER_THREAD;SIM_ASYNCH_IO;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC" StringPooling="true" @@ -157,6 +158,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/VAX750.vcproj b/Visual Studio Projects/VAX750.vcproj index 1d93b78d..fa44ab0f 100644 --- a/Visual Studio Projects/VAX750.vcproj +++ b/Visual Studio Projects/VAX750.vcproj @@ -126,6 +126,7 @@ EnableIntrinsicFunctions="true" FavorSizeOrSpeed="1" OmitFramePointers="true" + WholeProgramOptimization="true" AdditionalIncludeDirectories="./;../;../VAX/;../pdp11/;"../../windows-build/winpcap/Wpdpack/Include";"../../windows-build/PCRE/include/";"../../windows-build/pthreads"" PreprocessorDefinitions="USE_INT64;USE_ADDR64;VM_VAX;VAX_750;USE_SHARED;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;PTW32_STATIC_LIB;USE_READER_THREAD;SIM_ASYNCH_IO;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC" StringPooling="true" @@ -150,13 +151,14 @@ AdditionalOptions="/fixed:no" AdditionalDependencies="wsock32.lib winmm.lib pcrestatic.lib pcreposixstatic.lib" LinkIncremental="1" - AdditionalLibraryDirectories="../../winpcap/Wpdpack/Lib/;"../../pthreads/Pre-built.2/lib/";"../../windows-build/PCRE/lib/"" + AdditionalLibraryDirectories="../../winpcap/Wpdpack/Lib/;"../../windows-build/PCRE/lib/"" GenerateDebugInformation="false" SubSystem="1" StackReserveSize="10485760" StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/VAX780.vcproj b/Visual Studio Projects/VAX780.vcproj index 1b7557f6..29fbf26a 100644 --- a/Visual Studio Projects/VAX780.vcproj +++ b/Visual Studio Projects/VAX780.vcproj @@ -159,6 +159,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/VAX8600.vcproj b/Visual Studio Projects/VAX8600.vcproj index 2c7aeb8b..5a2fba0a 100644 --- a/Visual Studio Projects/VAX8600.vcproj +++ b/Visual Studio Projects/VAX8600.vcproj @@ -159,6 +159,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd b/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd index edda6991..8146c043 100644 --- a/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd +++ b/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd @@ -119,7 +119,7 @@ if not exist "%_ZipPath%" mkdir "%_ZipPath%" set _ZipPath=%_ZipPath%\ if not exist "%_ZipPath%%_ZipName%" vcbuild /M2 /useenv /rebuild Simh.sln "Release|Win32" -7z a -tzip "%_ZipPath%%_ZipName%" "..\BIN\NT\Win32-Release\*.exe" +7z a -tzip -x!BuildROMs.exe "%_ZipPath%%_ZipName%" "..\BIN\NT\Win32-Release\*.exe" popd pushd ..\%_ZipPath% if "%1" neq "reset" goto GitAddNew diff --git a/Visual Studio Projects/isys8010.vcproj b/Visual Studio Projects/isys8010.vcproj index 4914e98a..cecf50f3 100644 --- a/Visual Studio Projects/isys8010.vcproj +++ b/Visual Studio Projects/isys8010.vcproj @@ -35,9 +35,6 @@ - @@ -119,9 +116,6 @@ - diff --git a/Visual Studio Projects/isys8020.vcproj b/Visual Studio Projects/isys8020.vcproj index b040c40f..e41ac322 100644 --- a/Visual Studio Projects/isys8020.vcproj +++ b/Visual Studio Projects/isys8020.vcproj @@ -35,9 +35,6 @@ - @@ -119,9 +116,6 @@ - diff --git a/Visual Studio Projects/rtVAX1000.vcproj b/Visual Studio Projects/rtVAX1000.vcproj index 677ac479..a587aa89 100644 --- a/Visual Studio Projects/rtVAX1000.vcproj +++ b/Visual Studio Projects/rtVAX1000.vcproj @@ -161,6 +161,7 @@ StackCommitSize="10485760" OptimizeReferences="2" EnableCOMDATFolding="2" + LinkTimeCodeGeneration="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1"