diff options
-rw-r--r-- | msvc/compare-config-content.ps1 | 51 | ||||
-rw-r--r-- | msvc/compare-config-files.ps1 | 58 | ||||
-rw-r--r-- | msvc/install.bat | 32 | ||||
-rw-r--r-- | msvc/libmono.bat | 52 | ||||
-rw-r--r-- | msvc/libmono.vcxproj | 12 | ||||
-rw-r--r-- | msvc/package.bat | 51 | ||||
-rwxr-xr-x | msvc/winsetup.bat | 72 |
7 files changed, 254 insertions, 74 deletions
diff --git a/msvc/compare-config-content.ps1 b/msvc/compare-config-content.ps1 new file mode 100644 index 00000000000..0ed84ba3a05 --- /dev/null +++ b/msvc/compare-config-content.ps1 @@ -0,0 +1,51 @@ +############################################################################## +## +## compare-config-content +## +############################################################################## + +<# + +.SYNOPSIS + +Compares mono build configuration content detecting diff's. + +#> + +param( + ## first config source to compare. + $mono_config_source1, + + ## second config source to compare. + $mono_config_source2 +) + +if ((Test-Path -isvalid $mono_config_source1) -And (Test-Path $mono_config_source1)) +{ + $mono_config_source1_content = Get-Content $mono_config_source1 +} +else +{ + $mono_config_source1_content = $mono_config_source1 +} + +if ((Test-Path -isvalid $mono_config_source2) -And (Test-Path $mono_config_source2)) +{ + $mono_config_source2_content = Get-Content $mono_config_source2 +} +else +{ + $mono_config_source2_content = $mono_config_source2 +} + +## Compare content. +$comparedLines = Compare-Object $mono_config_source1_content $mono_config_source2_content -IncludeEqual | Sort-Object { $_.InputObject.ReadCount } +$comparedLines | foreach { + if($_.SideIndicator -ne "==") + { + Write-Host "Changes detected." + exit 1; + } +} + +exit 0;
\ No newline at end of file diff --git a/msvc/compare-config-files.ps1 b/msvc/compare-config-files.ps1 new file mode 100644 index 00000000000..9122f1e8fc8 --- /dev/null +++ b/msvc/compare-config-files.ps1 @@ -0,0 +1,58 @@ +############################################################################## +## +## compare-config-files +## +############################################################################## + +<# + +.SYNOPSIS + +Compares mono build configuration files detecting incompatible changes. + +#> + +param( + ## winconfig header file. + $mono_winconfig, + + ## config header file. + $mono_config, + + ## The master configuration file, optional. + $mono_config_ac +) + +## Get the content from each config file +$mono_winconfig_content = Get-Content $mono_winconfig +$mono_config_content = Get-Content $mono_config + +## Compare config files. +$comparedLines = Compare-Object $mono_winconfig_content $mono_config_content -IncludeEqual | Sort-Object { $_.InputObject.ReadCount } + +$comparedLines | foreach { + + if($_.SideIndicator -ne "==") + { + ##Look for diffs. + $mono_version = (Select-String -InputObject $_.InputObject -pattern '#define VERSION \"(.*)\"') + if ($mono_version -eq $null) { + Write-Host "Changes detected, versions doesn't match. Configuration must to be replaced." + exit 1; + } + } +} + +if ($mono_config_ac -ne $null -And $mono_config_ac -ne "") { + + $mono_version_ac = (Select-String -path $mono_config_ac -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value + $mono_version = (Select-String -path $mono_config -pattern '#define VERSION \"(.*)\"').Matches[0].Groups[1].Value + + if($mono_version_ac -ne $mono_version) + { + Write-Host "Changes detected, versions doesn't match. Configuration must to be replaced." + exit 1; + } +} + +exit 0; diff --git a/msvc/install.bat b/msvc/install.bat index 0baa5857f74..1a433991a7d 100644 --- a/msvc/install.bat +++ b/msvc/install.bat @@ -6,8 +6,12 @@ SET BUILD_DIR=%3 SET INSTALL_DIR=%4 SET ARGUMENTS=%5 +SET XCOPY_COMMAND=%windir%\system32\xcopy + SET BUILD_DIR=%BUILD_DIR:"=% +SET BUILD_DIR=%BUILD_DIR:/=\% SET INSTALL_DIR=%INSTALL_DIR:"=% +SET INSTALL_DIR=%INSTALL_DIR:/=\% IF "" == "%PLATFORM%" ( ECHO Error: No platform parameter set. @@ -33,18 +37,10 @@ IF "\" == "%BUILD_DIR:~-1%" ( SET BUILD_DIR=%BUILD_DIR:~0,-1% ) -IF "/" == "%BUILD_DIR:~-1%" ( - SET BUILD_DIR=%BUILD_DIR:~0,-1% -) - IF "\" == "%INSTALL_DIR:~-1%" ( SET INSTALL_DIR=%INSTALL_DIR:~0,-1% ) -IF "/" == "%INSTALL_DIR:~-1%" ( - SET INSTALL_DIR=%INSTALL_DIR:~0,-1% -) - IF NOT EXIST %BUILD_DIR% ( ECHO Error: '%BUILD_DIR%', directory doesn't eixst. GOTO ON_ERROR @@ -70,15 +66,15 @@ IF "-v" == "%ARGUMENTS%" ( ) IF "-q" == "%ARGUMENTS%" ( - SET "OPTIONS=/s /e /q /y ^>nul" + SET "OPTIONS=/s /e /q /y" ) -ECHO Installing mono build %PLATFORM% %CONFIG% from %BUILD_DIR% into %INSTALL_DIR% ... +ECHO Installing mono build %PLATFORM% %CONFIG% from %PACKAGE_DIR% into %INSTALL_DIR% ... -SET RUN=xcopy "%PACKAGE_DIR%\*.*" "%INSTALL_DIR%" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%PACKAGE_DIR%\*.*" "%INSTALL_DIR%" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -ECHO Installing of mono build %PLATFORM% %CONFIG% from %BUILD_DIR% into %INSTALL_DIR% DONE. +ECHO Installing of mono build %PLATFORM% %CONFIG% from %PACKAGE_DIR% into %INSTALL_DIR% DONE. EXIT /b 0 @@ -87,4 +83,14 @@ EXIT /b 0 EXIT /b 1 @ECHO on + +:runCommand + + IF "-q" == "%~2" ( + %~1 >nul 2>&1 + ) ELSE ( + %~1 + ) + +goto :EOF
\ No newline at end of file diff --git a/msvc/libmono.bat b/msvc/libmono.bat index d5501450f5e..6509ac127ca 100644 --- a/msvc/libmono.bat +++ b/msvc/libmono.bat @@ -4,8 +4,12 @@ SET SOURCE_ROOT=%1 SET TARGET_ROOT=%2 SET ARGUMENTS=%3 +SET XCOPY_COMMAND=%windir%\system32\xcopy + SET TARGET_ROOT=%TARGET_ROOT:"=% +SET TARGET_ROOT=%TARGET_ROOT:/=\% SET SOURCE_ROOT=%SOURCE_ROOT:"=% +SET SOURCE_ROOT=%SOURCE_ROOT:/=\% IF "" == "%SOURCE_ROOT%" ( ECHO Error: No source root parameter set. @@ -43,36 +47,36 @@ IF "-v" == "%ARGUMENTS%" ( ) IF "-q" == "%ARGUMENTS%" ( - SET "OPTIONS=/q /y ^>nul" + SET "OPTIONS=/q /y" ) -ECHO Copying mono include files from '%SOURCE_ROOT%' to '%TARGET_ROOT%' ... +ECHO Copying mono include files from %SOURCE_ROOT% to %TARGET_ROOT% ... -SET RUN=xcopy "%SOURCE_ROOT%\cil\opcode.def" "%TARGET_ROOT%\cil\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\cil\opcode.def" "%TARGET_ROOT%\cil\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\mini\jit.h" "%TARGET_ROOT%\jit\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\mini\jit.h" "%TARGET_ROOT%\jit\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\metadata\*.h" "%TARGET_ROOT%\metadata\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\metadata\*.h" "%TARGET_ROOT%\metadata\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\utils\mono-counters.h" "%TARGET_ROOT%\utils\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-counters.h" "%TARGET_ROOT%\utils\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\utils\mono-dl-fallback.h" "%TARGET_ROOT%\utils\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-dl-fallback.h" "%TARGET_ROOT%\utils\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\utils\mono-error.h" "%TARGET_ROOT%\utils\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-error.h" "%TARGET_ROOT%\utils\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\utils\mono-logger.h" "%TARGET_ROOT%\utils\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-logger.h" "%TARGET_ROOT%\utils\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%SOURCE_ROOT%\utils\mono-publib.h" "%TARGET_ROOT%\utils\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%SOURCE_ROOT%\utils\mono-publib.h" "%TARGET_ROOT%\utils\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -ECHO Copying mono include files from '%SOURCE_ROOT%' to '%TARGET_ROOT%' DONE. +ECHO Copying mono include files from %SOURCE_ROOT% to %TARGET_ROOT% DONE. EXIT /b 0 @@ -81,3 +85,13 @@ EXIT /b 0 EXIT /b 1 @ECHO on + +:runCommand + + IF "-q" == "%~2" ( + %~1 >nul 2>&1 + ) ELSE ( + %~1 + ) + +goto :EOF diff --git a/msvc/libmono.vcxproj b/msvc/libmono.vcxproj index 05fd05d73ff..7905958fe8a 100644 --- a/msvc/libmono.vcxproj +++ b/msvc/libmono.vcxproj @@ -209,7 +209,8 @@ </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
- <Command>echo #define FULL_VERSION "Visual Studio built mono" > ..\mono\mini\version.h</Command>
+ <Command>
+ </Command>
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
@@ -255,7 +256,8 @@ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
- <Command>echo #define FULL_VERSION "Visual Studio built mono" > ..\mono\mini\version.h</Command>
+ <Command>
+ </Command>
</PreBuildEvent>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
@@ -301,7 +303,8 @@ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
- <Command>echo #define FULL_VERSION "Visual Studio built mono" > ..\mono\mini\version.h</Command>
+ <Command>
+ </Command>
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>/D /NODEFAULTLIB:LIBCD" " %(AdditionalOptions)</AdditionalOptions>
@@ -343,7 +346,8 @@ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
- <Command>echo #define FULL_VERSION "Visual Studio built mono" > ..\mono\mini\version.h</Command>
+ <Command>
+ </Command>
</PreBuildEvent>
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
diff --git a/msvc/package.bat b/msvc/package.bat index e3bf41a008a..df29a8ba6f2 100644 --- a/msvc/package.bat +++ b/msvc/package.bat @@ -5,7 +5,10 @@ SET CONFIG=%2 SET BUILD_DIR=%3 SET ARGUMENTS=%4 +SET XCOPY_COMMAND=%windir%\system32\xcopy + SET BUILD_DIR=%BUILD_DIR:"=% +SET BUILD_DIR=%BUILD_DIR:/=\% IF "" == "%PLATFORM%" ( ECHO Error: No platform parameter set. @@ -31,10 +34,6 @@ IF "\" == "%BUILD_DIR:~-1%" ( SET BUILD_DIR=%BUILD_DIR:~0,-1% ) -IF "/" == "%BUILD_DIR:~-1%" ( - SET BUILD_DIR=%BUILD_DIR:~0,-1% -) - IF NOT EXIST %BUILD_DIR%\%PLATFORM%\lib\%CONFIG% ( ECHO Error: No lib directory available for %PLATFORM% %CONFIG% at '%BUILD_DIR%'. Any build availalbe for platform, configuration pair? GOTO ON_ERROR @@ -54,35 +53,35 @@ IF "-v" == "%ARGUMENTS%" ( ) IF "-q" == "%ARGUMENTS%" ( - SET "OPTIONS=/s /e /q /y ^>nul" + SET "OPTIONS=/s /e /q /y" ) ECHO Packaging mono build %PLATFORM% %CONFIG% into '%PACKAGE_DIR%' ... IF EXIST %PACKAGE_DIR% rmdir %PACKAGE_DIR% /s /q -mkdir "%PACKAGE_DIR%" -mkdir "%PACKAGE_DIR%\include\mono-2.0" +mkdir %PACKAGE_DIR% +mkdir %PACKAGE_DIR%\include\mono-2.0 -SET RUN=xcopy ".\include\*.*" "%PACKAGE_DIR%\include\mono-2.0\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% ".\include\*.*" "%PACKAGE_DIR%\include\mono-2.0\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%BUILD_DIR%\%PLATFORM%\lib\%CONFIG%\*.lib" "%PACKAGE_DIR%\lib\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%BUILD_DIR%\%PLATFORM%\lib\%CONFIG%\*.lib" "%PACKAGE_DIR%\lib\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%BUILD_DIR%\%PLATFORM%\lib\%CONFIG%\*.pdb" "%PACKAGE_DIR%\lib\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%BUILD_DIR%\%PLATFORM%\lib\%CONFIG%\*.pdb" "%PACKAGE_DIR%\lib\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.exe" "%PACKAGE_DIR%\bin\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.exe" "%PACKAGE_DIR%\bin\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.dll" "%PACKAGE_DIR%\bin\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.dll" "%PACKAGE_DIR%\bin\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.pdb" "%PACKAGE_DIR%\bin\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.pdb" "%PACKAGE_DIR%\bin\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% -SET RUN=xcopy "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.lib" "%PACKAGE_DIR%\bin\" %OPTIONS% -%RUN% +SET RUN=%XCOPY_COMMAND% "%BUILD_DIR%\%PLATFORM%\bin\%CONFIG%\*.lib" "%PACKAGE_DIR%\bin\" %OPTIONS% +call :runCommand "%RUN%" %ARGUMENTS% ECHO Packaging of mono build %PLATFORM% %CONFIG% into '%PACKAGE_DIR%' DONE. @@ -93,3 +92,13 @@ EXIT /b 0 EXIT /b 1 @ECHO on + +:runCommand + + IF "-q" == "%~2" ( + %~1 >nul 2>&1 + ) ELSE ( + %~1 + ) + +goto :EOF diff --git a/msvc/winsetup.bat b/msvc/winsetup.bat index 73f2a1b5cfa..a05395ca491 100755 --- a/msvc/winsetup.bat +++ b/msvc/winsetup.bat @@ -1,17 +1,55 @@ -@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 -%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -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" -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... + +IF EXIST %CONFIG_H% ( + IF NOT EXIST %CYG_CONFIG_H% ( + ECHO copy %CONFIG_H% %CYG_CONFIG_H% + copy %CONFIG_H% %CYG_CONFIG_H% + ) +) + +IF EXIST %EGLIB_CONFIG_H% ( + IF NOT EXIST %EGLIB_CYG_CONFIG_H% ( + ECHO copy %EGLIB_CONFIG_H% %EGLIB_CYG_CONFIG_H% + copy %EGLIB_CONFIG_H% %EGLIB_CYG_CONFIG_H% + ) +) + +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %WIN_CONFIG_H% %CONFIG_H% %CONFIGURE_AC% >$null 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%" >$null 2>&1 +) + +%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% >$null 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% + + +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 |