-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease-mingw.cmd
69 lines (55 loc) · 2.44 KB
/
release-mingw.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
:: Build release version using MinGW
@setlocal
@set MINGWROOT=c:\msys64
:: Get package name from configure.{ac,in}
@if exist configure.in set configure=configure.in
@if exist configure.ac set configure=configure.ac
@for /F "usebackq delims=[] tokens=2" %%i in (`findstr "AC_INIT" %configure%`) do @set package=%%i
@if NOT "x%package%" == "x" goto getversion
@echo Could not get package name!
@goto error_exit
:getversion
@for /F "usebackq delims=[], tokens=4" %%i in (`findstr "AC_INIT" %configure%`) do @set version=%%i
@if NOT "x%version%" == "x" goto setup
@echo Could not get package version!
@goto error_exit
:setup
@set DISTRO=%~dp0\dist\mingw\%package%-%version%
@set TCLROOT=C:\tcl
@set TCLROOTU=%TCLROOT:\=/%
@call :build 9.0.0 mingw64 --enable-64bit || goto abort
@call :build 9.0.0 mingw32 || goto abort
@call :build 8.6.10 mingw64 --enable-64bit || goto abort
@call :build 8.6.10 mingw32 || goto abort
@endlocal
@exit /b 0
:abort
@echo ERROR: build failed!
@endlocal
@exit /b 1
:: ============================================================
:: Usage: build TCLVERSION mingw32|mingw64 ?other configure options?
:build
@set builddir=build\%1-%2
@set tcldir="%TCLROOT%\%1\%2"
@set tcldiru="%TCLROOTU%/%1/%2"
@call :resetdir %builddir%
@pushd %builddir%
:: The --prefix option is required because otherwise mingw's config.site file
:: overrides the prefix in tclConfig.sh resulting in man pages installed in
:: the system directory.
if NOT EXIST Makefile call "%MINGWROOT%\msys2_shell.cmd" -defterm -no-start -here -%2 -l -c "../../configure --prefix=""%tcldiru%"" --with-tcl=""%tcldiru%/lib"" --with-tclinclude=""%tcldiru%/include"" %3" || echo %1 %2 configure failed && popd && goto abort
@call "%MINGWROOT%\msys2_shell.cmd" -defterm -no-start -here -%2 -l -c make || echo %1 %2 make failed && goto abort
@call "%MINGWROOT%\msys2_shell.cmd" -defterm -no-start -here -%2 -l -c "make install-strip" || echo %1 %2 make install failed && popd && goto abort
@if exist %tcldir%\lib\tcl%package%%version% xcopy /S /I /Y %tcldir%\lib\tcl%package%%version% "%DISTRO%" || goto abort
@if exist %tcldir%\lib\%package%%version% xcopy /S /I /Y %tcldir%\lib\%package%%version% "%DISTRO%" || goto abort
@popd
@goto :eof
:: ==========================================================
:: ==========================================================
:: Usage: resetdir DIR
:resetdir
@if exist %1 rmdir/s/q %1
@mkdir %1
@goto :eof
:: ==========================================================