Fossil SCM

Further robustness enhancements to the automated MSVC batch file. Also, update build wiki page to refer to it.

mistachkin 2013-12-18 23:19 trunk
Commit c11c8707619bfa26bd9afcdb8658aa4996d352bb
2 files changed +58 -19 +4 -2
+58 -19
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -1,11 +1,11 @@
11
@ECHO OFF
22
33
::
44
:: buildmsvc.bat --
55
::
6
-:: This batch file attempts to compile Fossil using the latest version
6
+:: This batch file attempts to build Fossil using the latest version
77
:: Microsoft Visual Studio installed on this machine.
88
::
99
::
1010
1111
SETLOCAL
@@ -17,53 +17,101 @@
1717
IF NOT DEFINED _VECHO (SET _VECHO=REM)
1818
1919
REM
2020
REM Visual Studio ????
2121
REM
22
-IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" GOTO skip_setVisualStudio
22
+IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" GOTO skip_detectVisualStudio
2323
2424
REM
2525
REM Visual Studio 2013
2626
REM
27
+IF NOT DEFINED VS120COMNTOOLS GOTO skip_detectVisualStudio2013
2728
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
2934
3035
REM
3136
REM Visual Studio 2012
3237
REM
38
+IF NOT DEFINED VS110COMNTOOLS GOTO skip_detectVisualStudio2012
3339
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
3545
3646
REM
3747
REM Visual Studio 2010
3848
REM
49
+IF NOT DEFINED VS100COMNTOOLS GOTO skip_detectVisualStudio2010
3950
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
4156
4257
REM
4358
REM Visual Studio 2008
4459
REM
60
+IF NOT DEFINED VS90COMNTOOLS GOTO skip_detectVisualStudio2008
4561
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
4767
4868
REM
4969
REM Visual Studio 2005
5070
REM
71
+IF NOT DEFINED VS80COMNTOOLS GOTO skip_detectVisualStudio2005
5172
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
5378
5479
REM
5580
REM Visual Studio 2003
5681
REM
82
+IF NOT DEFINED VS71COMNTOOLS GOTO skip_detectVisualStudio2003
5783
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
59107
60108
REM
61109
REM NOTE: At this point, the appropriate Visual Studio version should be
62110
REM selected.
63111
REM
64
-:skip_setVisualStudio
112
+:skip_detectVisualStudio
65113
66114
REM
67115
REM NOTE: Remove any double-backslash sequences that may be present in the
68116
REM selected Visual Studio common tools path. This is not strictly
69117
REM necessary; however, it makes reading the output easier.
@@ -70,19 +118,10 @@
70118
REM
71119
SET VSVARS32=%VSVARS32:\\=\%
72120
73121
%_VECHO% VsVars32 = '%VSVARS32%'
74122
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
-
84123
REM
85124
REM NOTE: Setup local environment variables that point to the root directory
86125
REM of the Fossil source checkout and to the directory containing this
87126
REM build tool.
88127
REM
@@ -106,11 +145,11 @@
106145
REM variables for building with MSVC.
107146
REM
108147
%__ECHO3% CALL "%VSVARS32%"
109148
110149
IF ERRORLEVEL 1 (
111
- ECHO Visual Studio environment batch file "%VSVARS32%" failed.
150
+ ECHO Visual Studio build environment batch file "%VSVARS32%" failed.
112151
GOTO errors
113152
)
114153
115154
REM
116155
REM NOTE: Attempt to create the build output directory, if necessary.
117156
--- 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 @@
9292
"<b>make -f win/Makefile.mingw</b>". On a Windows box you will
9393
need either Cygwin or Msys as build environment. On Cygwin, Linux
9494
or Darwin you may want to make minor edits to win/Makefile.mingw
9595
to configure the cross-compile environment.
9696
97
-<li><p><i>VC++</i> → Use the msc makefile. First
97
+<li><p><i>MSVC</i> → Use the msc makefile. First
9898
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.
100102
</ol>
101103
</ol>
102104
103105
<h2>3.0 Installing</h2>
104106
105107
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button