Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/installer/release.bat

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10437 - (show annotations) (download) (as text)
Mon Dec 26 15:45:29 2022 UTC (14 months, 1 week ago) by zmatsuo
File MIME type: application/x-msdos-program
File size: 7793 byte(s)
ビルドスクリプトで使用する cygwin,perl を調整

- installer/release.bat
  - buildtools/cygwin64 がある場合使用するようにした
- installer/build.bat
  - i686-pc-cygwin-g++.exe が実行できるとき32bit版cygtermをビルドするようにした
- cmakeビルド時,buildtools/cygwin64 内の perl も利用候補にした
- getperl.bat 使用時 perlのダウンロード,展開に cmake も使用できるようにした
  - cmake のほうが powershell より高速に処理できる
1 @echo off
2 setlocal
3 set CUR=%~dp0
4 cd /d %CUR%
5
6 rem set VS_VERSION=2019
7 if "%VS_VERSION%" == "" set VS_VERSION=2022
8
9 if "%APPVEYOR%" == "True" set NOPAUSE=1
10 if exist ..\buildtools\svnrev\sourcetree_info.bat del ..\buildtools\svnrev\sourcetree_info.bat
11
12 call :setup_tools_env
13
14 echo =======
15 echo 1. force download and rebuild libs / rebuild Tera Term, installer, archive
16 echo 2. download and build libs / rebuild Tera Term, installer, archive
17 echo 3. download and build libs / build Tera Term, installer, archive
18 echo 4. download and build libs
19 echo 5. build libs / rebuild Tera Term, installer, archive
20 echo 6. build libs / build Tera Term, installer, archive
21 echo 7. exec cmd.exe
22 echo 8. check tools
23 echo 9. exit
24
25 if "%1" == "" (
26 set /p no="select no "
27 ) else (
28 set no=%1
29 )
30 echo %no%
31
32 if "%no%" == "1" (
33 call :download_libs force
34 call :build_libs
35 call :build_teraterm rebuild
36 )
37
38 if "%no%" == "2" (
39 call :download_libs
40 call :build_libs
41 call :build_teraterm rebuild
42 )
43
44 if "%no%" == "3" (
45 call :download_libs
46 call :build_libs
47 call :build_teraterm
48 )
49
50 if "%no%" == "4" (
51 call :download_libs
52 call :build_libs
53 )
54
55 if "%no%" == "5" (
56 call :build_teraterm rebuild
57 )
58
59 if "%no%" == "6" (
60 call :build_teraterm
61 )
62
63 if "%no%" == "7" (
64 call :exec_cmd
65 )
66
67 if "%no%" == "8" (
68 call :check_tools
69 )
70
71 if not "%NOPAUSE%" == "1" pause
72 exit /b 0
73
74
75 rem ####################
76 :download_libs
77
78 setlocal
79 cd /d %CUR%..\libs
80
81 set OPT=
82 if "%1" == "force" set OPT=-DFORCE_DOWNLOAD=on
83 %CMAKE% %OPT% -P download.cmake
84
85 endlocal
86 exit /b 0
87
88 rem ####################
89 :build_libs
90
91 setlocal
92 cd /d %CUR%..\libs
93 call buildall.bat
94 endlocal
95 exit /b 0
96
97 rem ####################
98 :build_teraterm
99
100 setlocal
101 cd /d %CUR%
102 set TT_VERSION=
103 for /f "delims=" %%i in ('perl issversion.pl') do @set TT_VERSION=%%i
104
105 if "%RELEASE%" == "1" (
106 call build.bat rebuild
107 call makearchive.bat release
108 ) else if "%1" == "rebuild" (
109 call build.bat rebuild
110 call makearchive.bat
111 ) else (
112 call makearchive.bat
113 )
114 if not exist Output mkdir Output
115 set SNAPSHOT_PORTABLE_OUTPUT="teraterm-%TT_VERSION%-r%SVNVERSION%-%DATE%_%TIME%-%USERNAME%-snapshot"
116 if "%RELEASE%" == "1" (
117 pushd Output
118 %CMAKE% -E tar cf teraterm-%TT_VERSION%.zip --format=zip teraterm-%TT_VERSION%/
119 %CMAKE% -E tar cf teraterm-%TT_VERSION%_pdb.zip --format=zip teraterm-%TT_VERSION%_pdb/
120 popd
121 set INNO_SETUP_OPT_VERSION=
122 set INNO_SETUP_OPT_OUTPUT=
123 ) else (
124 %CMAKE% -E rename snapshot-%DATE%_%TIME% %SNAPSHOT_PORTABLE_OUTPUT%
125 %CMAKE% -E rename snapshot-%DATE%_%TIME%_pdb %SNAPSHOT_PORTABLE_OUTPUT%_pdb
126 %CMAKE% -E tar cf Output/%SNAPSHOT_PORTABLE_OUTPUT%.zip --format=zip %SNAPSHOT_PORTABLE_OUTPUT%
127 %CMAKE% -E tar cf Output/%SNAPSHOT_PORTABLE_OUTPUT%_pdb.zip --format=zip %SNAPSHOT_PORTABLE_OUTPUT%_pdb
128 %CMAKE% -E rename %SNAPSHOT_PORTABLE_OUTPUT% snapshot-%DATE%_%TIME%
129 %CMAKE% -E rename %SNAPSHOT_PORTABLE_OUTPUT%_pdb snapshot-%DATE%_%TIME%_pdb
130 set INNO_SETUP_OPT_VERSION="/DVerSubStr=r%SVNVERSION%-%DATE%_%TIME%"
131 set INNO_SETUP_OPT_OUTPUT="/DOutputSubStr=r%SVNVERSION%-%DATE%_%TIME%-%USERNAME%-snapshot"
132 )
133 %INNO_SETUP% %INNO_SETUP_OPT_VERSION% %INNO_SETUP_OPT_OUTPUT% teraterm.iss
134
135 endlocal
136 exit /b 0
137
138 rem ####################
139 :setup_tools_env
140
141 set CYGWIN_PATH=%CUR%..\buildtools\cygwin64\bin
142 if exist "%CYGWIN_PATH%" goto cygwin_path_pass
143 set CYGWIN_PATH=C:\cygwin64\bin
144 if exist "%CYGWIN_PATH%" goto cygwin_path_pass
145 echo cygwin not found
146 if not "%NOPAUSE%" == "1" pause
147 exit
148 :cygwin_path_pass
149 set VS_BASE=C:\Program Files\Microsoft Visual Studio\%VS_VERSION%
150 if exist "%VS_BASE%" goto vs_base_pass
151 set VS_BASE=C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%
152 :vs_base_pass
153
154
155 if exist toolinfo.bat (
156 echo found toolinfo.bat
157 call toolinfo.bat
158 echo toolinfo.bat ok
159 ) else (
160 set PATH=
161 )
162
163 set PATH=%SystemRoot%;%PATH%
164 set PATH=%SystemRoot%\system32;%PATH%
165 call :search_perl
166 call :search_svn
167 call :search_iscc
168 set PATH=%SVN_PATH%;%PATH%
169 set PATH=%PERL_PATH%;%PATH%
170 call :set_vs_env
171 call :search_cmake
172 set PATH=%CYGWIN_PATH%;%PATH%
173 set PATH=%CMAKE_PATH%;%PATH%
174 exit /b 0
175
176 rem ####################
177 :search_perl
178 if exist %PERL_PATH%\perl.exe (
179 set PERL=%PERL_PATH%\perl.exe
180 exit /b 0
181 )
182
183 set PERL=perl.exe
184 where %PERL% > nul 2>&1
185 if %errorlevel% == 0 exit /b 0
186 set PERL=%CUR%..\buildtools\cygwin64\bin\perl.exe
187 if exist %PERL% exit /b 0
188 set PERL=%CUR%..\buildtools\perl\perl\bin\perl.exe
189 if exist %PERL% exit /b 0
190 set PERL=C:\Strawberry\perl\bin\perl.exe
191 if exist %PERL% exit /b 0
192 set PERL=C:\Perl64\bin\perl.exe
193 if exist %PERL% exit /b 0
194 set PERL=C:\Perl\bin\perl.exe
195 if exist %PERL% exit /b 0
196 set PERL=C:\cygwin64\bin\perl.exe
197 if exist %PERL% exit /b 0
198 set PERL=C:\cygwin\bin\perl.exe
199 if exist %PERL% exit /b 0
200 echo perl not found
201 if not "%NOPAUSE%" == "1" pause
202 exit
203
204 rem ####################
205 :search_svn
206 if exist %SVN_PATH%\svn.exe (
207 set SVN=%SVN_PATH%\svn.exe
208 exit /b 0
209 )
210
211 set SVN=svn.exe
212 where %SVN% > nul 2>&1
213 if %errorlevel% == 0 exit /b 0
214 set SVN_PATH=C:\Program Files (x86)\Subversion\bin
215 set SVN="%SVN_PATH%\svn.exe"
216 if exist %SVN% exit /b 0
217 set SVN_PATH=C:\Program Files\TortoiseSVN\bin
218 set SVN="%SVN_PATH%\svn.exe"
219 if exist %SVN% exit /b 0
220 echo svn not found
221 if not "%NOPAUSE%" == "1" pause
222 exit
223
224 rem ####################
225 :search_cmake
226 if exist %CMAKE_PATH%\cmake.exe (
227 set CMAKE="%CMAKE_PATH%\cmake.exe"
228 exit /b 0
229 )
230 if "%CMAKE%" == "" set CMAKE="cmake.exe"
231
232 where %CMAKE% > nul 2>&1
233 if %errorlevel% == 0 exit /b 0
234 set CMAKE_PATH=C:\Program Files\CMake\bin
235 set CMAKE="%CMAKE_PATH%\cmake.exe"
236 if exist %CMAKE% exit /b 0
237 set CMAKE_PATH=%VCINSTALLDIR%\..\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
238 set CMAKE="%CMAKE_PATH%\cmake.exe"
239 if exist %CMAKE% exit /b 0
240 echo cmake not found
241 if not "%NOPAUSE%" == "1" pause
242 exit
243
244 rem ####################
245 :search_iscc
246 if [%INNO_SETUP%] == [] goto search_iscc_1
247 if exist %INNO_SETUP% (
248 exit /b 0
249 )
250 echo INNO_SETUP=%INNO_SETUP%
251 goto search_iscc_not_found
252
253 :search_iscc_1
254 set INNO_SETUP=%CUR%..\buildtools\innosetup6\bin\ISCC.exe
255 if exist %INNO_SETUP% exit /b 0
256 set INNO_SETUP="C:\Program Files (x86)\Inno Setup 6\iscc.exe"
257 if exist %INNO_SETUP% exit /b 0
258 :search_iscc_not_found
259 echo iscc(inno setup) not found
260 if not "%NOPAUSE%" == "1" pause
261 exit
262
263 rem ####################
264 :set_vs_env
265
266 if exist "%VS_BASE%\Community" (
267 call "%VS_BASE%\Community\VC\Auxiliary\Build\vcvars32.bat"
268 exit /b 0
269 )
270 if exist "%VS_BASE%\Professional" (
271 call "%VS_BASE%\Profssional\VC\Auxiliary\Build\vcvars32.bat"
272 exit /b 0
273 )
274 if exist "%VS_BASE%\Enterprise" (
275 call "%VS_BASE%\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
276 exit /b 0
277 )
278 :vs_not_found
279 echo Visual Studio not found
280 echo VS_BASE=%VS_BASE%
281 if not "%NOPAUSE%" == "1" pause
282 exit
283
284 rem ####################
285 :exec_cmd
286 call ..\buildtools\svnrev\svnrev.bat
287 call ..\buildtools\svnrev\sourcetree_info.bat
288 cmd
289 exit /b 0
290
291 rem ####################
292 :check_tools
293
294 echo cmd(windows)
295 ver
296
297 echo Visual Studio
298 echo VS_BASE=%VS_BASE%
299 cl
300
301 echo svn
302 where svn
303 echo SVN_PATH=%SVN_PATH%
304 echo SVN=%SVN%
305 svn --version
306
307 echo perl
308 where perl
309 echo PERL_PATH=%PERL_PATH%
310 echo PERL=%PERL%
311 %PERL% --version
312
313 echo cmake
314 where cmake
315 echo CMAKE_PATH=%CMAKE_PATH%
316 echo CMAKE=%CMAKE%
317 %CMAKE% --version
318
319 echo cygwin
320 echo CYGWIN_PATH=%CYGWIN_PATH%
321 cygcheck -c base-cygwin
322 cygcheck -c gcc-core
323 cygcheck -c w32api-headers
324 cygcheck -c make
325
326 echo inno setup
327 echo INNO_SETUP=%INNO_SETUP%
328 %INNO_SETUP% /?
329
330 exit /b 0

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26