Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/installer/release.bat

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9813 - (show annotations) (download) (as text)
Mon Mar 14 14:44:20 2022 UTC (23 months, 3 weeks ago) by zmatsuo
File MIME type: application/x-msdos-program
File size: 7824 byte(s)
ライブラリの更新チェックを可能にした

- ライブラリが存在しない、想定したものと異なる場合にライブラリをダウンロードド、展開する
- 強制的にダウンロード、展開する
1 @echo off
2 setlocal
3 set CUR=%~dp0
4 cd /d %CUR%
5
6 set VS_VERSION=2019
7 set ONIG_VERSION=6.9.7.1
8 rem for 6.9.7.1
9 set ONIG_FOLDER_NAME=6.9.7
10 set ZLIB_VERSION=1.2.11
11 set PUTTY_VERSION=0.76
12 set SFMT_VERSION=1.5.1
13 set CJSON_VERSION=1.7.14
14 set ARGON2_VERSION=20190702
15 set LIBRESSL_VERSION=3.4.2
16
17 call :setup_tools_env
18
19 echo =======
20 echo 1. force download and rebuild libs / rebuild Tera Term, installer, archive
21 echo 2. download and build libs / rebuild Tera Term, installer, archive
22 echo 3. download and build libs
23 echo 4. build libs and rebuild Tera Term, installer, archive (for Release build)
24 echo 5. build libs and Tera Term (for Normal build, snapshot)
25 echo 7. exec cmd.exe
26 echo 8. check tools
27 echo 9. exit
28
29 if "%1" == "" (
30 set /p no="select no "
31 ) else (
32 set no=%1
33 )
34 echo %no%
35
36 if "%no%" == "1" (
37 call :download_libs force
38 call :build_teraterm freeze_state
39 )
40
41 if "%no%" == "2" (
42 call :download_libs
43 call :build_libs
44 call :build_teraterm freeze_state
45 )
46
47 if "%no%" == "3" (
48 call :download_libs
49 call :build_libs
50 )
51
52 if "%no%" == "4" (
53 call :build_teraterm freeze_state
54 )
55
56 if "%no%" == "5" (
57 call :build_teraterm
58 )
59
60 if "%no%" == "7" (
61 call :exec_cmd
62 )
63
64 if "%no%" == "8" (
65 call :check_tools
66 )
67
68 pause
69 exit 0
70
71
72 rem ####################
73 :download_libs
74
75 setlocal
76 cd /d %CUR%..\libs
77
78 if "%1" == "force" goto download_libs_download
79
80 cmake -P checklibs.cmake
81 call checklibs_result.bat
82 del checklibs_result.bat
83 if "%RESULT%" == "1" (
84 echo already all library downloaded
85 goto download_libs_finish
86 )
87
88 :download_libs_download
89
90 :oniguruma
91 %CURL% -L https://github.com/kkos/oniguruma/releases/download/v%ONIG_VERSION%/onig-%ONIG_VERSION%.tar.gz -o oniguruma.tar.gz
92 %CMAKE% -E tar xf oniguruma.tar.gz
93 %CMAKE% -E rm -rf oniguruma
94 %CMAKE% -E rename onig-%ONIG_FOLDER_NAME% oniguruma
95
96 :zlib
97 %CURL% -L https://zlib.net/zlib-%ZLIB_VERSION%.tar.xz -o zlib.tar.xz
98 %CMAKE% -E tar xf zlib.tar.xz
99 %CMAKE% -E rm -rf zlib
100 %CMAKE% -E rename zlib-%ZLIB_VERSION% zlib
101
102 :putty
103 %CURL% -L https://the.earth.li/~sgtatham/putty/%PUTTY_VERSION%/putty-%PUTTY_VERSION%.tar.gz -o putty.tar.gz
104 %CMAKE% -E tar xf putty.tar.gz
105 %CMAKE% -E rm -rf putty
106 %CMAKE% -E rename putty-%PUTTY_VERSION% putty
107
108 :SFMT
109 %CURL% -L http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/SFMT-src-%SFMT_VERSION%.zip -o sfmt.zip
110 %CMAKE% -E tar xf sfmt.zip
111 %CMAKE% -E rm -rf SFMT
112 %CMAKE% -E rename SFMT-src-%SFMT_VERSION% SFMT
113 echo #define SFMT_VERSION "%SFMT_VERSION%" > SFMT\SFMT_version_for_teraterm.h
114
115 :cJSON
116 %CURL% -L https://github.com/DaveGamble/cJSON/archive/v%CJSON_VERSION%.zip -o cJSON.zip
117 %CMAKE% -E tar xf cJSON.zip
118 %CMAKE% -E rm -rf cJSON
119 %CMAKE% -E rename cJSON-%CJSON_VERSION% cJSON
120
121 :argon2
122 %CURL% -L https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/%ARGON2_VERSION%.tar.gz -o argon2.tar.gz
123 %CMAKE% -E tar xf argon2.tar.gz
124 %CMAKE% -E rm -rf argon2
125 %CMAKE% -E rename phc-winner-argon2-%ARGON2_VERSION% argon2
126
127 :libressl
128 %CURL% -L https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-%LIBRESSL_VERSION%.tar.gz -o libressl.tar.gz
129 %CMAKE% -E tar xf libressl.tar.gz
130 %CMAKE% -E rm -rf libressl
131 %CMAKE% -E rename libressl-%LIBRESSL_VERSION% libressl
132
133 :download_libs_finish
134 endlocal
135 exit /b 0
136
137 rem ####################
138 :build_libs
139
140 setlocal
141 cd /d %CUR%..\libs
142 call buildall.bat
143 endlocal
144 exit /b 0
145
146 rem ####################
147 :build_teraterm
148
149 setlocal
150 cd /d %CUR%
151 set TT_VERSION=
152 for /f "delims=" %%i in ('perl issversion.pl') do @set TT_VERSION=%%i
153
154 if "%1" == "freeze_state" (
155 call build.bat rebuild
156 call makearchive.bat release
157 ) else (
158 call makearchive.bat
159 )
160 call ..\buildtools\svnrev\sourcetree_info.bat
161 if "%1" == "freeze_state" (
162 pushd Output
163 %CMAKE% -E tar cf teraterm-%TT_VERSION%.zip --format=zip teraterm-%TT_VERSION%/
164 popd
165 ) else (
166 %CMAKE% -E tar cf TERATERM_r%SVNVERSION%_%DATE%_%TIME%.zip --format=zip snapshot-%DATE%_%TIME%
167 )
168 %INNO_SETUP% teraterm.iss
169
170 endlocal
171 exit /b 0
172
173 rem ####################
174 :setup_tools_env
175
176 set CURL=%SystemRoot%\System32\curl.exe
177 set CYGWIN_PATH=C:\cygwin64\bin
178 set VS_BASE=C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%
179
180 if exist toolinfo.bat (
181 echo found toolinfo.bat
182 call toolinfo.bat
183 echo toolinfo.bat ok
184 ) else (
185 set PATH=
186 )
187
188 call :search_perl
189 call :search_svn
190 call :search_iscc
191 set PATH=%PATH%;%SVN_PATH%
192 set PATH=%PATH%;%PERL_PATH%
193 set PATH=%PATH%;%SystemRoot%
194 set PATH=%PATH%;%SystemRoot%\system32
195 call :set_vs_env
196 call :search_cmake
197 set PATH=%PATH%;%CYGWIN_PATH%
198 set PATH=%PATH%;%CMAKE_PATH%
199 exit /b 0
200
201 rem ####################
202 :search_perl
203 if exist %PERL_PATH%\perl.exe (
204 set PERL=%PERL_PATH%\perl.exe
205 exit /b 0
206 )
207
208 set PERL=perl.exe
209 where %PERL% > nul 2>&1
210 if %errorlevel% == 0 exit /b 0
211 set PERL=%CUR%..\buildtools\perl\perl\bin\perl.exe
212 if exist %PERL% exit /b 0
213 set PERL=C:\Strawberry\perl\bin\perl.exe
214 if exist %PERL% exit /b 0
215 set PERL=C:\Perl64\bin\perl.exe
216 if exist %PERL% exit /b 0
217 set PERL=C:\Perl\bin\perl.exe
218 if exist %PERL% exit /b 0
219 set PERL=C:\cygwin64\usr\bin\perl.exe
220 if exist %PERL% exit /b 0
221 set PERL=C:\cygwin\usr\bin\perl.exe
222 if exist %PERL% exit /b 0
223 echo perl not found
224 pause
225 exit
226
227 rem ####################
228 :search_svn
229 if exist %SVN_PATH%\svn.exe (
230 set SVN=%SVN_PATH%\svn.exe
231 exit /b 0
232 )
233
234 set SVN=svn.exe
235 where %SVN% > nul 2>&1
236 if %errorlevel% == 0 exit /b 0
237 set SVN_PATH=C:\Program Files (x86)\Subversion\bin
238 set SVN="%SVN_PATH%\svn.exe"
239 if exist %SVN% exit /b 0
240 set SVN_PATH=C:\Program Files\TortoiseSVN\bin
241 set SVN="%SVN_PATH%\svn.exe"
242 if exist %SVN% exit /b 0
243 echo svn not found
244 pause
245 exit
246
247 rem ####################
248 :search_cmake
249 if exist %CMAKE_PATH%\cmake.exe (
250 set CMAKE="%CMAKE_PATH%\cmake.exe"
251 exit /b 0
252 )
253
254 where %CMAKE% > nul 2>&1
255 if %errorlevel% == 0 exit /b 0
256 set CMAKE_PATH=C:\Program Files\CMake\bin
257 set CMAKE="%CMAKE_PATH%\cmake.exe"
258 if exist %CMAKE% exit /b 0
259 set CMAKE_PATH=%VCINSTALLDIR%\..\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
260 set CMAKE="%CMAKE_PATH%\cmake.exe"
261 if exist %CMAKE% exit /b 0
262 echo cmake not found
263 pause
264 exit
265
266 rem ####################
267 :search_iscc
268 if [%INNO_SETUP%] == [] goto search_iscc_1
269 if exist %INNO_SETUP% (
270 exit /b 0
271 )
272 echo INNO_SETUP=%INNO_SETUP%
273 goto search_iscc_not_found
274
275 :search_iscc_1
276 set INNO_SETUP=%CUR%..\buildtools\innosetup6\bin\ISCC.exe
277 if exist %INNO_SETUP% exit /b 0
278 set INNO_SETUP="C:\Program Files (x86)\Inno Setup 6\iscc.exe"
279 if exist %INNO_SETUP% exit /b 0
280 :search_iscc_not_found
281 echo iscc(inno setup) not found
282 pause
283 exit
284
285 rem ####################
286 :set_vs_env
287
288 if exist "%VS_BASE%\Community" (
289 call "%VS_BASE%\Community\VC\Auxiliary\Build\vcvars32.bat"
290 )
291 if exist "%VS_BASE%\Professional" (
292 call "%VS_BASE%\Profssional\VC\Auxiliary\Build\vcvars32.bat"
293 )
294 if exist "%VS_BASE%\Enterprise" (
295 call "%VS_BASE%\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
296 )
297 exit /b 0
298
299 rem ####################
300 :exec_cmd
301 cmd
302 exit /b 0
303
304 rem ####################
305 :check_tools
306
307 echo cmd(windows)
308 ver
309
310 echo Visual Studio
311 echo VS_BASE=%VS_BASE%
312 cl
313
314 echo curl
315 where curl
316 echo CURL=%CURL%
317 %CURL% --version
318
319 echo svn
320 where svn
321 echo SVN_PATH=%SVN_PATH%
322 echo SVN=%SVN%
323 svn --version
324
325 echo perl
326 where perl
327 echo PERL_PATH=%PERL_PATH%
328 echo PERL=%PERL%
329 perl --version
330
331 echo cmake
332 where cmake
333 echo CMAKE_PATH=%CMAKE_PATH%
334 echo CMAKE=%CMAKE%
335 %CMAKE% --version
336
337 echo cygwin
338 echo CYGWIN_PATH=%CYGWIN_PATH%
339 cygcheck -c base-cygwin
340 cygcheck -c gcc-core
341 cygcheck -c w32api-headers
342 cygcheck -c make
343
344 echo inno setup
345 echo INNO_SETUP=%INNO_SETUP%
346 %INNO_SETUP% /?
347
348 exit /b 0

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