From c6b16b7e4d20734f2ac2fa465badd1121b6a6738 Mon Sep 17 00:00:00 2001 From: "Koenig, Joerg" Date: Sun, 26 Apr 2020 15:26:05 +0200 Subject: Last stand from QT_5_14 Change-Id: If8cf86e542691fed458098021c042193c4679d14 --- Jenkinsfile | 137 ++++++++++++--------- Makefile | 9 +- Makefile.mingw64 | 18 ++- Makefile.qtcreator | 107 ++++++++++++++++ Makefile.qtwintools | 56 +++++++++ Makefile.x86-linux | 6 +- Makefile.xmingw64 | 174 +++++++++++++++++++++++++++ SOURCE/Makefile | 16 ++- SOURCE/mkspecs-static-runtimes.patch | 35 ++++++ SOURCE/mkspecs-static-runtimes2.patch | 35 ++++++ SOURCE/qt-5.12.3-cross-static-gcc-libs.patch | 2 +- SOURCE/qt-creator-dllexport.patch | 36 ++++++ buildqt32.bat | 2 +- buildqt64.bat | 2 +- 14 files changed, 567 insertions(+), 68 deletions(-) create mode 100644 Makefile.qtcreator create mode 100644 Makefile.qtwintools create mode 100644 Makefile.xmingw64 create mode 100644 SOURCE/mkspecs-static-runtimes.patch create mode 100644 SOURCE/mkspecs-static-runtimes2.patch create mode 100644 SOURCE/qt-creator-dllexport.patch diff --git a/Jenkinsfile b/Jenkinsfile index 4954825..60dbabf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,24 +21,31 @@ properties([ stage('Build') { parallel linux: { node('bslp02-centos6-64') { - deleteDir() - checkout([$class: 'GitSCM', - branches: [[name: BRANCH]], - doGenerateSubmoduleConfigurations: false, - extensions: [], - submoduleCfg: [], - userRemoteConfigs: [[url: REPO]]]) + deleteDir() + checkout([$class: 'GitSCM', + branches: [[name: BRANCH]], + doGenerateSubmoduleConfigurations: false, + extensions: [], + submoduleCfg: [], + userRemoteConfigs: [[url: REPO]]]) - stage("Linux 64 Bit Build") { - sh '''#!/bin/bash - GCC_PATH=/master/DEV-Tools/gcc-suite/1.5.0/x86-linux64/gcc make - ''' - } + stage("Qt Build") { + sh '''#!/bin/bash + export PATH=$GCC_PATH/bin:$PATH + make GCC_PATH=/master/DEV-Tools/gcc-suite/1.6.0/x86-linux64/gcc -f Makefile all + ''' + } + stage("Qt-Creator Build") { + sh '''#!/bin/bash + export PATH=/master/DEV-Tools/gcc-suite/1.6.0/x86-linux64/gcc/bin:$PATH + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WORKSPACE/install.x86-linux64/qt-5.14.2-shared/lib + make ARCH=x86-linux64 GCC_PATH=/master/DEV-Tools/gcc-suite/1.6.0/x86-linux64/gcc/bin QTDIR=$WORKSPACE/install.x86-linux64/qt-5.14.2-shared -f Makefile.qtcreator all + ''' + } } }, windows: { node('bslp05-win10-64') { - try { deleteDir() checkout([$class: 'GitSCM', branches: [[name: BRANCH]], @@ -47,26 +54,44 @@ stage('Build') { submoduleCfg: [], userRemoteConfigs: [[url: REPO]]]) - stage ("Windows 64 Bit MinGW Build") { - sh '''#!/bin/bash - set -x - echo "Cleanup prev. builds ..." - WS=$(cygpath $WORKSPACE) - rm -f openssl-1.0.2r/NUL - rm -Rf openssl-1.0.2r - echo "Done." - cp -Rvf /c/dev-tools/gcc-suite/1.5.0/x86-mingw64/gcc $WS/ - cp $WS/gcc/bin/make.exe $WS/gcc/bin/mingw32-make.exe - export PATH=$WS/gcc/bin:/c/dev-tools/msys/x86/usr/bin:$PATH - export PATH=/c/dev-tools/Python/2.7/x86-windows:$PATH - export CC=$WS/gcc/bin/gcc - export CXX=$WS/gcc/bin/g++ - gcc -v - make -f Makefile.mingw64 all - rm -Rf build.$(ARCH) - rm -Rf install.$(ARCH) - ''' - } + stage ("MinGW Qt Build") { + sh '''#!/bin/bash + set -x + echo "Cleanup prev. builds ..." + WS=$(cygpath $WORKSPACE) + cp -Rvf /c/dev-tools/gcc-suite/1.6.0/x86-mingw64/gcc $WS/ + cp $WS/gcc/bin/make.exe $WS/gcc/bin/mingw32-make.exe + export PATH=$WS/gcc/bin:/c/dev-tools/msys/x86/usr/bin:$PATH + export PATH=/c/dev-tools/Python/2.7/x86-windows:$PATH + export CC=$WS/gcc/bin/gcc + export CXX=$WS/gcc/bin/g++ + gcc -v + mkdir -p /c/tmp + make -f Makefile.mingw64 RESERVE_INSTDIR=1 all + ''' + } + stage ("MinGW Qt-Creator Build") { + sh '''#!/bin/bash + set -x + echo "Cleanup prev. builds ..." + WS=$(cygpath $WORKSPACE) + cp -Rvf /c/dev-tools/gcc-suite/1.6.0/x86-mingw64/gcc $WS/ + cp $WS/gcc/bin/make.exe $WS/gcc/bin/mingw32-make.exe + export PATH=$WS/gcc/bin:/c/dev-tools/msys/x86/usr/bin:$PATH + export PATH=/c/dev-tools/Python/2.7/x86-windows:$PATH + export CC=$WS/gcc/bin/gcc + export CXX=$WS/gcc/bin/g++ + gcc -v + make -f Makefile.qtcreator ARCH=x86-mingw64 GCC_PATH=$WS/gcc QTDIR=/c/tmp/qt clean all + ''' + } + stage ("Cleanup") { + sh '''#!/bin/bash + set -x + rm -Rf /c/tmp/qt + ''' + } + stage ("Windows 64 Bit MSVC Build") { sh '''#!/bin/bash set -x @@ -82,15 +107,14 @@ stage('Build') { buildqt64.bat ''' } - stash name: "qtwin", includes: "*-msvc.zip, *-x86-mingw64.tgz" - } catch (e) { - echo 'Windows build failed' - } finally { - sh ''' - export PATH=/c/msys/x86/usr/bin - rm -Rf $(cygpath $WORKSPACE)/openssl-1.0.2r - ''' - } + stage ("Cleanup") { + sh '''#!/bin/bash + set -x + #rm -Rf /c/tmp/qt + #rm -Rf $(cygpath $WORKSPACE)/openssl-1.0.2r + ''' + } + stash name: "qtwin", includes: "qt-*-msvc.zip,*qt-*-x86-mingw64.tgz,qtcreator-*-x86-mingw64.zip" } } } @@ -98,37 +122,40 @@ stage ("Post processing") { node('bslp02-centos6-64') { unstash name: 'qtwin' sh ''' - QT_VER=5.14.0 + QT_VER=5.14.2 # # cleanup temporary destination folder for final distribution ... # unpack Linux archives ... + mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64-shared tar -xzf $WORKSPACE/qt-$QT_VER-shared-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64-shared mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64-static tar -xzf $WORKSPACE/qt-$QT_VER-static-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64-static - mkdir -p $WORKSPACE/INST/$QT_VER/x86_64-msvc - unzip -o $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip -d $WORKSPACE/INST/$QT_VER/x86_64-msvc - mkdir -p $WORKSPACE/INST/$QT_VER/x86-mingw64 tar -xzf $WORKSPACE/qt-$QT_VER-x86-mingw64.tgz -C $WORKSPACE/INST/$QT_VER/x86-mingw64 - mkdir -p $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64 cp -f $WORKSPACE/INST/$QT_VER/x86-linux64-shared/bin/* $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64 + mkdir -p $WORKSPACE/INST/$QT_VER/x86_64-msvc + unzip -o $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip -d $WORKSPACE/INST/$QT_VER/x86_64-msvc + # generate qt.conf for linux to windows cross builds ... - rm -f $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf - echo "[Paths]" > $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf - echo "Prefix=.." >> $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf - echo "Libraries = lib" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf - echo "Plugins = plugins" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf - echo "HostBinaries=xbin" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf - echo "TargetSpec=x-win32-g++" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/qt.conf + rm -f $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + echo "[Paths]" > $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + echo "Prefix=.." >> $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + echo "Libraries = lib" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + echo "Plugins = plugins" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + echo "HostBinaries=xbin" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + echo "TargetSpec=win32-g++" >> $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf + cp -f $WORKSPACE/INST/$QT_VER/x86-mingw64/bin/qt.conf \ + $WORKSPACE/INST/$QT_VER/x86-mingw64/xbin-x86-linux64/ # - # finally recreate the whole mingw64 archive ... + # finally recreate the whole mingw64-shared archive ... rm -f $WORKSPACE/qt-$QT_VER-x86-mingw64.tgz cd $WORKSPACE/INST/$QT_VER/x86-mingw64 tar -zcf $WORKSPACE/qt-$QT_VER-x86-mingw64.tgz . + cd $WORKSPACE/ rm -Rf $WORKSPACE/INST ''' diff --git a/Makefile b/Makefile index ce9f605..3286075 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH) LOCAL_INST_PATH = $(TOP)/install.$(ARCH) VERSION_SHORT=5.14 -VERSION_RELEASE=0 +VERSION_RELEASE=2 VERSION=$(VERSION_SHORT).$(VERSION_RELEASE) SSL_VERSION=1.0.2r @@ -16,7 +16,7 @@ SSL_ARCHIVE=openssl-$(SSL_VERSION).tar.gz PACKAGE_NAME = qt-$(VERSION) -GCC_PATH ?= /opt/dev-tools/gcc-suite/1.5.0/x86-linux64/gcc +GCC_PATH ?= /opt/dev-tools/gcc-suite/1.6.0/x86-linux64/gcc CC ?= $(GCC_PATH)/bin/gcc CXX ?= $(GCC_PATH)/bin/g++ @@ -86,6 +86,9 @@ qt.x86-linux64.shared: -prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-shared \ -release \ -opensource \ + -no-rpath \ + -silent \ + -no-rpath \ -strip \ -ssl \ -openssl \ @@ -130,6 +133,8 @@ qt.x86-linux64.static: -strip \ -ssl \ -openssl \ + -silent \ + -no-rpath \ -I$(LOCAL_INST_PATH)/openssl/include \ -L$(LOCAL_INST_PATH)/opensll/lib \ -L$(GCC_PATH)/lib64 \ diff --git a/Makefile.mingw64 b/Makefile.mingw64 index 521de95..fed71f4 100644 --- a/Makefile.mingw64 +++ b/Makefile.mingw64 @@ -6,7 +6,7 @@ LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH) LOCAL_INST_PATH = $(TOP)/install.$(ARCH) VERSION_SHORT = 5.14 -VERSION_RELEASE = 0 +VERSION_RELEASE = 2 VERSION = $(VERSION_SHORT).$(VERSION_RELEASE) SSL_VERSION = 1.0.2r @@ -21,6 +21,8 @@ GCC = $(shell which g++) GCC_PATH = $(shell dirname $(GCC)) 7ZIP = $(TOP)/wintools/7za.exe +RESERVE_INSTDIR = 0 + PACKAGE_NAME = qt-$(VERSION)-$(ARCH) test: @@ -33,7 +35,8 @@ ssl: ssl.$(ARCH) qt: qt.$(ARCH) download: - $(MAKE) -C ./SOURCE + $(MAKE) -C ./SOURCE qtzip + $(MAKE) -C ./SOURCE ssltgz ssl.$(ARCH): rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) @@ -42,7 +45,7 @@ ssl.$(ARCH): tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE) cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \ export CFLAGS="-m64 -fpic" && \ - ./Configure --prefix=$(QT_INST_PATH) shared mingw64 && \ + ./Configure --prefix=$(QT_INST_PATH) -m64 -static-libgcc -static-libstdc++ shared mingw64 && \ make clean && \ make && \ make install @@ -53,7 +56,7 @@ qt.$(ARCH): rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) ; \ fi cd $(LOCAL_BUILD_PATH); \ - $(7ZIP) x $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz -so | $(7ZIP) x -aoa -si -ttar -o"." + $(7ZIP) x $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).zip cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) ;\ patch -p1 < $(TOP)/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch rm -Rf $(QT_SRC_PATH) @@ -68,9 +71,13 @@ qt.$(ARCH): -shared \ -release \ -strip \ + -silent \ + -no-rpath \ + -no-pch \ -ssl \ -nomake examples \ -nomake tests \ + -skip activeqt \ -skip qtwebengine \ -skip qtwebglplugin \ -skip qtwebchannel \ @@ -85,6 +92,7 @@ qt.$(ARCH): -qt-libpng \ -qt-pcre \ -qt-freetype \ + -qt-doubleconversion \ -opengl desktop \ -openssl \ -I$(QT_INST_PATH)/include \ @@ -98,7 +106,9 @@ qt.$(ARCH): cp -f $(GCC_PATH)/../x86_64-w64-mingw32/bin/libwinpthread-1.dll $(QT_INST_PATH)/bin/ cd $(QT_INST_PATH)/ && \ tar -czf $(TOP)/$(PACKAGE_NAME).tgz . +ifeq ($(RESERVE_INSTDIR),0) rm -Rf $(QT_INST_PATH) +endif rm -Rf $(QT_SRC_PATH) clean: diff --git a/Makefile.qtcreator b/Makefile.qtcreator new file mode 100644 index 0000000..9d5229b --- /dev/null +++ b/Makefile.qtcreator @@ -0,0 +1,107 @@ +# +# Makefile to compile QT-Creator +# +TOP = $(shell readlink -f .) + +VERSION = 4.11 +RELEASE = 2 +QT_VERSION = 5.14 +QT_RELEASE = 2 +TARURL = https://download.qt.io/official_releases/qtcreator/$(VERSION)/$(VERSION).$(RELEASE)/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz +ZIPURL = https://download.qt.io/official_releases/qtcreator/$(VERSION)/$(VERSION).$(RELEASE)/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip +7ZIP = $(TOP)/wintools/7za.exe + +ifeq ($(ARCH),) + $(error ARCH is not set) +endif + +ifeq ($(GCC_PATH),) + $(error GCC_PATH is not set) +endif + +ifeq ($(BUILD_NUMBER),) + BUILD = unsupported +else + BUILD = $(BUILD_NUMBER) +endif + +BUILD_OS = $(shell uname -s) + +QTDIR = $(PWD)/install.$(ARCH)/qt-5.14.2-shared +BUILDDIR = $(PWD)/build-qtcreator.$(ARCH) +INSTDIR = $(PWD)/inst-qtcreator.$(ARCH) +MY_PATH = $(PATH) + +ifneq ($(BUILD_OS),Linux) + MY_PATH = $(shell cygpath -p -C ANSI "$(PATH)") +endif + +ifeq ($(ARCH),x86-linux64) + MKSPEC = linux-g++-64 + CROSS_COMPILE = +else + MKSPEC = win32-g++ +ifeq ($(BUILD_OS),Linux) + CROSS_COMPILE = x86_64-w64-mingw32- +endif +endif + + + +PKGNAME = qtcreator-$(VERSION)-$(RELEASE)-$(BUILD)-$(ARCH) + +# --------------------------------------------------------------------------- +# +all: download unpack patchit build install pack.$(ARCH) + +ifeq ($(BUILD_OS),Linux) +download: $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz +else +download: $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip +endif + +unpack: + mkdir -p $(BUILDDIR) +ifeq ($(BUILD_OS),Linux) + tar -zxf $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz \ + -C $(BUILDDIR) +else + cd $(BUILDDIR) && \ + $(7ZIP) x $(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip +endif + +patchit: + cd $(BUILDDIR)/qt-creator-opensource-src-$(VERSION).$(RELEASE) && \ + patch -p1 < $(PWD)/SOURCE/qt-creator-dllexport.patch + +$(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).tar.gz: + cd $(PWD)/SOURCE && \ + wget -c "$(TARURL)" + +$(PWD)/SOURCE/qt-creator-opensource-src-$(VERSION).$(RELEASE).zip: + cd $(PWD)/SOURCE && \ + wget -c "$(ZIPURL)" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# +build: + cd $(BUILDDIR)/qt-creator-opensource-src-$(VERSION).$(RELEASE) && \ + export PATH="$(GCC_PATH):$(QTDIR)/bin:$(MY_PATH)" && \ + CROSS_COMPILE=$(CROSS_COMPILE) \ + $(QTDIR)/bin/qmake -o Makefile -spec $(MKSPEC) && \ + make + +install: + cd $(BUILDDIR)/qt-creator-opensource-src-$(VERSION).$(RELEASE) && \ + make INSTALL_ROOT=$(INSTDIR) install + +pack.x86-linux64: + cd $(INSTDIR) && \ + tar -zcf $(PWD)/$(PKGNAME).tgz . + +pack.x86-mingw64: + cd $(INSTDIR) && \ + $(7ZIP) a -r $(PWD)/$(PKGNAME).zip . + +clean: + rm -Rf $(BUILDDIR) diff --git a/Makefile.qtwintools b/Makefile.qtwintools new file mode 100644 index 0000000..405b1a4 --- /dev/null +++ b/Makefile.qtwintools @@ -0,0 +1,56 @@ +TOP = $(shell readlink -f .) + +VERSION_SHORT = 5.14 +VERSION_RELEASE = 2 +VERSION = $(VERSION_SHORT).$(VERSION_RELEASE) + +7ZIP = $(TOP)/wintools/7za.exe +LOCAL_BUILD_PATH = c:/tmp/qtbuild +SRCDIR = $(LOCAL_BUILD_PATH)/qt-everywhere-src-5.14.2 + +TOOLS = moc rcc uic qlalr qvkgen tracegen + +all: download unpack configure tools pack clean + +download: + $(MAKE) -C ./SOURCE zip + +unpack: + mkdir -p $(LOCAL_BUILD_PATH) + cd $(LOCAL_BUILD_PATH); \ + rm -Rf qt-everywhere-src-$(VERSION) ; \ + $(7ZIP) x $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).zip + +configure: + cd $(SRCDIR) && \ + ./configure.bat -opensource -confirm-license + +tools: + cd $(SRCDIR)/qtbase/src/tools/bootstrap && \ + $(SRCDIR)/qtbase/bin/qmake -o Makefile && \ + make -f Makefile + cd $(SRCDIR)/qtbase/src/tools/moc && \ + $(SRCDIR)/qtbase/bin/qmake -o Makefile && \ + make -f Makefile + cd $(SRCDIR)/qtbase/src/tools/rcc && \ + $(SRCDIR)/qtbase/bin/qmake -o Makefile && \ + make -f Makefile + cd $(SRCDIR)/qtbase/src/3rdparty/pcre2 && \ + $(SRCDIR)/qtbase/bin/qmake -o Makefile && \ + make -f Makefile + cd $(SRCDIR)/qtbase/src/corelib && \ + $(SRCDIR)/qtbase/bin/qmake -o Makefile && \ + make -f Makefile + for t in $(TOOLS) ; do \ + cd $(SRCDIR)/qtbase/src/tools/$$t ;\ + $(SRCDIR)/qtbase/bin/qmake -o Makefile ;\ + make -f Makefile ;\ + done + +pack: + cd $(SRCDIR)/qtbase/bin && \ + tar -zcf $(TOP)/qtwintools.tgz ./*.exe + +clean: + rm -Rf $(LOCAL_BUILD_PATH) + diff --git a/Makefile.x86-linux b/Makefile.x86-linux index 3809eec..0bc6b0d 100644 --- a/Makefile.x86-linux +++ b/Makefile.x86-linux @@ -8,7 +8,7 @@ LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH) LOCAL_INST_PATH = $(TOP)/install.$(ARCH) VERSION_SHORT=5.14 -VERSION_RELEASE=0 +VERSION_RELEASE=2 VERSION=$(VERSION_SHORT).$(VERSION_RELEASE) SSL_VERSION=1.0.2r @@ -86,6 +86,8 @@ qt.x86-linux.shared: -release \ -opensource \ -strip \ + -silent \ + -no-rpath \ -ssl \ -openssl \ -I$(LOCAL_INST_PATH)/openssl/include \ @@ -127,6 +129,8 @@ qt.x86-linux.static: -strip \ -ssl \ -openssl \ + -silent \ + -no-rpath \ -I$(LOCAL_INST_PATH)/openssl/include \ -L$(LOCAL_INST_PATH)/opensll/lib \ -L$(GCC_PATH)/lib \ diff --git a/Makefile.xmingw64 b/Makefile.xmingw64 new file mode 100644 index 0000000..68c1416 --- /dev/null +++ b/Makefile.xmingw64 @@ -0,0 +1,174 @@ + +TOP = $(shell readlink -f .) +ARCH = x86-mingw64 + +JOBS = 1 + +LOCAL_BUILD_PATH = $(TOP)/build.$(ARCH) +LOCAL_INST_PATH = $(TOP)/install.$(ARCH) + +VERSION_SHORT=5.14 +VERSION_RELEASE=2 +VERSION=$(VERSION_SHORT).$(VERSION_RELEASE) + +SSL_VERSION=1.0.2r +SSL_ARCHIVE=openssl-$(SSL_VERSION).tar.gz + +PACKAGE_NAME = qt-$(VERSION) + +GCC_PATH ?= /opt/dev-tools/gcc-suite/1.6.0/x86-linux64/gcc +CROSS_COMPILE ?= /opt/dev-tools/gcc-suite/1.6.0/x86-linux64/mingw64/bin/x86_64-w64-mingw32- + +CC ?= $(GCC_PATH)/bin/gcc +CXX ?= $(GCC_PATH)/bin/g++ + +#CC_LDFLAGS = "-m64 -shared -fpic -static-libgcc" +#CXX_LDFLAGS = "-m64 -shared -fpic -static-libgcc -static-libstdc++" + +QT_STATIC_FLAGS = -static -static-runtime -no-shared + +all: download qt + +qt: ssl.$(ARCH) qt.$(ARCH) + +download: + $(MAKE) -C $(TOP)/SOURCE + +ssl.$(ARCH): + # static + rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) + mkdir -p $(LOCAL_BUILD_PATH)/ + cd $(LOCAL_BUILD_PATH) && \ + tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE) + cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \ + export CFLAGS= && \ + export LDFLAGS="-static-libgcc -static-libstdc++" && \ + export PATH=$(GCC_PATH)/bin:$(PATH) && \ + export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \ + ./Configure -static-libgcc -static-libstdc++ \ + --cross-compile-prefix=$(CROSS_COMPILE) \ + --prefix=$(LOCAL_INST_PATH)/openssl mingw64 && \ + pwd && \ + make clean && \ + make -j$(JOBS) && \ + make install + # shared + rm -Rf $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) + mkdir -p $(LOCAL_BUILD_PATH)/ + cd $(LOCAL_BUILD_PATH) && \ + tar -xzf $(TOP)/SOURCE/$(SSL_ARCHIVE) + cd $(LOCAL_BUILD_PATH)/openssl-$(SSL_VERSION) && \ + export CFLAGS=-fpic && \ + export LDFLAGS="-static-libgcc -static-libstdc++" && \ + export PATH=$(GCC_PATH)/bin:$(PATH) && \ + export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \ + ./Configure -static-libgcc -static-libstdc++ shared \ + --cross-compile-prefix=$(CROSS_COMPILE) \ + --prefix=$(LOCAL_INST_PATH)/openssl mingw64 && \ + pwd && \ + make clean && \ + make -j$(JOBS) && \ + make install + +qt.x86-mingw64: qt.x86-mingw64.unpack qt.x86-mingw64.shared qt.x86-mingw64.static + +qt.x86-mingw64.unpack: + # shared + mkdir -p $(LOCAL_BUILD_PATH) + rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) + cd $(LOCAL_BUILD_PATH) && \ + tar -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz + cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \ + patch -p1 < $(TOP)/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch + +qt.x86-mingw64.shared: + # shared + cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \ + rm -f config.cache && \ + export PATH=$(GCC_PATH)/bin:$(PATH) && \ + export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \ + gcc --version && \ + bash ./configure \ + -platform linux-g++-64 \ + -xplatform win32-g++ \ + -device-option CROSS_COMPILE=$(CROSS_COMPILE) \ + -opengl desktop \ + -recheck-all \ + -shared \ + -prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-shared \ + -release \ + -opensource \ + -no-rpath \ + -strip \ + -ssl \ + -openssl \ + -I$(LOCAL_INST_PATH)/openssl/include \ + -I/opt/dev-tools/gcc-suite/1.6.0/x86-linux64/mingw64/x86_64-w64-mingw32/include \ + -L$(LOCAL_INST_PATH)/openssl/lib \ + -nomake examples \ + -nomake tests \ + -skip qtwebengine \ + -skip activeqt \ + -qt-zlib \ + -qt-libjpeg \ + -qt-libpng \ + -qt-pcre \ + -confirm-license && \ + make QMAKE_LFLAGS="-m64 -static-libgcc -static-libstdc++" -j$(JOBS) && \ + make -j$(JOBS) install + cp -f $(TOP)/qt.conf $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/bin/ + cd $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/bin && chmod -f a+x *.exe + cd $(LOCAL_INST_PATH)/qt-$(VERSION)-shared && \ + tar -zcf $(TOP)/qt-$(VERSION)-shared-$(ARCH).tgz ./ + +qt.x86-mingw64.static: + # static + mkdir -p $(LOCAL_BUILD_PATH) + rm -Rf $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) + cd $(LOCAL_BUILD_PATH) && \ + tar -xJf $(TOP)/SOURCE/qt-everywhere-src-$(VERSION).tar.xz + cd $(LOCAL_BUILD_PATH)/qt-everywhere-src-$(VERSION) && \ + patch -p1 < $(TOP)/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch && \ + rm -f config.cache && \ + export PATH=$(GCC_PATH)/bin:$(PATH) && \ + export LD_LIBRARY_PATH=$(GCC_PATH)/lib64:$(LD_LIBRARY_PATH) && \ + gcc --version && \ + ./configure \ + -xplatform win32-g++ \ + -device-option CROSS_COMPILE=$(CROSS_COMPILE) \ + -opengl desktop \ + -recheck-all \ + -prefix $(LOCAL_INST_PATH)/qt-$(VERSION)-static \ + -static \ + -release \ + -opensource \ + -strip \ + -ssl \ + -openssl \ + -no-rpath \ + -I$(LOCAL_INST_PATH)/openssl/include \ + -L$(LOCAL_INST_PATH)/opensll/lib \ + -nomake examples \ + -nomake tests \ + -skip qtwebengine \ + -skip activeqt \ + -qt-zlib \ + -qt-libjpeg \ + -qt-libpng \ + -qt-pcre \ + -confirm-license && \ + make QMAKE_LFLAGS="-m64 -static-libgcc -static-libstdc++" -j$(JOBS) && \ + make -j$(JOBS) install + cp -f $(TOP)/qt.conf $(LOCAL_INST_PATH)/qt-$(VERSION)-static/bin/ + cd $(LOCAL_INST_PATH)/qt-$(VERSION)-shared/bin && chmod -f a+x *.exe + cd $(LOCAL_INST_PATH)/qt-$(VERSION)-static && \ + tar -zcf $(TOP)/qt-$(VERSION)-static-$(ARCH).tgz ./ + +clean: + rm -Rf build.$(ARCH) + rm -Rf install.$(ARCH) + +dll2a: + for d in $(DLL_DIR)/*.dll; do \ + $(GCC_PATH)/bin/$(XPREFIX)dll2a $$d -l $(LIBDIR) ; \ + done; diff --git a/SOURCE/Makefile b/SOURCE/Makefile index e29dbf7..4c75873 100644 --- a/SOURCE/Makefile +++ b/SOURCE/Makefile @@ -1,10 +1,11 @@ CWD = $(shell readlink -f .) VERSION_SHORT = 5.14 -RELEASE = 0 +RELEASE = 2 VERSION = $(VERSION_SHORT).$(RELEASE) QT_SOURCE_ARCHIVE=qt-everywhere-src-$(VERSION).tar.xz -DL_URL="https://download.qt.io/official_releases/qt/$(VERSION_SHORT)/$(VERSION)/single/$(QT_SOURCE_ARCHIVE)" +QT_SOURCE_ARCHIVE2=qt-everywhere-src-$(VERSION).zip +DL_URL="https://download.qt.io/official_releases/qt/$(VERSION_SHORT)/$(VERSION)/single" SSL_VERSION=1.0.2r SSL_ARCHIVE=openssl-$(SSL_VERSION).tar.gz @@ -13,9 +14,18 @@ SSL_DL_URL = "https://www.openssl.org/source/$(SSL_ARCHIVE)" all: $(SSL_ARCHIVE) $(QT_SOURCE_ARCHIVE) $(QT_SOURCE_ARCHIVE): - wget -c $(DL_URL) -O $(QT_SOURCE_ARCHIVE) + wget -c $(DL_URL)/$(QT_SOURCE_ARCHIVE) -O $(QT_SOURCE_ARCHIVE) + +$(QT_SOURCE_ARCHIVE2): + wget -c $(DL_URL)/$(QT_SOURCE_ARCHIVE2) -O $(QT_SOURCE_ARCHIVE2) $(SSL_ARCHIVE): wget -c $(SSL_DL_URL) -O $(SSL_ARCHIVE) +qtzip: + $(MAKE) $(QT_SOURCE_ARCHIVE2) +qttar: + $(MAKE) $(QT_SOURCE_ARCHIVE) +ssltgz: + $(MAKE) $(SSL_ARCHIV) diff --git a/SOURCE/mkspecs-static-runtimes.patch b/SOURCE/mkspecs-static-runtimes.patch new file mode 100644 index 0000000..9f5f94b --- /dev/null +++ b/SOURCE/mkspecs-static-runtimes.patch @@ -0,0 +1,35 @@ +diff -ruNb qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-32/qmake.conf qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-32/qmake.conf +--- qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-32/qmake.conf 2020-03-27 10:49:31.000000000 +0100 ++++ qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-32/qmake.conf 2020-04-19 21:02:26.869710981 +0200 +@@ -9,7 +9,7 @@ + include(../common/linux.conf) + + QMAKE_CFLAGS = -m32 +-QMAKE_LFLAGS = -m32 ++QMAKE_LFLAGS = -m32 -static-libgcc -static-libstdc++ + + include(../common/gcc-base-unix.conf) + include(../common/g++-unix.conf) +diff -ruNb qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-64/qmake.conf qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-64/qmake.conf +--- qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-64/qmake.conf 2020-03-27 10:49:31.000000000 +0100 ++++ qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-64/qmake.conf 2020-04-19 21:02:07.453758876 +0200 +@@ -12,7 +12,7 @@ + include(../common/linux.conf) + + QMAKE_CFLAGS = -m64 +-QMAKE_LFLAGS = -m64 ++QMAKE_LFLAGS = -m64 -static-libgcc -static-libstdc++ + + include(../common/gcc-base-unix.conf) + include(../common/g++-unix.conf) +diff -ruNb qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/win32-g++/qmake.conf qt-everywhere-src-5.14.2/qtbase/mkspecs/win32-g++/qmake.conf +--- qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/win32-g++/qmake.conf 2020-03-27 10:49:31.000000000 +0100 ++++ qt-everywhere-src-5.14.2/qtbase/mkspecs/win32-g++/qmake.conf 2020-04-19 21:03:17.773585413 +0200 +@@ -15,6 +15,7 @@ + QMAKE_CC = $${CROSS_COMPILE}gcc + QMAKE_CFLAGS += -fno-keep-inline-dllexport + QMAKE_CFLAGS_WARN_ON += -Wextra ++QMAKE_LFLAGS += -static-libgcc -static-libstdc++ + + QMAKE_CXX = $${CROSS_COMPILE}g++ + QMAKE_CXXFLAGS += -fno-keep-inline-dllexport diff --git a/SOURCE/mkspecs-static-runtimes2.patch b/SOURCE/mkspecs-static-runtimes2.patch new file mode 100644 index 0000000..11b9083 --- /dev/null +++ b/SOURCE/mkspecs-static-runtimes2.patch @@ -0,0 +1,35 @@ +diff -ruNb qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-32/qmake.conf qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-32/qmake.conf +--- qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-32/qmake.conf 2020-03-27 10:49:31.000000000 +0100 ++++ qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-32/qmake.conf 2020-04-19 21:02:26.869710981 +0200 +@@ -9,7 +9,7 @@ + include(../common/linux.conf) + + QMAKE_CFLAGS = -m32 +-QMAKE_LFLAGS = -m32 ++QMAKE_LFLAGS = -m32 -static-libgcc -static-libstdc++ + + include(../common/gcc-base-unix.conf) + include(../common/g++-unix.conf) +diff -ruNb qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-64/qmake.conf qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-64/qmake.conf +--- qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/linux-g++-64/qmake.conf 2020-03-27 10:49:31.000000000 +0100 ++++ qt-everywhere-src-5.14.2/qtbase/mkspecs/linux-g++-64/qmake.conf 2020-04-19 21:02:07.453758876 +0200 +@@ -12,7 +12,7 @@ + include(../common/linux.conf) + + QMAKE_CFLAGS = -m64 +-QMAKE_LFLAGS = -m64 ++QMAKE_LFLAGS = -m64 -static-libgcc -static-libstdc++ + + include(../common/gcc-base-unix.conf) + include(../common/g++-unix.conf) +diff -ruNb qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/win32-g++/qmake.conf qt-everywhere-src-5.14.2/qtbase/mkspecs/win32-g++/qmake.conf +--- qt-everywhere-src-5.14.2.orig/qtbase/mkspecs/win32-g++/qmake.conf 2020-03-27 10:49:31.000000000 +0100 ++++ qt-everywhere-src-5.14.2/qtbase/mkspecs/win32-g++/qmake.conf 2020-04-19 21:23:18.170624479 +0200 +@@ -15,6 +15,7 @@ + QMAKE_CC = $${CROSS_COMPILE}gcc + QMAKE_CFLAGS += -fno-keep-inline-dllexport + QMAKE_CFLAGS_WARN_ON += -Wextra ++QMAKE_LFLAGS += -static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive -Wl,-Bdynamic + + QMAKE_CXX = $${CROSS_COMPILE}g++ + QMAKE_CXXFLAGS += -fno-keep-inline-dllexport diff --git a/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch b/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch index 017c5a9..912a5e1 100644 --- a/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch +++ b/SOURCE/qt-5.12.3-cross-static-gcc-libs.patch @@ -6,7 +6,7 @@ diff -ruNb qt-everywhere-src-5.12.3.orig/qtbase/mkspecs/common/g++-win32.conf qt include(angle.conf) include(windows-vulkan.conf) + -+QMAKE_LFLAGS += -static-libgcc -static-libstdc++ ++QMAKE_LFLAGS += -static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive -Wl,-Bdynamic diff -ruNb qt-everywhere-src-5.12.3.orig/qtbase/mkspecs/x-win32-g++/qmake.conf qt-everywhere-src-5.12.3/qtbase/mkspecs/x-win32-g++/qmake.conf --- qt-everywhere-src-5.12.3.orig/qtbase/mkspecs/x-win32-g++/qmake.conf 1970-01-01 01:00:00.000000000 +0100 +++ qt-everywhere-src-5.12.3/qtbase/mkspecs/x-win32-g++/qmake.conf 2019-05-31 08:59:13.555027712 +0200 diff --git a/SOURCE/qt-creator-dllexport.patch b/SOURCE/qt-creator-dllexport.patch new file mode 100644 index 0000000..04b185d --- /dev/null +++ b/SOURCE/qt-creator-dllexport.patch @@ -0,0 +1,36 @@ +diff -ruNb qt-creator-opensource-src-4.11.2.orig/src/libs/sqlite/sqlite.pro qt-creator-opensource-src-4.11.2/src/libs/sqlite/sqlite.pro +--- qt-creator-opensource-src-4.11.2.orig/src/libs/sqlite/sqlite.pro 2020-03-27 04:34:54.000000000 +0100 ++++ qt-creator-opensource-src-4.11.2/src/libs/sqlite/sqlite.pro 2020-04-20 19:03:50.059094604 +0200 +@@ -3,7 +3,7 @@ + + include(../../qtcreatorlibrary.pri) + +-win32:DEFINES += SQLITE_API=__declspec(dllexport) ++win32:DEFINES += SQLITE_API=__declspec\\(dllexport\\) + unix:DEFINES += SQLITE_API=\"__attribute__((visibility(\\\"default\\\")))\" + + include(sqlite-lib.pri) +diff -ruNb qt-creator-opensource-src-4.11.2.orig/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp qt-creator-opensource-src-4.11.2/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +--- qt-creator-opensource-src-4.11.2.orig/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp 2020-03-27 04:34:54.000000000 +0100 ++++ qt-creator-opensource-src-4.11.2/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp 2020-04-20 20:26:17.486219748 +0200 +@@ -54,7 +54,7 @@ + #include + + #ifdef Q_OS_WIN +-#include ++#include + #endif + + using namespace ProjectExplorer; +diff -ruNb qt-creator-opensource-src-4.11.2.orig/src/tools/winrtdebughelper/winrtdebughelper.cpp qt-creator-opensource-src-4.11.2/src/tools/winrtdebughelper/winrtdebughelper.cpp +--- qt-creator-opensource-src-4.11.2.orig/src/tools/winrtdebughelper/winrtdebughelper.cpp 2020-03-27 04:34:56.000000000 +0100 ++++ qt-creator-opensource-src-4.11.2/src/tools/winrtdebughelper/winrtdebughelper.cpp 2020-04-20 20:41:14.599066226 +0200 +@@ -23,7 +23,7 @@ + ** + ****************************************************************************/ + +-#include ++#include + #include + #include + diff --git a/buildqt32.bat b/buildqt32.bat index 8c0bf3c..8ab98dd 100644 --- a/buildqt32.bat +++ b/buildqt32.bat @@ -23,7 +23,7 @@ set PATH=%PERLDIR%\bin;%MSYSDIR%\usr\bin;%PATH% set PERL=%PERLDIR%\bin\perl.exe SET QT_VERSION=5.14 -SET QT_RELEASE=0 +SET QT_RELEASE=2 SET QT_FULL_VER=%QT_VERSION%.%QT_RELEASE% SET QT_SOURCE_ARCHIVE=qt-everywhere-src-%QT_FULL_VER%.zip diff --git a/buildqt64.bat b/buildqt64.bat index 0ae3392..fd6879b 100644 --- a/buildqt64.bat +++ b/buildqt64.bat @@ -23,7 +23,7 @@ set PATH=%PERLDIR%\bin;%MSYSDIR%\usr\bin;%PATH% set PERL=%PERLDIR%\bin\perl.exe SET QT_VERSION=5.14 -SET QT_RELEASE=0 +SET QT_RELEASE=2 SET QT_FULL_VER=%QT_VERSION%.%QT_RELEASE% SET QT_SOURCE_ARCHIVE=qt-everywhere-src-%QT_FULL_VER%.zip -- cgit v0.12