From 997488bb3ee2a36234cecf6797fde1d5ce716aad Mon Sep 17 00:00:00 2001 From: kleuter Date: Thu, 19 Oct 2017 21:50:14 +0200 Subject: [PATCH] compile_win.pl script. Finally --- 5.6.2/cleanup.bat | 4 --- 5.6.2/compile_mac.sh | 8 ++--- 5.6.2/compile_win.pl | 77 +++++++++++++++++++++++++++++++++++++++++++ 5.6.2/compile_win.txt | 38 --------------------- 5.6.2/qt5vars.cmd | 3 -- 5.6.2/qt5vars_x64.cmd | 3 -- 6 files changed, 81 insertions(+), 52 deletions(-) delete mode 100644 5.6.2/cleanup.bat create mode 100644 5.6.2/compile_win.pl delete mode 100644 5.6.2/compile_win.txt delete mode 100644 5.6.2/qt5vars.cmd delete mode 100644 5.6.2/qt5vars_x64.cmd diff --git a/5.6.2/cleanup.bat b/5.6.2/cleanup.bat deleted file mode 100644 index 9fc167d..0000000 --- a/5.6.2/cleanup.bat +++ /dev/null @@ -1,4 +0,0 @@ -del *.obj /s /f -del *.ilk /s /f -del *.pch /s /f -del Makefile* /s /f \ No newline at end of file diff --git a/5.6.2/compile_mac.sh b/5.6.2/compile_mac.sh index 1b68688..d5de7ab 100644 --- a/5.6.2/compile_mac.sh +++ b/5.6.2/compile_mac.sh @@ -6,11 +6,11 @@ cd qtbase if [[ $1 == openssl ]]; then - # download openssl - curl -O https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz - tar -xvzf openssl-1.0.2l.tar.gz + # download openssl + curl -O https://www.openssl.org/source/old/1.0.2/openssl-1.0.2l.tar.gz + tar -xvzf openssl-1.0.2l.tar.gz - # compile openssl + # compile openssl cd openssl-1.0.2l ./Configure darwin64-x86_64-cc --prefix=$PWD/dist make diff --git a/5.6.2/compile_win.pl b/5.6.2/compile_win.pl new file mode 100644 index 0000000..a6a8bb1 --- /dev/null +++ b/5.6.2/compile_win.pl @@ -0,0 +1,77 @@ +use strict; + +my $arch = $ARGV[0]; +my $openssl_v_major = "1.0.2"; # The 1.0.2 series is Long Term Support (LTS) release, supported until 31st December 2019 +my $openssl_v_minor = "l"; +my $openssl_version = "$openssl_v_major$openssl_v_minor"; +my $openssl_dir = "openssl-$openssl_version"; +my $openssl_download = "https://www.openssl.org/source/old/$openssl_v_major/openssl-$openssl_version.tar.gz"; +my $openssl_arch = $arch eq "amd64" ? "WIN64A" : "WIN32"; +my $openssl_do_ms = $arch eq "amd64" ? "do_win64a" : "do_ms"; + +die "Please specify architecture (x86 or amd64)" if ($arch ne "x86" && $arch ne "amd64"); + +# will create a batch file + +my $batfile = 'compile_win.bat'; + +open BAT, '>', $batfile; + +printLineToBat ("CALL \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat\" $arch"); +printLineToBat ("cd qtbase"); +printLineToBat ("wget $openssl_download"); +printLineToBat ("tar -xvzf openssl-$openssl_version.tar.gz"); +printLineToBat ("rm openssl-$openssl_version.tar.gz"); +printLineToBat ("cd $openssl_dir"); +# build debug +printLineToBat ("perl Configure no-asm no-shared --prefix=%cd%\\Debug --openssldir=%cd%\\Debug debug-VC-$openssl_arch"); +printLineToBat ("call ms\\$openssl_do_ms"); +printLineToBat ("nmake -f ms\\nt.mak"); +printLineToBat ("nmake -f ms\\nt.mak install"); +printLineToBat ("xcopy tmp32.dbg\\lib.pdb Debug\\lib\\"); # Telegram does it. +printLineToBat ("nmake -f ms\\nt.mak clean"); +# now release +printLineToBat ("perl Configure no-asm no-shared --prefix=%cd%\\Release --openssldir=%cd%\\Release VC-$openssl_arch"); +printLineToBat ("call ms\\$openssl_do_ms"); +printLineToBat ("nmake -f ms\\nt.mak"); +printLineToBat ("nmake -f ms\\nt.mak install"); +printLineToBat ("xcopy tmp32\\lib.pdb Release\\lib\\"); # Telegram does it. +printLineToBat ("nmake -f ms\\nt.mak clean"); +# go back to qtbase +printLineToBat ("cd .."); +printLineToBat ("SET _ROOT=%cd%"); +printLineToBat ("SET PATH=%_ROOT%\\qtbase\\bin;%_ROOT%\\gnuwin32\\bin;%PATH%"); # http://doc.qt.io/qt-5/windows-building.html +printLineToBat ("configure -opensource -confirm-license -opengl desktop -mp -nomake tests -nomake examples -target xp -I \"%cd%\\$openssl_dir\\Release\\include\" -openssl-linked OPENSSL_LIBS_DEBUG=\"%cd%\\$openssl_dir\\Debug\\lib\\ssleay32.lib %cd%\\$openssl_dir\\Debug\\lib\\libeay32.lib\" OPENSSL_LIBS_RELEASE=\"%cd%\\$openssl_dir\\Release\\lib\\ssleay32.lib %cd%\\$openssl_dir\\Release\\lib\\libeay32.lib\""); +printLineToBat ("nmake"); +printLineToBat ("cd ..\\qttools"); +printLineToBat ("qmake"); +printLineToBat ("nmake"); +printLineToBat ("cd ..\\qtwinextras"); +printLineToBat ("qmake"); +printLineToBat ("nmake"); +printLineToBat ("cd ..\\qtbase"); +printLineToBat ("nmake docs"); +printLineToBat ("cd .."); # go up to qt dir +# openssl clean up +printLineToBat ("cd qtbase"); +printLineToBat ("cd $openssl_dir"); +printLineToBat ("del /s /f /q out32"); +printLineToBat ("del /s /f /q out32.dbg"); +printLineToBat ("cd .."); +printLineToBat ("cd .."); +# the rest +printLineToBat ("del *.obj /s /f"); +printLineToBat ("del *.ilk /s /f"); +printLineToBat ("del *.pch /s /f"); +printLineToBat ("del Makefile* /s /f"); + +close BAT; + +system ($batfile); +#system ("del $batfile"); +system ("pause"); + +sub printLineToBat +{ + print BAT "$_[0]\n"; +} \ No newline at end of file diff --git a/5.6.2/compile_win.txt b/5.6.2/compile_win.txt deleted file mode 100644 index 35f6023..0000000 --- a/5.6.2/compile_win.txt +++ /dev/null @@ -1,38 +0,0 @@ -x86: - -1. Запускаем qt5vars.cmd -2. cd qtbase - configure -opensource -opengl desktop -mp -nomake tests -nomake examples -target xp -I "%cd%\openssl" -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\openssl\debug\ssleay32.lib %cd%\openssl\debug\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\openssl\release\ssleay32.lib %cd%\openssl\release\libeay32.lib" - nmake - -3. cd ..\qttools - qmake - nmake - -XXX. cd ..\qtwinextras - qmake - nmake - -4. cd ..\qtbase - nmake docs - cd ..\qttools - nmake docs - -5. cd .. - cleanup.bat - -x64: - -1. Запускаем qt5vars_x64.cmd -2. cd qtbase - configure -opensource -opengl desktop -mp -nomake tests -nomake examples -target xp -I "%cd%\openssl_x64" -openssl-linked OPENSSL_LIBS_DEBUG="%cd%\openssl_x64\debug\ssleay32.lib %cd%\openssl_x64\debug\libeay32.lib" OPENSSL_LIBS_RELEASE="%cd%\openssl_x64\release\ssleay32.lib %cd%\openssl_x64\release\libeay32.lib" - nmake - -3. cd ..\qttools - qmake - nmake - -4. cd .. - cleanup.bat - - diff --git a/5.6.2/qt5vars.cmd b/5.6.2/qt5vars.cmd deleted file mode 100644 index d4b17fc..0000000 --- a/5.6.2/qt5vars.cmd +++ /dev/null @@ -1,3 +0,0 @@ -%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86 -set PATH=c:\qt\qtbase\bin;c:\qt\gnuwin32\bin;%PATH% -set QMAKESPEC=win32-msvc2013 \ No newline at end of file diff --git a/5.6.2/qt5vars_x64.cmd b/5.6.2/qt5vars_x64.cmd deleted file mode 100644 index 5748f83..0000000 --- a/5.6.2/qt5vars_x64.cmd +++ /dev/null @@ -1,3 +0,0 @@ -%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" amd64 -set PATH=c:\qt_x64\qtbase\bin;c:\qt_x64\gnuwin32\bin;%PATH% -set QMAKESPEC=win32-msvc2013 \ No newline at end of file