Fossil SCM
Further robustness enhancements to the automated MSVC batch file. Also, update build wiki page to refer to it.
Commit
c11c8707619bfa26bd9afcdb8658aa4996d352bb
Parent
c8b1f75f30c59fe…
2 files changed
+58
-19
+4
-2
+58
-19
| --- win/buildmsvc.bat | ||
| +++ win/buildmsvc.bat | ||
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | @ECHO OFF |
| 2 | 2 | |
| 3 | 3 | :: |
| 4 | 4 | :: buildmsvc.bat -- |
| 5 | 5 | :: |
| 6 | -:: This batch file attempts to compile Fossil using the latest version | |
| 6 | +:: This batch file attempts to build Fossil using the latest version | |
| 7 | 7 | :: Microsoft Visual Studio installed on this machine. |
| 8 | 8 | :: |
| 9 | 9 | :: |
| 10 | 10 | |
| 11 | 11 | SETLOCAL |
| @@ -17,53 +17,101 @@ | ||
| 17 | 17 | IF NOT DEFINED _VECHO (SET _VECHO=REM) |
| 18 | 18 | |
| 19 | 19 | REM |
| 20 | 20 | REM Visual Studio ???? |
| 21 | 21 | REM |
| 22 | -IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 22 | +IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" GOTO skip_detectVisualStudio | |
| 23 | 23 | |
| 24 | 24 | REM |
| 25 | 25 | REM Visual Studio 2013 |
| 26 | 26 | REM |
| 27 | +IF NOT DEFINED VS120COMNTOOLS GOTO skip_detectVisualStudio2013 | |
| 27 | 28 | SET VSVARS32=%VS120COMNTOOLS%\vsvars32.bat |
| 28 | -IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 29 | +IF EXIST "%VSVARS32%" ( | |
| 30 | + %_AECHO% Using Visual Studio 2013... | |
| 31 | + GOTO skip_detectVisualStudio | |
| 32 | +) | |
| 33 | +:skip_detectVisualStudio2013 | |
| 29 | 34 | |
| 30 | 35 | REM |
| 31 | 36 | REM Visual Studio 2012 |
| 32 | 37 | REM |
| 38 | +IF NOT DEFINED VS110COMNTOOLS GOTO skip_detectVisualStudio2012 | |
| 33 | 39 | SET VSVARS32=%VS110COMNTOOLS%\vsvars32.bat |
| 34 | -IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 40 | +IF EXIST "%VSVARS32%" ( | |
| 41 | + %_AECHO% Using Visual Studio 2012... | |
| 42 | + GOTO skip_detectVisualStudio | |
| 43 | +) | |
| 44 | +:skip_detectVisualStudio2012 | |
| 35 | 45 | |
| 36 | 46 | REM |
| 37 | 47 | REM Visual Studio 2010 |
| 38 | 48 | REM |
| 49 | +IF NOT DEFINED VS100COMNTOOLS GOTO skip_detectVisualStudio2010 | |
| 39 | 50 | SET VSVARS32=%VS100COMNTOOLS%\vsvars32.bat |
| 40 | -IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 51 | +IF EXIST "%VSVARS32%" ( | |
| 52 | + %_AECHO% Using Visual Studio 2010... | |
| 53 | + GOTO skip_detectVisualStudio | |
| 54 | +) | |
| 55 | +:skip_detectVisualStudio2010 | |
| 41 | 56 | |
| 42 | 57 | REM |
| 43 | 58 | REM Visual Studio 2008 |
| 44 | 59 | REM |
| 60 | +IF NOT DEFINED VS90COMNTOOLS GOTO skip_detectVisualStudio2008 | |
| 45 | 61 | SET VSVARS32=%VS90COMNTOOLS%\vsvars32.bat |
| 46 | -IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 62 | +IF EXIST "%VSVARS32%" ( | |
| 63 | + %_AECHO% Using Visual Studio 2008... | |
| 64 | + GOTO skip_detectVisualStudio | |
| 65 | +) | |
| 66 | +:skip_detectVisualStudio2008 | |
| 47 | 67 | |
| 48 | 68 | REM |
| 49 | 69 | REM Visual Studio 2005 |
| 50 | 70 | REM |
| 71 | +IF NOT DEFINED VS80COMNTOOLS GOTO skip_detectVisualStudio2005 | |
| 51 | 72 | SET VSVARS32=%VS80COMNTOOLS%\vsvars32.bat |
| 52 | -IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 73 | +IF EXIST "%VSVARS32%" ( | |
| 74 | + %_AECHO% Using Visual Studio 2005... | |
| 75 | + GOTO skip_detectVisualStudio | |
| 76 | +) | |
| 77 | +:skip_detectVisualStudio2005 | |
| 53 | 78 | |
| 54 | 79 | REM |
| 55 | 80 | REM Visual Studio 2003 |
| 56 | 81 | REM |
| 82 | +IF NOT DEFINED VS71COMNTOOLS GOTO skip_detectVisualStudio2003 | |
| 57 | 83 | SET VSVARS32=%VS71COMNTOOLS%\vsvars32.bat |
| 58 | -IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio | |
| 84 | +IF EXIST "%VSVARS32%" ( | |
| 85 | + %_AECHO% Using Visual Studio 2003... | |
| 86 | + GOTO skip_detectVisualStudio | |
| 87 | +) | |
| 88 | +:skip_detectVisualStudio2003 | |
| 89 | + | |
| 90 | +REM | |
| 91 | +REM Visual Studio 2002 | |
| 92 | +REM | |
| 93 | +IF NOT DEFINED VS70COMNTOOLS GOTO skip_detectVisualStudio2002 | |
| 94 | +SET VSVARS32=%VS70COMNTOOLS%\vsvars32.bat | |
| 95 | +IF EXIST "%VSVARS32%" ( | |
| 96 | + %_AECHO% Using Visual Studio 2002... | |
| 97 | + GOTO skip_detectVisualStudio | |
| 98 | +) | |
| 99 | +:skip_detectVisualStudio2002 | |
| 100 | + | |
| 101 | +REM | |
| 102 | +REM NOTE: If we get to this point, no Visual Studio build environment batch | |
| 103 | +REM files were found. | |
| 104 | +REM | |
| 105 | +ECHO No Visual Studio build environment batch files were found. | |
| 106 | +GOTO errors | |
| 59 | 107 | |
| 60 | 108 | REM |
| 61 | 109 | REM NOTE: At this point, the appropriate Visual Studio version should be |
| 62 | 110 | REM selected. |
| 63 | 111 | REM |
| 64 | -:skip_setVisualStudio | |
| 112 | +:skip_detectVisualStudio | |
| 65 | 113 | |
| 66 | 114 | REM |
| 67 | 115 | REM NOTE: Remove any double-backslash sequences that may be present in the |
| 68 | 116 | REM selected Visual Studio common tools path. This is not strictly |
| 69 | 117 | REM necessary; however, it makes reading the output easier. |
| @@ -70,19 +118,10 @@ | ||
| 70 | 118 | REM |
| 71 | 119 | SET VSVARS32=%VSVARS32:\\=\% |
| 72 | 120 | |
| 73 | 121 | %_VECHO% VsVars32 = '%VSVARS32%' |
| 74 | 122 | |
| 75 | -REM | |
| 76 | -REM NOTE: Verify that the specified Visual Studio environment batch file | |
| 77 | -REM exists. | |
| 78 | -REM | |
| 79 | -IF NOT EXIST "%VSVARS32%" ( | |
| 80 | - ECHO Visual Studio environment batch file "%VSVARS32%" does not exist. | |
| 81 | - GOTO errors | |
| 82 | -) | |
| 83 | - | |
| 84 | 123 | REM |
| 85 | 124 | REM NOTE: Setup local environment variables that point to the root directory |
| 86 | 125 | REM of the Fossil source checkout and to the directory containing this |
| 87 | 126 | REM build tool. |
| 88 | 127 | REM |
| @@ -106,11 +145,11 @@ | ||
| 106 | 145 | REM variables for building with MSVC. |
| 107 | 146 | REM |
| 108 | 147 | %__ECHO3% CALL "%VSVARS32%" |
| 109 | 148 | |
| 110 | 149 | IF ERRORLEVEL 1 ( |
| 111 | - ECHO Visual Studio environment batch file "%VSVARS32%" failed. | |
| 150 | + ECHO Visual Studio build environment batch file "%VSVARS32%" failed. | |
| 112 | 151 | GOTO errors |
| 113 | 152 | ) |
| 114 | 153 | |
| 115 | 154 | REM |
| 116 | 155 | REM NOTE: Attempt to create the build output directory, if necessary. |
| 117 | 156 |
| --- win/buildmsvc.bat | |
| +++ win/buildmsvc.bat | |
| @@ -1,11 +1,11 @@ | |
| 1 | @ECHO OFF |
| 2 | |
| 3 | :: |
| 4 | :: buildmsvc.bat -- |
| 5 | :: |
| 6 | :: This batch file attempts to compile Fossil using the latest version |
| 7 | :: Microsoft Visual Studio installed on this machine. |
| 8 | :: |
| 9 | :: |
| 10 | |
| 11 | SETLOCAL |
| @@ -17,53 +17,101 @@ | |
| 17 | IF NOT DEFINED _VECHO (SET _VECHO=REM) |
| 18 | |
| 19 | REM |
| 20 | REM Visual Studio ???? |
| 21 | REM |
| 22 | IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 23 | |
| 24 | REM |
| 25 | REM Visual Studio 2013 |
| 26 | REM |
| 27 | SET VSVARS32=%VS120COMNTOOLS%\vsvars32.bat |
| 28 | IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 29 | |
| 30 | REM |
| 31 | REM Visual Studio 2012 |
| 32 | REM |
| 33 | SET VSVARS32=%VS110COMNTOOLS%\vsvars32.bat |
| 34 | IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 35 | |
| 36 | REM |
| 37 | REM Visual Studio 2010 |
| 38 | REM |
| 39 | SET VSVARS32=%VS100COMNTOOLS%\vsvars32.bat |
| 40 | IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 41 | |
| 42 | REM |
| 43 | REM Visual Studio 2008 |
| 44 | REM |
| 45 | SET VSVARS32=%VS90COMNTOOLS%\vsvars32.bat |
| 46 | IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 47 | |
| 48 | REM |
| 49 | REM Visual Studio 2005 |
| 50 | REM |
| 51 | SET VSVARS32=%VS80COMNTOOLS%\vsvars32.bat |
| 52 | IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 53 | |
| 54 | REM |
| 55 | REM Visual Studio 2003 |
| 56 | REM |
| 57 | SET VSVARS32=%VS71COMNTOOLS%\vsvars32.bat |
| 58 | IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio |
| 59 | |
| 60 | REM |
| 61 | REM NOTE: At this point, the appropriate Visual Studio version should be |
| 62 | REM selected. |
| 63 | REM |
| 64 | :skip_setVisualStudio |
| 65 | |
| 66 | REM |
| 67 | REM NOTE: Remove any double-backslash sequences that may be present in the |
| 68 | REM selected Visual Studio common tools path. This is not strictly |
| 69 | REM necessary; however, it makes reading the output easier. |
| @@ -70,19 +118,10 @@ | |
| 70 | REM |
| 71 | SET VSVARS32=%VSVARS32:\\=\% |
| 72 | |
| 73 | %_VECHO% VsVars32 = '%VSVARS32%' |
| 74 | |
| 75 | REM |
| 76 | REM NOTE: Verify that the specified Visual Studio environment batch file |
| 77 | REM exists. |
| 78 | REM |
| 79 | IF NOT EXIST "%VSVARS32%" ( |
| 80 | ECHO Visual Studio environment batch file "%VSVARS32%" does not exist. |
| 81 | GOTO errors |
| 82 | ) |
| 83 | |
| 84 | REM |
| 85 | REM NOTE: Setup local environment variables that point to the root directory |
| 86 | REM of the Fossil source checkout and to the directory containing this |
| 87 | REM build tool. |
| 88 | REM |
| @@ -106,11 +145,11 @@ | |
| 106 | REM variables for building with MSVC. |
| 107 | REM |
| 108 | %__ECHO3% CALL "%VSVARS32%" |
| 109 | |
| 110 | IF ERRORLEVEL 1 ( |
| 111 | ECHO Visual Studio environment batch file "%VSVARS32%" failed. |
| 112 | GOTO errors |
| 113 | ) |
| 114 | |
| 115 | REM |
| 116 | REM NOTE: Attempt to create the build output directory, if necessary. |
| 117 |
| --- win/buildmsvc.bat | |
| +++ win/buildmsvc.bat | |
| @@ -1,11 +1,11 @@ | |
| 1 | @ECHO OFF |
| 2 | |
| 3 | :: |
| 4 | :: buildmsvc.bat -- |
| 5 | :: |
| 6 | :: This batch file attempts to build Fossil using the latest version |
| 7 | :: Microsoft Visual Studio installed on this machine. |
| 8 | :: |
| 9 | :: |
| 10 | |
| 11 | SETLOCAL |
| @@ -17,53 +17,101 @@ | |
| 17 | IF NOT DEFINED _VECHO (SET _VECHO=REM) |
| 18 | |
| 19 | REM |
| 20 | REM Visual Studio ???? |
| 21 | REM |
| 22 | IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" GOTO skip_detectVisualStudio |
| 23 | |
| 24 | REM |
| 25 | REM Visual Studio 2013 |
| 26 | REM |
| 27 | IF NOT DEFINED VS120COMNTOOLS GOTO skip_detectVisualStudio2013 |
| 28 | SET VSVARS32=%VS120COMNTOOLS%\vsvars32.bat |
| 29 | IF EXIST "%VSVARS32%" ( |
| 30 | %_AECHO% Using Visual Studio 2013... |
| 31 | GOTO skip_detectVisualStudio |
| 32 | ) |
| 33 | :skip_detectVisualStudio2013 |
| 34 | |
| 35 | REM |
| 36 | REM Visual Studio 2012 |
| 37 | REM |
| 38 | IF NOT DEFINED VS110COMNTOOLS GOTO skip_detectVisualStudio2012 |
| 39 | SET VSVARS32=%VS110COMNTOOLS%\vsvars32.bat |
| 40 | IF EXIST "%VSVARS32%" ( |
| 41 | %_AECHO% Using Visual Studio 2012... |
| 42 | GOTO skip_detectVisualStudio |
| 43 | ) |
| 44 | :skip_detectVisualStudio2012 |
| 45 | |
| 46 | REM |
| 47 | REM Visual Studio 2010 |
| 48 | REM |
| 49 | IF NOT DEFINED VS100COMNTOOLS GOTO skip_detectVisualStudio2010 |
| 50 | SET VSVARS32=%VS100COMNTOOLS%\vsvars32.bat |
| 51 | IF EXIST "%VSVARS32%" ( |
| 52 | %_AECHO% Using Visual Studio 2010... |
| 53 | GOTO skip_detectVisualStudio |
| 54 | ) |
| 55 | :skip_detectVisualStudio2010 |
| 56 | |
| 57 | REM |
| 58 | REM Visual Studio 2008 |
| 59 | REM |
| 60 | IF NOT DEFINED VS90COMNTOOLS GOTO skip_detectVisualStudio2008 |
| 61 | SET VSVARS32=%VS90COMNTOOLS%\vsvars32.bat |
| 62 | IF EXIST "%VSVARS32%" ( |
| 63 | %_AECHO% Using Visual Studio 2008... |
| 64 | GOTO skip_detectVisualStudio |
| 65 | ) |
| 66 | :skip_detectVisualStudio2008 |
| 67 | |
| 68 | REM |
| 69 | REM Visual Studio 2005 |
| 70 | REM |
| 71 | IF NOT DEFINED VS80COMNTOOLS GOTO skip_detectVisualStudio2005 |
| 72 | SET VSVARS32=%VS80COMNTOOLS%\vsvars32.bat |
| 73 | IF EXIST "%VSVARS32%" ( |
| 74 | %_AECHO% Using Visual Studio 2005... |
| 75 | GOTO skip_detectVisualStudio |
| 76 | ) |
| 77 | :skip_detectVisualStudio2005 |
| 78 | |
| 79 | REM |
| 80 | REM Visual Studio 2003 |
| 81 | REM |
| 82 | IF NOT DEFINED VS71COMNTOOLS GOTO skip_detectVisualStudio2003 |
| 83 | SET VSVARS32=%VS71COMNTOOLS%\vsvars32.bat |
| 84 | IF EXIST "%VSVARS32%" ( |
| 85 | %_AECHO% Using Visual Studio 2003... |
| 86 | GOTO skip_detectVisualStudio |
| 87 | ) |
| 88 | :skip_detectVisualStudio2003 |
| 89 | |
| 90 | REM |
| 91 | REM Visual Studio 2002 |
| 92 | REM |
| 93 | IF NOT DEFINED VS70COMNTOOLS GOTO skip_detectVisualStudio2002 |
| 94 | SET VSVARS32=%VS70COMNTOOLS%\vsvars32.bat |
| 95 | IF EXIST "%VSVARS32%" ( |
| 96 | %_AECHO% Using Visual Studio 2002... |
| 97 | GOTO skip_detectVisualStudio |
| 98 | ) |
| 99 | :skip_detectVisualStudio2002 |
| 100 | |
| 101 | REM |
| 102 | REM NOTE: If we get to this point, no Visual Studio build environment batch |
| 103 | REM files were found. |
| 104 | REM |
| 105 | ECHO No Visual Studio build environment batch files were found. |
| 106 | GOTO errors |
| 107 | |
| 108 | REM |
| 109 | REM NOTE: At this point, the appropriate Visual Studio version should be |
| 110 | REM selected. |
| 111 | REM |
| 112 | :skip_detectVisualStudio |
| 113 | |
| 114 | REM |
| 115 | REM NOTE: Remove any double-backslash sequences that may be present in the |
| 116 | REM selected Visual Studio common tools path. This is not strictly |
| 117 | REM necessary; however, it makes reading the output easier. |
| @@ -70,19 +118,10 @@ | |
| 118 | REM |
| 119 | SET VSVARS32=%VSVARS32:\\=\% |
| 120 | |
| 121 | %_VECHO% VsVars32 = '%VSVARS32%' |
| 122 | |
| 123 | REM |
| 124 | REM NOTE: Setup local environment variables that point to the root directory |
| 125 | REM of the Fossil source checkout and to the directory containing this |
| 126 | REM build tool. |
| 127 | REM |
| @@ -106,11 +145,11 @@ | |
| 145 | REM variables for building with MSVC. |
| 146 | REM |
| 147 | %__ECHO3% CALL "%VSVARS32%" |
| 148 | |
| 149 | IF ERRORLEVEL 1 ( |
| 150 | ECHO Visual Studio build environment batch file "%VSVARS32%" failed. |
| 151 | GOTO errors |
| 152 | ) |
| 153 | |
| 154 | REM |
| 155 | REM NOTE: Attempt to create the build output directory, if necessary. |
| 156 |
+4
-2
| --- www/build.wiki | ||
| +++ www/build.wiki | ||
| @@ -92,13 +92,15 @@ | ||
| 92 | 92 | "<b>make -f win/Makefile.mingw</b>". On a Windows box you will |
| 93 | 93 | need either Cygwin or Msys as build environment. On Cygwin, Linux |
| 94 | 94 | or Darwin you may want to make minor edits to win/Makefile.mingw |
| 95 | 95 | to configure the cross-compile environment. |
| 96 | 96 | |
| 97 | -<li><p><i>VC++</i> → Use the msc makefile. First | |
| 97 | +<li><p><i>MSVC</i> → Use the msc makefile. First | |
| 98 | 98 | change to the "win/" subdirectory ("<b>cd win</b>") then run |
| 99 | -"<b>nmake /f Makefile.msc</b>". | |
| 99 | +"<b>nmake /f Makefile.msc</b>". Alternatively, the batch file | |
| 100 | +"<b>win\buildmsvc.bat</b>" may be used and it will attempt to | |
| 101 | +detect and use the latest installed version of MSVC. | |
| 100 | 102 | </ol> |
| 101 | 103 | </ol> |
| 102 | 104 | |
| 103 | 105 | <h2>3.0 Installing</h2> |
| 104 | 106 | |
| 105 | 107 |
| --- www/build.wiki | |
| +++ www/build.wiki | |
| @@ -92,13 +92,15 @@ | |
| 92 | "<b>make -f win/Makefile.mingw</b>". On a Windows box you will |
| 93 | need either Cygwin or Msys as build environment. On Cygwin, Linux |
| 94 | or Darwin you may want to make minor edits to win/Makefile.mingw |
| 95 | to configure the cross-compile environment. |
| 96 | |
| 97 | <li><p><i>VC++</i> → Use the msc makefile. First |
| 98 | change to the "win/" subdirectory ("<b>cd win</b>") then run |
| 99 | "<b>nmake /f Makefile.msc</b>". |
| 100 | </ol> |
| 101 | </ol> |
| 102 | |
| 103 | <h2>3.0 Installing</h2> |
| 104 | |
| 105 |
| --- www/build.wiki | |
| +++ www/build.wiki | |
| @@ -92,13 +92,15 @@ | |
| 92 | "<b>make -f win/Makefile.mingw</b>". On a Windows box you will |
| 93 | need either Cygwin or Msys as build environment. On Cygwin, Linux |
| 94 | or Darwin you may want to make minor edits to win/Makefile.mingw |
| 95 | to configure the cross-compile environment. |
| 96 | |
| 97 | <li><p><i>MSVC</i> → Use the msc makefile. First |
| 98 | change to the "win/" subdirectory ("<b>cd win</b>") then run |
| 99 | "<b>nmake /f Makefile.msc</b>". Alternatively, the batch file |
| 100 | "<b>win\buildmsvc.bat</b>" may be used and it will attempt to |
| 101 | detect and use the latest installed version of MSVC. |
| 102 | </ol> |
| 103 | </ol> |
| 104 | |
| 105 | <h2>3.0 Installing</h2> |
| 106 | |
| 107 |