summaryrefslogtreecommitdiffstats
path: root/buildqt64.bat
blob: 655189143cdf63c2dd9cb9a779ca813ffa9bab1b (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@echo off

SET BASEDIR=%~dp0

IF NOT DEFINED SDKDIR (
    ECHO SDKDIR is not defined.
    EXIT /b 1
)
if not defined PERLDIR (
    echo PERLDIR is not defined.
    exit /b 1
)
if not defined NASMDIR (
    echo NASMDIR is not defined.
    exit /b 1
)
if not defined MSYSDIR (
    echo MSYSDIR is not defined.
    exit /b 1
)

set PATH=%PERLDIR%\bin;%MSYSDIR%\usr\bin;%PATH%
set PERL=%PERLDIR%\bin\perl.exe

SET QT_VERSION=5.13
SET QT_RELEASE=2

SET QT_FULL_VER=%QT_VERSION%.%QT_RELEASE%
SET QT_SOURCE_ARCHIVE=qt-everywhere-src-%QT_FULL_VER%.zip
SET "DL_URL=https://download.qt.io/official_releases/qt/%QT_VERSION%/%QT_FULL_VER%/single/%QT_SOURCE_ARCHIVE%"

SET SRC_DIR=%BASEDIR%qt-%QT_VERSION%

SET OPENSSL=openssl-1.0.2r

SET OPENSSL_URL="https://www.openssl.org/source/%OPENSSL%.tar.gz"

SET PATH=%BASEDIR%\wintools;%NASMDIR%;%PATH%

if not exist "%OPENSSL%.tar.gz" wget.exe -c "%OPENSSL_URL%" 
7za.exe x %OPENSSL%.tar.gz -y
if not exist "%OPENSSL%" 7za.exe x %OPENSSL%.tar -y

cd %OPENSSL%

rm -f NUL

cd %BASEDIR%



rem 64 Bit

SET INST_ARCH=x86_64-msvc

call %SDKDIR%\setvcvars.bat 2019 x64

if %errorlevel% neq 0 exit /b %errorlevel%



rem - static - 

cd %OPENSSL%

call %PERL% Configure VC-WIN64A --prefix=%BASEDIR%openssl-%INST_ARCH%

if %errorlevel% neq 0 exit /b %errorlevel%

call ms\do_win64a

if %errorlevel% neq 0 exit /b %errorlevel%

call nmake -f ms\nt.mak

if %errorlevel% neq 0 exit /b %errorlevel%

call nmake -f ms\nt.mak install

if %errorlevel% neq 0 exit /b %errorlevel%

call nmake -f ms\ntdll.mak

if %errorlevel% neq 0 exit /b %errorlevel%

call nmake -f ms\ntdll.mak install

if %errorlevel% neq 0 exit /b %errorlevel%



cd %BASEDIR%



if not exist "%QT_SOURCE_ARCHIVE%" wget.exe -c "%DL_URL%"



if exist %SRC_DIR% (

    echo Removing previous build dir %SRC_DIR% ...

    del /f /s /q %SRC_DIR% > nul

    rmdir /s /q %SRC_DIR%

)



7za.exe x %QT_SOURCE_ARCHIVE% -y

rename qt-everywhere-src-%QT_FULL_VER% qt-%QT_VERSION%



SET PREFIX=%BASEDIR%qt-%QT_VERSION%-%INST_ARCH%\

cd %SRC_DIR%

del config.cache

call .\configure -prefix %PREFIX% -mp -static -shared -platform win32-msvc -release -nomake examples -nomake tests -skip qtdoc -skip qtgamepad -skip qtwebengine -ssl -openssl -I%BASEDIR%openssl-%INST_ARCH%\include -L%BASEDIR%openssl-%INST_ARCH%\lib -opensource -qt-zlib -qt-libjpeg -qt-libpng -qt-pcre -qt-freetype -opengl desktop -confirm-license

if %errorlevel% neq 0 exit /b %errorlevel%

call nmake

if %errorlevel% neq 0 exit /b %errorlevel%

call nmake install

if %errorlevel% neq 0 exit /b %errorlevel%



cd %PREFIX%

%BASEDIR%wintools\7za.exe a -tzip %BASEDIR%\qt-%QT_FULL_VER%-%INST_ARCH%.zip .\*

cd %BASEDIR%



rm -Rf %OPENSSL%

rm -Rf qt-%QT_VERSION%