From d6f8172aaa686df4dde2b931790a6dab3b8199e3 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Mon, 8 Jun 2015 19:47:26 +0200 Subject: [PATCH] Adding Qt5 base Crosscompile and package Qt5 (base) and setup an environment to easily crosscompile and package other qmake based projects. Please see the comments within the Makefiles (Makefile / qmake.mk) for current limitations and known issues. Packaged from the "base" submodule herewith are: - qt5base-concurrent - qt5base-core - qt5base-gui - qt5base-network - qt5base-printSupport - qt5base-sql - qt5base-test - qt5base-widgets - qt5base-xml - qt5base-plugin-bearer-generic - qt5base-plugin-input-evdevkeyboard - qt5base-plugin-input-evdevmouse - qt5base-plugin-input-evdevtablet - qt5base-plugin-input-evdevtouch - qt5base-plugin-imageformats-gif - qt5base-plugin-imageformats-ico - qt5base-plugin-imageformats-jpeg - qt5base-plugin-platforms-linuxfb - qt5base-plugin-platforms-minimal - qt5base-plugin-platforms-offscreen - qt5base-plugin-sqldrivers-sqlite - qt5base-examples --- frameworks/qt5base/Makefile | 432 ++++++++++++++++++ .../mkspecs/linux-openwrt-g++/qmake.conf | 37 ++ .../mkspecs/linux-openwrt-g++/qplatformdefs.h | 34 ++ frameworks/qt5base/files/qmake.mk | 147 ++++++ .../qt5base/patches/002-uclibc-execinfo.patch | 11 + 5 files changed, 661 insertions(+) create mode 100644 frameworks/qt5base/Makefile create mode 100644 frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qmake.conf create mode 100644 frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qplatformdefs.h create mode 100644 frameworks/qt5base/files/qmake.mk create mode 100644 frameworks/qt5base/patches/002-uclibc-execinfo.patch diff --git a/frameworks/qt5base/Makefile b/frameworks/qt5base/Makefile new file mode 100644 index 0000000..e2e8c72 --- /dev/null +++ b/frameworks/qt5base/Makefile @@ -0,0 +1,432 @@ +# +# Copyright (C) 2015 OpenWrt.org +# Author: Mirko Vogt +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +# TODO / known bugs: +# - plugins don't work when sstrip is used for stripping +# - only framebuffer (linuxfb) support for now, XBC/DirectFB to come - thus no GL thus no qtquick2 / QML2, as it has a hard dependency on GL +# - host_build functionality seems to be broken - qmake doesn't switch to the host toolchain (linux-g++) when host_build gets invoked + +include $(TOPDIR)/rules.mk + +PKG_NAME:=qt5base +PKG_VERSION:=5.4.2 +PKG_RELEASE:=1 +PKG_MD5SUM:=67a95eec79ffc4a14f516ad6f3d24c96 + +PKG_SYS_NAME:=qtbase-opensource-src-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SYS_NAME).tar.xz +PKG_SOURCE_URL:=http://download.qt-project.org/official_releases/qt/$(basename $(PKG_VERSION))/$(PKG_VERSION)/submodules + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SYS_NAME) +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=librpc +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk +include ./files/qmake.mk + +define Package/qt5base/Default + SECTION:=video-frameworks + CATEGORY:=Video + SUBMENU:=Frameworks and Toolkits + TITLE:=Qt5base + DEPENDS:=qt5base + URL:=http://qt.io + MAINTAINER:=Mirko Vogt +endef + +define Package/qt5base + $(call Package/qt5base/Default) + DEPENDS:= + MENU:=1 +endef + +define Package/qt5base-concurrent + $(call Package/qt5base/Default) + TITLE+=concurrent + DEPENDS+=+qt5base-core +endef + +define Package/qt5base-core + $(call Package/qt5base/Default) + TITLE+=core + DEPENDS+=+libpthread +zlib +libpcre16 +libstdcpp +icu +librt +endef + +define Package/qt5base-gui + $(call Package/qt5base/Default) + TITLE+=gui + DEPENDS+=+qt5base-core +libpng +endef + +define Package/qt5base-network + $(call Package/qt5base/Default) + TITLE+=network + DEPENDS+=+qt5base-core +libopenssl +endef + +# seems to be only present as static lib +# define Package/qt5base-paltformSupport +# $(call Package/qt5base/Default) +# DEPENDS+= +# endef + +define Package/qt5base-printSupport + $(call Package/qt5base/Default) + TITLE+=print support + DEPENDS+=+qt5base-core +qt5base-gui +qt5base-widgets +endef + +define Package/qt5base-sql + $(call Package/qt5base/Default) + TITLE+=sql + DEPENDS+=+qt5base-core +endef + +define Package/qt5base-test + $(call Package/qt5base/Default) + TITLE+=test + DEPENDS+=+qt5base-core +endef + +define Package/qt5base-widgets + $(call Package/qt5base/Default) + TITLE+=widgets + DEPENDS+=+qt5base-core +qt5base-gui +endef + +define Package/qt5base-xml + $(call Package/qt5base/Default) + TITLE+=xml + DEPENDS+=+qt5base-core +endef + +#### plugins + +####### bearer + +define Package/qt5base-plugin-bearer-generic + $(call Package/qt5base/Default) +TITLE+=bearer (plugin) + DEPENDS+=+qt5base-core +qt5base-network +endef + +####### generic / input + +define Package/qt5base-plugin-input-evdevkeyboard + $(call Package/qt5base/Default) + TITLE+=evdev keyboard (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +define Package/qt5base-plugin-input-evdevmouse + $(call Package/qt5base/Default) + TITLE+=evdev mouse (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +define Package/qt5base-plugin-input-evdevtablet + $(call Package/qt5base/Default) + TITLE+=evdev tablet (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +define Package/qt5base-plugin-input-evdevtouch + $(call Package/qt5base/Default) + TITLE+=evdev touch (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +####### imageformats + +define Package/qt5base-plugin-imageformats-gif + $(call Package/qt5base/Default) +TITLE+=imageformat gif (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +endef + +define Package/qt5base-plugin-imageformats-ico + $(call Package/qt5base/Default) + TITLE+=imageformat ico (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +endef + +define Package/qt5base-plugin-imageformats-jpeg + $(call Package/qt5base/Default) + TITLE+=imageformat jpeg (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libjpeg +endef + +####### platforms + +define Package/qt5base-plugin-platforms-linuxfb + $(call Package/qt5base/Default) + TITLE+=platform linuxfb (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +define Package/qt5base-plugin-platforms-minimal + $(call Package/qt5base/Default) + TITLE+=platform minimal (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +define Package/qt5base-plugin-platforms-offscreen + $(call Package/qt5base/Default) + TITLE+=platform offscreen (plugin) + DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig +endef + +###### sql + +define Package/qt5base-plugin-sqldrivers-sqlite + $(call Package/qt5base/Default) + TITLE+=sqldriver sqlite (plugin) + DEPENDS+=+qt5base-core +qt5base-sql +libsqlite3 +endef + +define Package/qt5base-examples + $(call Package/qt5base/Default) + TITLE+=examples + DEPENDS+=\ + +qt5base-core \ + +qt5base-gui \ + +qt5base-widgets \ + +qt5base-network \ + +qt5base-sql \ + +qt5base-xml \ + +qt5base-printSupport \ + +qt5base-concurrent +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) \ + ./files/mkspecs/linux-openwrt-g++ \ + $(PKG_BUILD_DIR)/mkspecs/ +endef + +define Build/Configure + # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements. + # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.), + # hence we use the TARGET_* nomenclature. + ( cd $(PKG_BUILD_DIR) ; \ + TARGET_CROSS="$(TARGET_CROSS)" \ + TARGET_CFLAGS="$(TARGET_CFLAGS)" \ + TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(TARGET_CXXFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + ./configure \ + -prefix $(QT_INSTALL_PREFIX) \ + -extprefix $(QT_EXTPREFIX) \ + -hostprefix $(QT_HOST_PREFIX) \ + -bindir $(QT_INSTALL_BINS) \ + -headerdir $(QT_INSTALL_HEADERS) \ + -libdir $(QT_INSTALL_LIBS) \ + -archdatadir $(QT_INSTALL_ARCHDATA) \ + -plugindir $(QT_INSTALL_PLUGINS) \ + -libexecdir $(QT_INSTALL_LIBEXECS) \ + -importdir $(QT_INSTALL_IMPORTS) \ + -qmldir $(QT_INSTALL_QML) \ + -datadir $(QT_INSTALL_DATA) \ + -docdir $(QT_INSTALL_DOCS) \ + -translationdir $(QT_INSTALL_TRANSLATIONS) \ + -sysconfdir $(QT_INSTALL_CONFIGURATION) \ + -examplesdir $(QT_INSTALL_EXAMPLES) \ + -testsdir $(QT_INSTALL_TESTS) \ + -hostbindir $(QT_HOST_BINS) \ + -hostlibdir $(QT_HOST_LIBS) \ + -hostdatadir $(QT_HOST_DATA) \ + -v \ + -release \ + -opensource \ + -confirm-license \ + -c++11 \ + -shared \ + -largefile \ + -accessibility \ + -system-sqlite \ + -no-qml-debug \ + -no-sse2 \ + -no-sse3 \ + -no-ssse3 \ + -no-sse4.1 \ + -no-sse4.2 \ + -no-avx \ + -no-avx2 \ + -no-mips_dsp \ + -no-mips_dspr2 \ + -force-pkg-config \ + -system-zlib \ + -mtdev \ + -no-journald \ + -system-libpng \ + -system-libjpeg \ + -system-freetype \ + -no-harfbuzz \ + -openssl-linked \ + -system-pcre \ + -system-xcb \ + -system-xkbcommon \ + -no-xinput2 \ + -no-xcb-xlib \ + -no-glib \ + -no-pulseaudio \ + -alsa \ + -no-gtkstyle \ + -nomake tools \ + -make examples \ + -gui \ + -widgets \ + -no-optimized-qmake \ + -no-cups \ + -iconv \ + -evdev \ + -icu \ + -fontconfig \ + -no-strip \ + -no-pch \ + -no-dbus \ + -no-reduce-relocations \ + -no-use-gold-linker \ + -no-xcb \ + -no-eglfs \ + -no-directfb \ + -linuxfb \ + -no-kms \ + -qpa minimal \ + -xplatform linux-openwrt-g++ \ + -no-opengl \ + -no-system-proxies \ + -no-warnings-are-errors \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) \ + $(STAGING_DIR)/host/mk + + $(CP) \ + ./files/qmake.mk \ + $(STAGING_DIR)/host/mk/ + + $(call Build/Install/HostFiles,$(1)) + $(call Build/Install/Headers,$(1)) + $(call Build/Install/Libs,$(1),*) +endef + +define Package/qt5base-concurrent/install + $(call Build/Install/Libs,$(1),libQt5Concurrent) +endef + +define Package/qt5base-core/install + $(call Build/Install/Libs,$(1),libQt5Core) +endef + +define Package/qt5base-gui/install + $(call Build/Install/Libs,$(1),libQt5Gui) +endef + +define Package/qt5base-network/install + $(call Build/Install/Libs,$(1),libQt5Network) +endef + +define Package/qt5base-printSupport/install + $(call Build/Install/Libs,$(1),libQt5PrintSupport) +endef + +define Package/qt5base-sql/install + $(call Build/Install/Libs,$(1),libQt5Sql) +endef + +define Package/qt5base-test/install + $(call Build/Install/Libs,$(1),libQt5Test) +endef + +define Package/qt5base-widgets/install + $(call Build/Install/Libs,$(1),libQt5Widgets) +endef + +define Package/qt5base-xml/install + $(call Build/Install/Libs,$(1),libQt5Xml) +endef + +define Package/qt5base-plugin-bearer-generic/install + $(call Build/Install/Plugins,$(1),bearer,libqgenericbearer) +endef + +define Package/qt5base-plugin-input-evdevkeyboard/install + $(call Build/Install/Plugins,$(1),generic,libqevdevkeyboardplugin) +endef + +define Package/qt5base-plugin-input-evdevmouse/install + $(call Build/Install/Plugins,$(1),generic,libqevdevmouseplugin) +endef + +define Package/qt5base-plugin-input-evdevtablet/install + $(call Build/Install/Plugins,$(1),generic,libqevdevtabletplugin) +endef + +define Package/qt5base-plugin-input-evdevtouch/install + $(call Build/Install/Plugins,$(1),generic,libqevdevtouchplugin) +endef + +define Package/qt5base-plugin-imageformats-gif/install + $(call Build/Install/Plugins,$(1),imageformats,libqgif) +endef + +define Package/qt5base-plugin-imageformats-ico/install + $(call Build/Install/Plugins,$(1),imageformats,libqico) +endef + +define Package/qt5base-plugin-imageformats-jpeg/install + $(call Build/Install/Plugins,$(1),imageformats,libqjpeg) +endef + +define Package/qt5base-plugin-platforms-linuxfb/install + $(call Build/Install/Plugins,$(1),platforms,libqlinuxfb) +endef + +define Package/qt5base-plugin-platforms-minimal/install + $(call Build/Install/Plugins,$(1),platforms,libqminimal) +endef + +define Package/qt5base-plugin-platforms-offscreen/install + $(call Build/Install/Plugins,$(1),platforms,libqoffscreen) +endef + +define Package/qt5base-plugin-sqldrivers/install + $(call Build/Install/Plugins,$(1),sqldrivers,libqsqlite) +endef + +define Package/qt5base-examples/install + $(call Build/Install/Examples,$(1)) +endef + +$(eval $(call BuildPackage,qt5base)) +$(eval $(call BuildPackage,qt5base-concurrent)) +$(eval $(call BuildPackage,qt5base-core)) +$(eval $(call BuildPackage,qt5base-gui)) +$(eval $(call BuildPackage,qt5base-network)) +$(eval $(call BuildPackage,qt5base-printSupport)) +$(eval $(call BuildPackage,qt5base-sql)) +$(eval $(call BuildPackage,qt5base-test)) +$(eval $(call BuildPackage,qt5base-widgets)) +$(eval $(call BuildPackage,qt5base-xml)) +$(eval $(call BuildPackage,qt5base-plugin-bearer-generic)) +$(eval $(call BuildPackage,qt5base-plugin-input-evdevkeyboard)) +$(eval $(call BuildPackage,qt5base-plugin-input-evdevmouse)) +$(eval $(call BuildPackage,qt5base-plugin-input-evdevtablet)) +$(eval $(call BuildPackage,qt5base-plugin-input-evdevtouch)) +$(eval $(call BuildPackage,qt5base-plugin-imageformats-gif)) +$(eval $(call BuildPackage,qt5base-plugin-imageformats-ico)) +$(eval $(call BuildPackage,qt5base-plugin-imageformats-jpeg)) +$(eval $(call BuildPackage,qt5base-plugin-platforms-linuxfb)) +$(eval $(call BuildPackage,qt5base-plugin-platforms-minimal)) +$(eval $(call BuildPackage,qt5base-plugin-platforms-offscreen)) +$(eval $(call BuildPackage,qt5base-plugin-sqldrivers-sqlite)) +$(eval $(call BuildPackage,qt5base-examples)) diff --git a/frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qmake.conf b/frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qmake.conf new file mode 100644 index 0000000..eff0868 --- /dev/null +++ b/frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qmake.conf @@ -0,0 +1,37 @@ +# +# qmake configuration for building with linux-openwrt-g++ +# + +MAKEFILE_GENERATOR = UNIX +CONFIG += incremental +QMAKE_INCREMENTAL_STYLE = sublib + +include(../common/linux.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) + + +# modifications to gcc-base.conf (included by gcc-base-unix.conf) +QMAKE_CFLAGS += $$(TARGET_CFLAGS) +QMAKE_CXXFLAGS += $$(TARGET_CXXFLAGS) +QMAKE_LFLAGS += $$(TARGET_LDFLAGS) + +# modifications to g++.conf +QMAKE_CC = $$(TARGET_CROSS)gcc +QMAKE_CXX = $$(TARGET_CROSS)g++ + +QMAKE_LINK_C = $$QMAKE_CC +QMAKE_LINK_C_SHLIB = $$QMAKE_CC +QMAKE_LINK = $$QMAKE_CXX +QMAKE_LINK_SHLIB = $$QMAKE_CXX + + +# modifications to linux.conf +QMAKE_AR = $$(TARGET_CROSS)ar cqs +QMAKE_RANLIB = $$(TARGET_CROSS)ranlib # QMAKE_RANLIB is set to NULL in linux.conf. Why? Not needed anymore? Set it anyway, just in case... +QMAKE_OBJCOPY = $$(TARGET_CROSS)objcopy +QMAKE_NM = $$(TARGET_CROSS)nm # whole qt5 project doesn't use $QMAKE_NM - wonder why it's defined in linux.conf at all. However better set it to ours than keep it being set to the host's version, just in case... +QMAKE_STRIP = # not used, since -no-strip is passed. Let's OpenWrt do the stripping + + +load(qt_config) diff --git a/frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qplatformdefs.h b/frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qplatformdefs.h new file mode 100644 index 0000000..9cfed53 --- /dev/null +++ b/frameworks/qt5base/files/mkspecs/linux-openwrt-g++/qplatformdefs.h @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../linux-g++/qplatformdefs.h" diff --git a/frameworks/qt5base/files/qmake.mk b/frameworks/qt5base/files/qmake.mk new file mode 100644 index 0000000..a28594f --- /dev/null +++ b/frameworks/qt5base/files/qmake.mk @@ -0,0 +1,147 @@ +# +# Copyright (C) 2015 OpenWrt.org +# Author: Mirko Vogt +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +# qmake - oh my.. qmake is supposed to generate Makefiles suitable for cross-compiling +# however fails itself hard being used in a cross compiling toolchain in any sane way. +# +# There are the QT_INSTALL_* variables - which get set via Qt's configure options, +# containing paths which become hardcoded into the qmake binary. +# Those paths are supposed to refer to the target system, however are also used for +# include and linker paths. +# Hence, setting QT_INSTALL_PREFIX=/usr would result in -I/usr/include, +# -L/usr/lib, etc., referencing the host headers and libraries. +# The QT_SYSROOT variable looks most promising for distinguishing between +# host and target specific paths, however it fails hard and is totally undocumented. +# The extprefix variable tries to cover the situation, however actually just prepends +# its path to the QT_INSTALL_* variables - basically cosmetics. +# +# The QT_HOST_* variables are used for host tools, libraries, mkspecs and its data. +# +# As a consequence we set QT_INSTALL_* and QT_HOST_* to absolute paths, which +# inevitably results in the following issues: +# +# - 'make install' results in paths like: +# /tmp/install_root/home/cross/openwrt/staging_dir/target-*/usr. +# This is workarounded by overriding the PKG_INSTALL_DIR, so the Makefiles don't +# have to care about that. +# - Once compiled, qmake's location and its requirements (mkspecs, etc.) are fixed, +# since its absolute paths were hardcoded. No moving around of the toolchain. +# - Those variables might be used for target binaries for some weird reason, so +# paths to the host staging_dir would make it to the target, logically leading to +# errors. +# - Paths might make it into target binaries, thus referencing non-existing +# objects on the target platform. Tihs behaviour wasn't observed so far, however +# one might use the QT_INSTALL_* variables for some weird reason during runtime. + + +QT_EXTPREFIX:=$(STAGING_DIR)/$(CONFIGURE_PREFIX) +QT_SYSROOT:= +QT_INSTALL_CONFIGURATION:=/etc/qt5 +QT_INSTALL_PREFIX:=$(CONFIGURE_PREFIX) +QT_INSTALL_LIBS:=$(QT_INSTALL_PREFIX)/lib +QT_INSTALL_DATA:=$(QT_INSTALL_PREFIX)/share/qt5 +QT_INSTALL_HEADERS:=$(QT_INSTALL_PREFIX)/include +QT_INSTALL_BINS:=$(QT_INSTALL_PREFIX)/bin +QT_INSTALL_DOCS:=$(QT_INSTALL_DATA)/doc +QT_INSTALL_TRANSLATIONS:=$(QT_INSTALL_DATA)/translations +QT_INSTALL_ARCHDATA:=$(QT_INSTALL_LIBS)/qt5 +QT_INSTALL_LIBEXECS:=$(QT_INSTALL_ARCHDATA) +QT_INSTALL_TESTS:=$(QT_INSTALL_ARCHDATA)/tests +QT_INSTALL_PLUGINS:=$(QT_INSTALL_ARCHDATA)/plugins +QT_INSTALL_IMPORTS:=$(QT_INSTALL_ARCHDATA)/imports +QT_INSTALL_QML:=$(QT_INSTALL_ARCHDATA)/qml +QT_INSTALL_EXAMPLES:=$(QT_INSTALL_ARCHDATA)/examples +QT_INSTALL_DEMOS:=$(QT_INSTALL_EXAMPLES) +QT_HOST_EXTPREFIX:=$(STAGING_DIR)/host +QT_HOST_PREFIX:=$(QT_HOST_EXTPREFIX) +QT_HOST_DATA:=$(QT_HOST_PREFIX)/share +QT_HOST_BINS:=$(QT_HOST_PREFIX)/bin +QT_HOST_LIBS:=$(QT_HOST_PREFIX)/lib + +QMAKE_SPEC:=linux-g++ +QMAKE_XSPEC:=linux-openwrt-g++ + +QMAKE_SPECFILE:=$(QT_HOST_DATA)/mkspecs/$(QMAKE_XSPEC) + +PKG_INSTALL_DIR_ROOT:=$(PKG_INSTALL_DIR) +PKG_INSTALL_DIR:=$(PKG_INSTALL_DIR_ROOT)/$(STAGING_DIR) + +define Build/Configure/Default + TARGET_CROSS="$(TARGET_CROSS)" \ + TARGET_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ + TARGET_CXXFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CXXFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + qmake \ + -spec $(QMAKE_SPECFILE) \ + -o $(PKG_BUILD_DIR)/$(2)/Makefile \ + $(PKG_BUILD_DIR)/$(2)/$(if $(1),$(1),$(PKG_NAME)).pro +endef + +# we need to pass everything to $(MAKE) as well, as Makefiles may invoke qmake once again for creating further Makefiles +define Build/Compile/Default + +TARGET_CROSS="$(TARGET_CROSS)" \ + TARGET_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \ + TARGET_CXXFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CXXFLAGS)" \ + TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \ + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \ + $(1) +endef + +define Build/Install/Default + INSTALL_ROOT="$(PKG_INSTALL_DIR_ROOT)" \ + $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \ + $(1) install +endef + +define Build/Install/HostFiles + $(INSTALL_DIR) \ + $(1)/host + + $(CP) \ + $(PKG_INSTALL_DIR)/host/* \ + $(1)/host/ +endef + +define Build/Install/Headers + $(INSTALL_DIR) \ + $(1)/$(QT_INSTALL_HEADERS) + + $(CP) \ + $(PKG_INSTALL_DIR)/$(QT_INSTALL_HEADERS)/* \ + $(1)/$(QT_INSTALL_HEADERS)/ +endef + +define Build/Install/Libs + $(INSTALL_DIR) \ + $(1)/$(QT_INSTALL_LIBS) + + $(CP) \ + $(PKG_INSTALL_DIR)/$(QT_INSTALL_LIBS)/$(2).so* \ + $(1)/$(QT_INSTALL_LIBS)/ +endef + +define Build/Install/Plugins + $(INSTALL_DIR) \ + $(1)/$(QT_INSTALL_PLUGINS)/$(2) + + $(CP) \ + $(PKG_INSTALL_DIR)/$(QT_INSTALL_PLUGINS)/$(2)/$(3).so* \ + $(1)/$(QT_INSTALL_PLUGINS)/$(2)/ +endef + +define Build/Install/Examples + $(INSTALL_DIR) \ + $(1)/$(QT_INSTALL_EXAMPLES) + + $(CP) \ + $(PKG_INSTALL_DIR)/$(QT_INSTALL_EXAMPLES)/* \ + $(1)/$(QT_INSTALL_EXAMPLES)/ + + $(FIND) $(1)/usr/share/qt5/examples/ \ + -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.pro' -o -name '*.pri' \) | \ + $(XARGS) $(RM) -vf +endef diff --git a/frameworks/qt5base/patches/002-uclibc-execinfo.patch b/frameworks/qt5base/patches/002-uclibc-execinfo.patch new file mode 100644 index 0000000..ae26333 --- /dev/null +++ b/frameworks/qt5base/patches/002-uclibc-execinfo.patch @@ -0,0 +1,11 @@ +--- qtbase-opensource-src-5.4.1.orig/src/corelib/kernel/qcrashhandler.cpp 2015-05-27 21:29:18.327561992 +0200 ++++ qtbase-opensource-src-5.4.1/src/corelib/kernel/qcrashhandler.cpp 2015-05-27 21:34:18.543553856 +0200 +@@ -62,7 +62,7 @@ + + QtCrashHandler QSegfaultHandler::callback = 0; + +-#if defined(__GLIBC__) && (__GLIBC__ >= 2) && !defined(__UCLIBC__) && !defined(QT_LINUXBASE) ++#if defined(__GLIBC__) && (__GLIBC__ >= 2) && (!defined(__UCLIBC__) || (defined(__UCLIBC__) && defined(UCLIBC_HAS_BACKTRACE))) && !defined(QT_LINUXBASE) + QT_BEGIN_INCLUDE_NAMESPACE + # include "qstring.h" + # include -- 2.30.2