qt5base: add option for custom qconfig file
authorWill Wagner <will_wagner@carallon.com>
Tue, 3 Feb 2015 13:38:43 +0000 (13:38 +0000)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 12 Jul 2015 23:36:43 +0000 (01:36 +0200)
Add in support for a custom qconfig file in the same way it is
already present for the Qt4 package

Signed-off-by: Will Wagner <will_wagner@carallon.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/qt5/qt5base/Config.in
package/qt5/qt5base/qt5base.mk

index df1d3dc57c356650f39e2912301655864aee7cea..106517f441dc72ab82aee223af2f8a162f72b8ca 100644 (file)
@@ -28,6 +28,19 @@ config BR2_PACKAGE_QT5BASE_LICENSE_APPROVED
 
          See also http://doc.qt.io/qt-5/licensing.html
 
+config BR2_PACKAGE_QT5BASE_CONFIG_FILE
+       string "Config file"
+       help
+         Configure options allow to set which modules are being
+         compiled or not in Qt, but Qt also provide a more
+         fine-grained mechanism to configure which features should be
+         enabled or disabled, through a header file. Examples of such
+         header files can be found in src/corelib/global/qconfig-*.h
+         in the Qt sources.
+
+         This option allows to set the path of such a configuration
+         file, which Buildroot will give to Qt at compile time.
+
 config BR2_PACKAGE_QT5BASE_EXAMPLES
        bool "Compile and install examples (with code)"
        select BR2_PACKAGE_QT5BASE_NETWORK
index 2eebb5bd6c3ac9a1f19b7aedb98275ecd8443dd3..31247dde7fa83c7eab3931dc690a47831b3c3f40 100644 (file)
@@ -53,6 +53,12 @@ QT5BASE_LICENSE = Commercial license
 QT5BASE_REDISTRIBUTE = NO
 endif
 
+QT5BASE_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT5BASE_CONFIG_FILE))
+
+ifneq ($(QT5BASE_CONFIG_FILE),)
+QT5BASE_CONFIGURE_OPTS += -qconfig buildroot
+endif
+
 # Qt5 SQL Plugins
 ifeq ($(BR2_PACKAGE_QT5BASE_SQL),y)
 ifeq ($(BR2_PACKAGE_QT5BASE_MYSQL),y)
@@ -168,7 +174,14 @@ QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_PRINTSUPPORT) += Qt5PrintSupport
 
 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
 
+ifneq ($(QT5BASE_CONFIG_FILE),)
+define QT5BASE_CONFIGURE_CONFIG_FILE
+       cp $(QT5BASE_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
+endef
+endif
+
 define QT5BASE_CONFIGURE_CMDS
+       $(QT5BASE_CONFIGURE_CONFIG_FILE)
        (cd $(@D); \
                PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
                PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \