Commit 54e95512 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Peter Korsgaard
Browse files

qt5base: new package



This is the beginning of the Qt5 packaging. This commit allows to
build only the qtbase module, which contains QtCore, QtNetwork, QtXml,
QtTest, QtSql and QtConcurrent.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 1737b564
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ source "package/qtuio/Config.in"
source "package/qwt/Config.in"
endif

source "package/qt5/Config.in"
source "package/x11r7/Config.in"

comment "X libraries and helper libraries"
+1 −1
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@ menuconfig BR2_PACKAGE_QT5
	  http://qt-project.org

if BR2_PACKAGE_QT5

source "package/qt5/qt5base/Config.in"
endif
+56 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_QT5BASE
	bool "qt5base"
	select BR2_PACKAGE_ZLIB
	select BR2_PACKAGE_PCRE
	select BR2_PACKAGE_PCRE_16
	help
	  Qt is a cross-platform application and UI framework for
	  developers using C++.

	  This package corresponds to the qt5base module, which
	  contains the base Qt libraries: QtCore, QtNetwork, QtGui,
	  QtWidgets, etc.

	  http://qt-project.org

if BR2_PACKAGE_QT5BASE

config BR2_PACKAGE_QT5BASE_LICENSE_APPROVED
	bool "Approve free license"
	help
	  Select this if you approve one of the available free licenses for the
	  Qt5 library.
	  By doing this you will not be asked while the library is compiled.
	  Please read and understand the license terms before approving this.

	  LGPL v2.1: http://qt-project.org/doc/qt-5.0/qtdoc/lgpl.html
	  GPL  v3.0: http://qt-project.org/doc/qt-5.0/qtdoc/gpl.html

	  See also http://qt-project.org/doc/qt-5.0/qtdoc/licensing.html

config BR2_PACKAGE_QT5BASE_NETWORK
	bool "network module"
	help
	  This options enables the Qt5Network library.

config BR2_PACKAGE_QT5BASE_CONCURRENT
	bool "concurrent module"
	help
	  This options enables the Qt5Concurrent library.

config BR2_PACKAGE_QT5BASE_SQL
	bool "sql module"
	help
	  This options enables the Qt5Sql library.

config BR2_PACKAGE_QT5BASE_TEST
	bool "test module"
	help
	  This options enables the Qt5Test library.

config BR2_PACKAGE_QT5BASE_XML
	bool "XML module"
	help
	  This options enables the Qt5Xml library.

endif
+61 −0
Original line number Diff line number Diff line
Add a Buildroot 'device' to ease cross-compilation

Qt5 has a mechanism to support "device" profiles, so that people can
specify the compiler, compiler flags and so on for a specific device.

We leverage this mechanism in the Buildroot packaging of qt5 to
simplify cross-compilation: we have our own "device" definition, which
allows us to easily pass the cross-compiler paths and flags from our
qt5.mk.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Index: b/mkspecs/devices/linux-buildroot-g++/qmake.conf
===================================================================
--- /dev/null
+++ b/mkspecs/devices/linux-buildroot-g++/qmake.conf
@@ -0,0 +1,38 @@
+MAKEFILE_GENERATOR      = UNIX
+CONFIG                  += incremental gdb_dwarf_index
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(../../common/linux.conf)
+include(../../common/gcc-base-unix.conf)
+include(../../common/g++-unix.conf)
+
+load(device_config)
+
+QT_QPA_DEFAULT_PLATFORM = eglfs
+
+CROSS_COMPILE =
+COMPILER_CFLAGS =
+COMPILER_CXXFLAGS =
+
+# modifications to g++.conf
+QMAKE_CC                = $${CROSS_COMPILE}gcc
+QMAKE_CXX               = $${CROSS_COMPILE}g++
+QMAKE_LINK              = $${QMAKE_CXX}
+QMAKE_LINK_SHLIB        = $${QMAKE_CXX}
+
+# modifications to linux.conf
+QMAKE_AR                = $${CROSS_COMPILE}ar cqs
+QMAKE_OBJCOPY           = $${CROSS_COMPILE}objcopy
+QMAKE_STRIP             = $${CROSS_COMPILE}strip
+
+#modifications to gcc-base.conf
+QMAKE_CFLAGS           += $${COMPILER_CFLAGS}
+QMAKE_CXXFLAGS         += $${COMPILER_CXXFLAGS}
+QMAKE_CXXFLAGS_RELEASE += -O3
+
+QMAKE_LIBS             += -lrt -lpthread -ldl
+
+# Sanity check
+deviceSanityCheckCompiler()
+
+load(qt_config)
Index: b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
===================================================================
--- /dev/null
+++ b/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
@@ -0,0 +1 @@
+#include "../../linux-g++/qplatformdefs.h"
+36 −0
Original line number Diff line number Diff line
From 6f88b27de256266947a7f6a3e70e18510754aab2 Mon Sep 17 00:00:00 2001
From: Peter Korsgaard <jacmet@sunsite.dk>
Date: Sat, 14 Apr 2012 20:36:07 +0200
Subject: [PATCH] mkspecs/common/posix: fix !largefile builds on uClibc

uClibc doesn't even define O_LARGEFILE when not configured with large file
support, so ensure this define is only used when Qt is built with
-largefile, otherwise the build fails with:

io/qtemporaryfile.cpp: In function 'bool createFileFromTemplate(
        NativeFileHandle&, QFileSystemEntry::NativePath&, size_t, size_t,
        QSystemError&)':
io/qtemporaryfile.cpp:197:57: error: 'O_LARGEFILE' was not declared in
        this scope

Moved to qt5 by Thomas Petazzoni.

Reported-Upstream: https://bugreports.qt-project.org/browse/QTBUG-25321
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>

Index: b/mkspecs/common/posix/qplatformdefs.h
===================================================================
--- a/mkspecs/common/posix/qplatformdefs.h
+++ b/mkspecs/common/posix/qplatformdefs.h
@@ -123,7 +123,11 @@
 #define QT_READ                 ::read
 #define QT_WRITE                ::write
 
+#ifdef QT_LARGEFILE_SUPPORT
 #define QT_OPEN_LARGEFILE       O_LARGEFILE
+#else
+#define QT_OPEN_LARGEFILE       0
+#endif
 #define QT_OPEN_RDONLY          O_RDONLY
 #define QT_OPEN_WRONLY          O_WRONLY
 #define QT_OPEN_RDWR            O_RDWR
Loading