X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=msvc%2Fwinsetup.bat;h=d3729144a610939269165092422bce631af42d6a;hb=f7e0f70b7d3f6defb1e7ac7fb98f57bfc4722123;hp=f67a854569327dcbd8fb0d344ea2ed97de89c1f3;hpb=28f473c41df72b278eaf9784c29c2b8fa2cbe06a;p=mono.git diff --git a/msvc/winsetup.bat b/msvc/winsetup.bat index f67a8545693..d3729144a61 100755 --- a/msvc/winsetup.bat +++ b/msvc/winsetup.bat @@ -1,16 +1,46 @@ -@echo off -cd .. -if exist config.h if not exist cygconfig.h copy config.h cygconfig.h -if exist eglib\config.h if not exist eglib\cygconfig.h copy eglib\config.h eglib\cygconfig.h -copy winconfig.h config.h -copy eglib\winconfig.h eglib\config.h -goto end -:error -echo fatal error: the VSDepenancies directory was not found in the "mono" directory -echo error: you must download and unzip that file -exit /b 100 -goto end -:ok -echo OK -:end -exit /b 0 +@ECHO off + +SET CONFIG_H=..\config.h +SET EGLIB_CONFIG_H=..\eglib\config.h +SET CYG_CONFIG_H=..\cygconfig.h +SET EGLIB_CYG_CONFIG_H=..\eglib\cygconfig.h +SET WIN_CONFIG_H=..\winconfig.h +SET EGLIB_WIN_CONFIG_H=..\eglib\winconfig.h +SET CONFIGURE_AC=..\configure.ac +SET VERSION_H=..\mono\mini\version.h + + +ECHO Setting up Mono configuration headers... + +REM Backup existing config.h into cygconfig.h if its not already replaced. +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File backup-config-files.ps1 %CONFIG_H% %CYG_CONFIG_H% 2>&1 +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File backup-config-files.ps1 %EGLIB_CONFIG_H% %EGLIB_CYG_CONFIG_H% 2>&1 + +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %WIN_CONFIG_H% %CONFIG_H% %CONFIGURE_AC% 2>&1 + +IF NOT %ERRORLEVEL% == 0 ( + ECHO copy %WIN_CONFIG_H% %CONFIG_H% + copy %WIN_CONFIG_H% %CONFIG_H% + %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "(Get-Content %CONFIG_H%) -replace '#MONO_VERSION#', (Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content %CONFIG_H%" 2>&1 + %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],$mono_version[2],$corlib_counter) | Set-Content %CONFIG_H%" 2>&1 +) + +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% 2>&1 + +IF NOT %ERRORLEVEL% == 0 ( + ECHO copy %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% + copy %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% +) + +SET VERSION_CONTENT="#define FULL_VERSION \"Visual Studio built mono\"" +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-content.ps1 %VERSION_CONTENT% %VERSION_H% 2>&1 + + +IF NOT %ERRORLEVEL% == 0 ( + ECHO Configure %VERSION_H% + ECHO #define FULL_VERSION "Visual Studio built mono"> %VERSION_H% +) + +ECHO Successfully setup Mono configuration headers. + +EXIT /b 0