[v2] package/qt6/qt6base: add support for extra configure options

Message ID 20261126160839.1277903-1-dario.binacchi@amarulasolutions.com
State New
Headers
Series [v2] package/qt6/qt6base: add support for extra configure options |

Commit Message

Dario Binacchi Nov. 26, 2026, 4:08 p.m. UTC
Following the same approach already used for qt5base, add a single
config entry to pass arbitrary qt6base options, which are appended
to the ones generated by Buildroot. This allows to reduce the qt6base
binary size without requiring every qt6base option to be mapped to
Buildroot.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
Changes in v2:
- Rebase on current master.
- Move the option out of the BR2_PACKAGE_QT6BASE_GUI block, so that it
  is also available without the GUI module.
- Use the FEATURE_ prefix in the help example, as done in qt6base.mk.

v1: https://lore.kernel.org/buildroot/20250910134822.2908515-1-dario.binacchi@amarulasolutions.com

 package/qt6/qt6base/Config.in  | 11 +++++++++++
 package/qt6/qt6base/qt6base.mk |  3 +++
 2 files changed, 14 insertions(+)

-- 
2.43.0
  

Patch

diff --git a/package/qt6/qt6base/Config.in b/package/qt6/qt6base/Config.in
index e6bb99de28fa..dc8694fc72b0 100644
--- a/package/qt6/qt6base/Config.in
+++ b/package/qt6/qt6base/Config.in
@@ -17,6 +17,17 @@  config BR2_PACKAGE_QT6BASE
 
 if BR2_PACKAGE_QT6BASE
 
+config BR2_PACKAGE_QT6BASE_CUSTOM_CONF_OPTS
+	string "Custom configuration options"
+	help
+	  Define custom qt6 configuration options which can be used to
+	  enable or disable options not managed by buildroot. These
+	  options are appended to the ones generated by buildroot and
+	  passed to qt6base during configuration.
+
+	  E.g. to disable mimetype handling, add the option
+	  -DFEATURE_mimetype=OFF.
+
 config BR2_PACKAGE_QT6BASE_CONCURRENT
 	bool "concurrent module"
 	help
diff --git a/package/qt6/qt6base/qt6base.mk b/package/qt6/qt6base/qt6base.mk
index 032947417259..26f7a6f7cc5f 100644
--- a/package/qt6/qt6base/qt6base.mk
+++ b/package/qt6/qt6base/qt6base.mk
@@ -426,6 +426,9 @@  else
 QT6BASE_CONF_OPTS += -DFEATURE_zstd=OFF
 endif
 
+# Must be last so can override all options set by Buildroot
+QT6BASE_CONF_OPTS += $(call qstrip,$(BR2_PACKAGE_QT6BASE_CUSTOM_CONF_OPTS))
+
 define QT6BASE_RM_USR_MKSPECS
 	$(RM) -rf $(TARGET_DIR)/usr/mkspecs
 endef