Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlateralusX <lateralusx.github@gmail.com>2018-10-11 13:20:32 +0300
committerlateralusX <lateralusx.github@gmail.com>2018-10-15 15:45:24 +0300
commitf8249e65bea5adbca7bb419b77930e4b981c4ea0 (patch)
tree9ab9f4451945390007ea64f8ab25b3bba0837b00 /msvc/winsetup.bat
parent1678b9cbae51cde2993721234c22ed74ed13c063 (diff)
Add vcxproj to build btls as part of regular mono msvc build.
Diffstat (limited to 'msvc/winsetup.bat')
-rwxr-xr-xmsvc/winsetup.bat61
1 files changed, 37 insertions, 24 deletions
diff --git a/msvc/winsetup.bat b/msvc/winsetup.bat
index af5330e9fd0..31363704164 100755
--- a/msvc/winsetup.bat
+++ b/msvc/winsetup.bat
@@ -10,29 +10,28 @@ SET VERSION_H="%~dp0..\mono\mini\version.h"
ECHO Setting up Mono configuration headers...
:: generate unique temp file path
-uuidgen 2>nul || goto no_uuidgen
-for /f %%a in ('uuidgen') do set monotemp=%%a
+uuidgen > nul 2>&1 || goto no_uuidgen
+for /f %%a in ('uuidgen') do set CONFIG_H_TEMP=%%a
goto :got_temp
:no_uuidgen
:: Random isn't very random or unique. %time% and %date% is not random but fairly unique.
-set monotemp=%~n0%random%%time%%date%
+set CONFIG_H_TEMP=%~n0%random%%time%%date%
:got_temp
:: Remove special characters.
-set monotemp=%monotemp:-=%
-set monotemp=%monotemp:\=%
-set monotemp=%monotemp:/=%
-set monotemp=%monotemp::=%
-set monotemp=%monotemp: =%
-set monotemp=%monotemp:.=%
-set monotemp=%temp%\monotemp%monotemp%
-mkdir "%monotemp%\.." 2>nul
-set monotemp="%monotemp%"
-echo %monotemp%
+set CONFIG_H_TEMP=%CONFIG_H_TEMP:-=%
+set CONFIG_H_TEMP=%CONFIG_H_TEMP:\=%
+set CONFIG_H_TEMP=%CONFIG_H_TEMP:/=%
+set CONFIG_H_TEMP=%CONFIG_H_TEMP::=%
+set CONFIG_H_TEMP=%CONFIG_H_TEMP: =%
+set CONFIG_H_TEMP=%CONFIG_H_TEMP:.=%
+set CONFIG_H_TEMP=%temp%\CONFIG_H_TEMP%CONFIG_H_TEMP%
+mkdir "%CONFIG_H_TEMP%\.." 2>nul
+set CONFIG_H_TEMP="%CONFIG_H_TEMP%"
REM Backup existing config.h into cygconfig.h if its not already replaced.
-findstr /i /r /c:"#include *\"cygconfig.h\"" %config_h% >nul || copy /y %config_h% %cyg_config_h%
+findstr /i /r /c:"#include *\"cygconfig.h\"" %CONFIG_H% >nul || copy /y %CONFIG_h% %CYG_CONFIG_H%
:: Extract MONO_VERSION from configure.ac.
for /f "delims=[] tokens=2" %%a in ('findstr /b /c:"AC_INIT(mono, [" %CONFIGURE_AC%') do (
@@ -55,19 +54,33 @@ for /f "tokens=*" %%a in ('findstr /b /c:MONO_CORLIB_VERSION= %CONFIGURE_AC%') d
if "%MONO_VERSION_MAJOR:~1%" == "" set MONO_VERSION_MAJOR=0%MONO_VERSION_MAJOR%
if "%MONO_VERSION_MINOR:~1%" == "" set MONO_VERSION_MINOR=0%MONO_VERSION_MINOR%
-:: Remove every define VERSION from config.h and add what we want.
-findstr /v /b /i /c:"#define PACKAGE_VERSION " /c:"#define VERSION " /c:"#define MONO_CORLIB_VERSION " %win_config_h% > %monotemp%
-echo #define PACKAGE_VERSION "%MONO_VERSION%" >> %monotemp%
-echo #define VERSION "%MONO_VERSION%" >> %monotemp%
-echo #define MONO_CORLIB_VERSION "%MONO_CORLIB_VERSION%" >> %monotemp%
+:: Remove every define VERSION from winconfig.h and add what we want.
+findstr /v /b /i /c:"#define PACKAGE_VERSION " /c:"#define VERSION " /c:"#define MONO_CORLIB_VERSION " %WIN_CONFIG_H% > %CONFIG_H_TEMP%
+
+: Setup dynamic section of config.h
+echo #ifdef _MSC_VER >> %CONFIG_H_TEMP%
+echo #define PACKAGE_VERSION "%MONO_VERSION%" >> %CONFIG_H_TEMP%
+echo #define VERSION "%MONO_VERSION%" >> %CONFIG_H_TEMP%
+echo #define MONO_CORLIB_VERSION "%MONO_CORLIB_VERSION%" >> %CONFIG_H_TEMP%
+
+:: Add dynamic configuration parameters set in original config.h affecting msvc build.
+for /f "tokens=*" %%a in ('findstr /i /r /c:".*#define.*HAVE_BTLS.*1" %CYG_CONFIG_H%') do (
+ echo #define HAVE_BTLS 1 >> %CONFIG_H_TEMP%
+)
+
+for /f "tokens=*" %%a in ('findstr /i /r /c:".*#define.*LLVM.*" %CYG_CONFIG_H%') do (
+ echo %%a >> %CONFIG_H_TEMP%
+)
+
+echo #endif >> %CONFIG_H_TEMP%
:: If the file is different, replace it.
-fc %monotemp% %config_h% >nul || move /y %monotemp% %config_h%
-del %monotemp% 2>nul
+fc %CONFIG_H_TEMP% %CONFIG_H% >nul 2>&1 || move /y %CONFIG_H_TEMP% %CONFIG_H%
+del %CONFIG_H_TEMP% 2>nul
-echo #define FULL_VERSION "Visual Studio built mono" > %monotemp%
-fc %monotemp% %version_h% || move /y %monotemp% %version_h%
-del %monotemp% 2>nul
+echo #define FULL_VERSION "Visual Studio built mono" > %CONFIG_H_TEMP%
+fc %CONFIG_H_TEMP% %VERSION_H% >nul 2>&1 || move /y %CONFIG_H_TEMP% %VERSION_H%
+del %CONFIG_H_TEMP% 2>nul
:: Log environment variables that start "mono".
set MONO