diff --git a/Visual Studio Projects/0ReadMe_Projects.txt b/Visual Studio Projects/0ReadMe_Projects.txt index f349b7b6..84bfaf76 100644 --- a/Visual Studio Projects/0ReadMe_Projects.txt +++ b/Visual Studio Projects/0ReadMe_Projects.txt @@ -1,13 +1,19 @@ This dirctory contains a set of Visual Studio 2008 build projects for the current simh code base. When used (with Visual Studio Express 2008 or -Visual Studio Express 2010) it populates a directory tree under the BIN -directory of the Simh distribution for temporary build files and produces -resulting executables in the BIN/NT/Win32-Debug or BIN/NT/Win32-Release -directories (depending on whether you target a Debug or Release build). +or a later Visual Studio version) it populates a directory tree under the +BIN directory of the Simh distribution for temporary build files and +produces resulting executables in the BIN/NT/Win32-Debug or +BIN/NT/Win32-Release directories (depending on whether you target a Debug +or Release build). -The Visual Studio Projects expect that a winpcap developer pack and the -Posix threads for windows package are available in a directory parallel -to the simh directory. +These projects, when used with Visual Studio 2008 will produce Release +build binaries that will run on Windows versions from XP onward. Building +with later versions of Visual Studio will have different Windows version +compatibility. + +The Visual Studio Projects expect that various dependent packages that +the simh code depends on are available in a directory parallel to the +simh directory. For Example, the directory structure should look like: @@ -33,7 +39,7 @@ To realize these benefits, you must build the desire simulator with USE_READER_THREAD defined. The relevant simulators which have network support are all of the VAX simulators and the PDP11 simulator. -Additionally, simulators which contain devices which use the asynchronous +Additionally, simulators which contain devices that use the asynchronous APIs in sim_disk.c and sim_tape.c can also achieve greater performance by leveraging pthreads to perform blocking I/O in separate threads. Currently the simulators which have such devices are all of the VAX simulators and diff --git a/Visual Studio Projects/3B2.vcproj b/Visual Studio Projects/3B2.vcproj index ac7ee020..3d38f089 100644 --- a/Visual Studio Projects/3B2.vcproj +++ b/Visual Studio Projects/3B2.vcproj @@ -21,7 +21,6 @@ OutputDirectory="..\BIN\NT\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="..\BIN\NT\Project\simh\$(ProjectName)\$(PlatformName)-$(ConfigurationName)" ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="0" > - - @@ -130,7 +122,7 @@ Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="true" - AdditionalIncludeDirectories="./;../;../../windows-build/PCRE/include/" + AdditionalIncludeDirectories="./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/winpcap/Wpdpack/Include;../../windows-build/PCRE/include/;../../windows-build/pthreads;../../windows-build/libSDL/SDL2-2.0.5/include;../../windows-build/libpng-1.6.18" PreprocessorDefinitions="_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC;VM_IMPTIP" StringPooling="true" RuntimeLibrary="0" @@ -151,9 +143,9 @@ /> - - @@ -130,7 +122,7 @@ Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="true" - AdditionalIncludeDirectories="./;../;../HP2100/;"../../windows-build/PCRE/include/"" + AdditionalIncludeDirectories="../HP2100/;./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/winpcap/Wpdpack/Include;../../windows-build/PCRE/include/;../../windows-build/pthreads;../../windows-build/libSDL/SDL2-2.0.5/include;../../windows-build/libpng-1.6.18" PreprocessorDefinitions="HAVE_INT64;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC" StringPooling="true" RuntimeLibrary="0" @@ -151,9 +143,9 @@ /> - - @@ -130,7 +122,7 @@ Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="true" - AdditionalIncludeDirectories="./;../;../I650/;"../../windows-build/PCRE/include/"" + AdditionalIncludeDirectories="../I650/;./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/winpcap/Wpdpack/Include;../../windows-build/PCRE/include/;../../windows-build/pthreads;../../windows-build/libSDL/SDL2-2.0.5/include;../../windows-build/libpng-1.6.18" PreprocessorDefinitions="_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC;USE_SIM_CARD;USE_INT64" StringPooling="true" RuntimeLibrary="0" @@ -151,9 +143,9 @@ /> - - @@ -130,7 +122,7 @@ Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="true" - AdditionalIncludeDirectories="./;../;../PDP18B/;"../../windows-build/PCRE/include/"" + AdditionalIncludeDirectories="../PDP18B/;./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/winpcap/Wpdpack/Include;../../windows-build/PCRE/include/;../../windows-build/pthreads;../../windows-build/libSDL/SDL2-2.0.5/include;../../windows-build/libpng-1.6.18" PreprocessorDefinitions="PDP15;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC" StringPooling="true" RuntimeLibrary="0" @@ -151,9 +143,9 @@ /> NUL -if ERRORLEVEL 1 goto _next_arg -findstr PlatformToolset %1 | findstr _xp >NUL -if not ERRORLEVEL 1 goto _done_xp_check -echo warning: The %~n1.exe binary can't run on windows XP. -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 -if exist PlatformToolset.fix exit /b 1 -echo. >>PlatformToolset.fix -if ERRORLEVEL 1 exit /B 1 -echo warning: Adding Windows XP suppport to all project files at %TIME% - +rem Everything implicitly requires BUILD to also be set to have +rem any meaning, it always gets set. +set _X_BUILD=BUILD call :FindVCVersion _VC_VER -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 strText = Replace(strText, "", "_xp") >>%1.fix.vbs -echo. >>%1.fix.vbs -if %_VC_VER% GEQ 14 echo strText = Replace(strText, _>>%1.fix.vbs -if %_VC_VER% GEQ 14 echo "__CLEANUP_C", _>>%1.fix.vbs -if %_VC_VER% GEQ 14 echo "__CLEANUP_C;_USING_V110_SDK71_") _>>%1.fix.vbs -if %_VC_VER% GEQ 14 echo. >>%1.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>%1.fix.vbs -echo objFile.Write strText >>%1.fix.vbs -echo objFile.Close >>%1.fix.vbs - -call :_Fix_PlatformToolset %1 %1 -for %%f in (*.vcxproj) do call :_Fix_PlatformToolset %1 %%f -call :_GitHooks -del %1.fix.vbs -rem wait a bit here to allow a parallel build of the to complete additional projects -echo Error: Reload the changed projects and start the build again -exit /B 1 -:_Fix_PlatformToolset -findstr PlatformToolset %2 >NUL -if ERRORLEVEL 1 exit /B 0 -findstr PlatformToolset %2 | findstr _xp >NUL -if not ERRORLEVEL 1 exit /B 0 -echo Adding XP support to project %2 -cscript %1.fix.vbs %2 > NUL 2>&1 -exit /B 0 -:_done_xp_check -shift -goto _done_project -:_project_cleanup -shift -del PlatformToolset.fix -:_done_project -if exist PlatformToolset.fix echo error: Reload any changed projects and rebuild again, -if exist PlatformToolset.fix exit /b 1 - :_next_arg if "%1" == "" goto _done_args @@ -115,11 +55,6 @@ if not "%_arg%" == "" set _X_%_arg%=%_arg% shift goto _next_arg :_done_args -rem some arguments implicitly require BUILD to also be set to have -rem any meaning. These are LIBSDL, LIBPCRE and FINDFONT -if not "%_X_FINDFONT%" == "" set _X_BUILD=BUILD -if not "%_X_LIBSDL%" == "" set _X_BUILD=BUILD -if not "%_X_LIBPCRE%" == "" set _X_BUILD=BUILD :_do_rom @@ -130,10 +65,11 @@ if exist BIN\NT\Win32-Debug\BuildROMs.exe SET _BLD=BIN\NT\Win32-Debug\BuildROMs. if exist BIN\NT\Win32-Release\BuildROMs.exe SET _BLD=BIN\NT\Win32-Release\BuildROMs.exe if "%_BLD%" == "" echo ************************************************ if "%_BLD%" == "" echo ************************************************ -if "%_BLD%" == "" echo ** Project dependencies not correct. ** +if "%_BLD%" == "" echo ** Project dependencies are not correct. ** if "%_BLD%" == "" echo ** This project should depend on BuildROMs. ** if "%_BLD%" == "" echo ************************************************ if "%_BLD%" == "" echo ************************************************ +if "%_BLD%" == "" echo error: Review the Output Tab for more details. if "%_BLD%" == "" exit 1 %_BLD% if not errorlevel 1 goto _done_rom @@ -157,26 +93,25 @@ ren ..\..\windows-build-windows-build windows-build if errorlevel 1 goto _notice3 if exist ../../windows-build-windows-build goto _notice3 :_check_files -if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice1 -if not exist ../../windows-build/pthreads/pthread.h goto _notice1 -findstr "/c:_MSC_VER >= 1900" ..\..\windows-build\pthreads\pthread.h >NUL -if ERRORLEVEL 1 goto _notice2 -if "%_X_LIBSDL%" == "" goto _done_libsdl -if not exist ../../windows-build/libSDL/SDL2-2.0.5/include/SDL.h goto _notice2 -if not exist "..\..\windows-build\libpng-1.6.18\projects\vstudio\Release Library\*" goto _notice2 -if not exist "../../windows-build/libSDL/Microsoft DirectX SDK (June 2010)/Lib/x86/dxguid.lib" goto _notice2 -findstr "/c:LIBSDL_FTOL2_SSE" ..\..\windows-build\Windows-Build_Versions.txt >NUL -if ERRORLEVEL 1 goto _notice2 -findstr "/c:LIBSDL_ALLMUL" ..\..\windows-build\Windows-Build_Versions.txt >NUL -if ERRORLEVEL 1 goto _notice2 -findstr "/c:LIBSDL_ALLSHR" ..\..\windows-build\Windows-Build_Versions.txt >NUL -if ERRORLEVEL 1 goto _notice2 +call :FindVCVersion _VC_VER +if not exist ../../windows-build goto _notice1 +if not exist ../../windows-build/lib goto _notice2 +if not exist ../../windows-build/lib/VisualCVersionSupport.txt goto _find_vc_support + +set _X_VC_VER= +for /F "usebackq tokens=2*" %%i in (`findstr /C:"_VC_VER=%_VC_VER% " ..\..\windows-build\lib\VisualCVersionSupport.txt`) do SET _X_VC_VER=%%i %%j +if "%_X_VC_VER%" neq "" echo Library support for %_X_VC_VER% is available +if "%_X_VC_VER%" neq "" goto _done_libsdl +:_find_vc_support +set _X_VC_VER_DIR= +for /d %%i in ("../../windows-build/lib/*") do call :CheckDirectoryVCSupport _X_VC_VER_DIR %%i "../../windows-build/lib/" +if "%_X_VC_VER_DIR%" equ "" goto _notice4 +:_make_vc_support_active +for /F "usebackq tokens=2*" %%i in (`findstr /C:"_VC_VER=%_VC_VER% " "%_X_VC_VER_DIR%\VisualCVersionSupport.txt"`) do SET _X_VC_VER=%%i %%j +echo Enabling Library support for %_X_VC_VER% +call "%_X_VC_VER_DIR%\Install-Library-Support.cmd" :_done_libsdl -if "%_X_LIBPCRE%" == "" goto _done_libpcre -if not exist ../../windows-build/PCRE/include/pcreposix.h goto _notice2 -:_done_libpcre if "%_X_FINDFONT%" == "" goto _done_findfont -if not exist ../../windows-build/libSDL/SDL2_ttf-2.0.12/SDL_ttf.h goto _notice2 if "%_X_FontName%" == "" goto _done_findfont echo. >%_X_FontIncludeName%.temp set FONTFILE=%windir%\Fonts\%_X_FontName% @@ -238,6 +173,26 @@ echo ***************************************************** echo ***************************************************** set _exit_reason=Can't rename ../../windows-build-windows-build to ../../windows-build goto _ProjectInfo +:_notice4 +echo ********************************* +echo ********************************* +echo ** Visual Studio Version: %_VC_VER% ** +echo ** Visual Studio Version: %_VC_VER% ** +echo ** Visual Studio Version: %_VC_VER% ** +echo ** Visual Studio Version: %_VC_VER% ** +echo ***************************************************** +echo ***************************************************** +echo ** Windows Build support for your Microsoft ** +echo ** Visual Studio version is not available yet. ** +echo ** Please create a new issue at: ** +echo ** https://github.com/simh/simh/issues describing ** +echo ** what you've done and support should be added ** +echo ** soon. Otherwise, you can install an earlier ** +echo ** version of Microsoft Visual Studio and use ** +echo ** that. ** +echo ***************************************************** +echo ***************************************************** +goto _ProjectInfo :_ProjectInfo type 0ReadMe_Projects.txt echo error: %_exit_reason% @@ -247,6 +202,32 @@ exit 1 :_GitHooks if not exist ..\.git goto _done_hooks +call :FindGit _GIT_GIT +if "%_GIT_GIT%" neq "" goto _check_hooks +echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** +echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** +echo ** ** +echo ** Your local simh code is in a git repository, ** +echo ** however, the git program executable can not be ** +echo ** readily found on your system. ** +echo ** ** +echo ** You should download and install git from: ** +echo ** ** +echo ** https://git-scm.com/download/win ** +echo ** ** +echo ** while installing git for windows, be sure to ** +echo ** select the option to "Use Git from the Windows ** +echo ** Command Prompt" ** +echo ** ** +echo ** You should logout and login again after initally ** +echo "" installing git to be sure that the installation ** +echo ** location is properly visible in your search path.** +echo ** ** +echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** +echo ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** ERROR ** +echo error: Review the Output Tab for more details. +exit 1 +:_check_hooks if not exist ..\.git\hooks\post-commit goto _initial_hooks fc /b ..\.git\hooks\post-commit git-hooks\post-commit >nul if %ERRORLEVEL% equ 0 goto _done_hooks @@ -264,22 +245,9 @@ echo ***************************************************** echo ***************************************************** :_install_hooks copy /y git-hooks\post* ..\.git\hooks\ -call :WhereInPath git.exe > NUL 2>&1 -if %ERRORLEVEL% equ 0 goto _do_hooks -echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** -echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** -echo ** ** -echo ** Git Commit id invalid. You must perform a ** -echo ** git checkout on the current branch to solve ** -echo ** this problem. ** -echo ** ** -echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** -echo ** WARNING ** WARNING ** WARNING ** WARNING ** WARNING ** -echo error: Review the Output Tab for more details. -exit 1 :_do_hooks pushd .. -git log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id +"%_GIT_GIT%" log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id popd :_done_hooks @@ -317,9 +285,24 @@ if "%~$PATH:1" EQU "" exit /B 1 set %2=%~$PATH:1 exit /B 0 +:FindGit +set _GIT_TMP=%1 +call :WhichInPath git.exe _GIT_TMP_ +if "%_GIT_TMP_%" neq "" goto GitFound +call :WhichInPath cl.exe _VC_CL_ +for /f "tokens=1-4 delims=\" %%a in ("%_VC_CL_%") do set _GIT_BASE_="%%a\%%b\%%c\%%d\" +for /r %_GIT_BASE_% %%a in (git.exe) do if exist "%%a" set _GIT_TMP_=%%a +:GitFound +set %_GIT_TMP%=%_GIT_TMP_% +set _VC_CL_= +set _GIT_BASE_= +set _GIT_TMP_= +set _GIT_TMP= +exit /B 0 + :FindVCVersion call :WhichInPath cl.exe _VC_CL_ -for /f "tokens=2-8 delims=\" %%a in ("%_VC_CL_%") do call :VCCheck _VC_VER_NUM_ "%%a" "%%b" "%%c" "%%d" "%%e" "%%f" "%%g" +for /f "tokens=3-9 delims=\" %%a in ("%_VC_CL_%") do call :VCCheck _VC_VER_NUM_ "%%a" "%%b" "%%c" "%%d" "%%e" "%%f" "%%g" for /f "delims=." %%a in ("%_VC_VER_NUM_%") do set %1=%%a set _VC_CL= exit /B 0 @@ -331,8 +314,38 @@ shift set _VC_TMP_=%~1 if "%_VC_TMP_%" equ "" goto _VCCheck_Done if "%_VC_TMP_:~0,24%" EQU "Microsoft Visual Studio " set %_VC_TMP%=%_VC_TMP_:Microsoft Visual Studio =% +call :IsNumeric _VC_NUM_ %_VC_TMP_% +if "%_VC_NUM_%" neq "" set %_VC_TMP%=%~1 +if "%_VC_NUM_%" neq "" goto _VCCheck_Done goto _VCCheck_Next :_VCCheck_Done set _VC_TMP_= set _VC_TMP= +set _VC_NUM_= +exit /B 0 + +:CheckDirectoryVCSupport +set _VC_Check_Path=%~3%~2/ +set _VC_Check_Path=%_VC_Check_Path:/=\% +if not exist "%_VC_Check_Path%VisualCVersionSupport.txt" exit /B 1 +for /F "usebackq tokens=2*" %%k in (`findstr /C:"_VC_VER=%_VC_VER% " "%_VC_Check_Path%VisualCVersionSupport.txt"`) do set %1=%_VC_Check_Path% +exit /B 0 + +:IsNumeric +set _Numeric_TMP_=%~1 +set _Numeric_Test_=%2 +set _Numeric_Test_=%_Numeric_Test_:~0,1% +set %_Numeric_TMP_%= +if "%_Numeric_Test_%"=="0" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="1" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="2" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="3" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="4" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="5" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="6" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="7" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="8" set %_Numeric_TMP_%=1 +if "%_Numeric_Test_%"=="9" set %_Numeric_TMP_%=1 +set _Numeric_TMP_= +set _Numeric_Test_= exit /B 0 diff --git a/Visual Studio Projects/S3.vcproj b/Visual Studio Projects/S3.vcproj index 63ffafc2..f1c3d38b 100644 --- a/Visual Studio Projects/S3.vcproj +++ b/Visual Studio Projects/S3.vcproj @@ -21,7 +21,6 @@ OutputDirectory="..\BIN\NT\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="..\BIN\NT\Project\simh\$(ProjectName)\$(PlatformName)-$(ConfigurationName)" ConfigurationType="1" - InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" CharacterSet="0" > - - @@ -136,7 +128,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" WholeProgramOptimization="false" - AdditionalIncludeDirectories="./;../;../VAX/;../pdp11/;"../../windows-build/winpcap/Wpdpack/Include";"../../windows-build/PCRE/include/";"../../windows-build/pthreads";"../../windows-build/libSDL/SDL2-2.0.5/include";"../../windows-build/PCRE/include";"../../windows-build/libpng-1.6.18";../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include" + AdditionalIncludeDirectories="../VAX/;../pdp11/;../../windows-build/PCRE/include;./;../;../slirp;../slirp_glue;../slirp_glue/qemu;../slirp_glue/qemu/win32/include;../../windows-build/winpcap/Wpdpack/Include;../../windows-build/PCRE/include/;../../windows-build/pthreads;../../windows-build/libSDL/SDL2-2.0.5/include;../../windows-build/libpng-1.6.18" PreprocessorDefinitions="USE_INT64;USE_ADDR64;VM_VAX;USE_SHARED;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;PTW32_STATIC_LIB;USE_READER_THREAD;USE_SIM_VIDEO;HAVE_LIBSDL;SIM_ASYNCH_IO;SIM_NEED_GIT_COMMIT_ID;HAVE_PCREPOSIX_H;PCRE_STATIC;HAVE_LIBPNG;HAVE_SLIRP_NETWORK;USE_SIMH_SLIRP_DEBUG" KeepComments="false" StringPooling="true" @@ -160,9 +152,9 @@