Skip to contentSkip to conversation

qt: Add option to build and install tools on the

PATCH Superseded Ismael Luceno 2 participants 4 messages Mar 5, 2012

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v5 cover qt: Add option to build and install tools on the

Changes since v4:
* Fixed to handle empty $(QT_TARGET_PROGRAMS-y) correctly

Changes since v3:
* Fixed comment and typo

Changes since v2:
* Comment tools dependency on SQL module
* Replaced $(if $(...)) for VAR-$(...)
* More granularity on the installation of target tools

#1 lore raw

PATCH v5 1/1 qt: Add option to build and install tools on the target

---
 package/qt/Config.in |   25 +++++++++++++++++++++++++
 package/qt/qt.mk     |   12 ++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)
package/qt/Config.in +25 -0
index 3a552d0..1c24d1f 100644
@@ -16,6 +16,31 @@ config BR2_PACKAGE_QT_DEBUG
 	help
 	  If unsure, say N.
 
+menuconfig BR2_PACKAGE_QT_TOOLS
+	bool "Compile and install tools"
+	depends on BR2_PACKAGE_QT_SQL_MODULE && BR2_PACKAGE_QT_GUI_MODULE
+	# SQL module is needed to build, but only required at run-time by a
+	# few tools (assistant, designer, qmlviewer).
+
+if BR2_PACKAGE_QT_TOOLS
+
+config BR2_PACKAGE_QT_TOOLS_QTCONFIG
+	bool "qtconfig"
+	depends on BR2_PACKAGE_QT_GUI_X11
+
+config BR2_PACKAGE_QT_TOOLS_QMLVIEWER
+	bool "qmlviewer"
+	depends on BR2_PACKAGE_QT_DECLARATIVE
+
+config BR2_PACKAGE_QT_TOOLS_QMLPLUGINDUMP
+	bool "qmlplugindump"
+	depends on BR2_PACKAGE_QT_DECLARATIVE
+
+endif # BR2_PACKAGE_QT_TOOLS
+
+comment "Tools need the SQL and GUI modules"
+	depends on !BR2_PACKAGE_QT_SQL_MODULE || !BR2_PACKAGE_QT_GUI_MODULE
+
 config BR2_PACKAGE_QT_DEMOS
 	bool "Compile and install demos and examples (with code)"
 	help
package/qt/qt.mk +12 -0
index 776eb63..23fa53d 100644
@@ -417,6 +417,12 @@ else
 QT_CONFIGURE_OPTS += -no-declarative
 endif
 
+ifeq ($(BR2_PACKAGE_QT_TOOLS),y)
+QT_CONFIGURE_OPTS += -make tools
+else
+QT_CONFIGURE_OPTS += -nomake tools
+endif
+
 # ccache and precompiled headers don't play well together
 ifeq ($(BR2_CCACHE),y)
 QT_CONFIGURE_OPTS += -no-pch
@@ -514,6 +520,9 @@ endef
 
 QT_INSTALL_LIBS    += QtCore
 QT_HOST_PROGRAMS   += moc rcc qmake lrelease
+QT_TARGET_PROGRAMS-$(BR2_PACKAGE_QT_TOOLS_QTCONFIG) += qtconfig
+QT_TARGET_PROGRAMS-$(BR2_PACKAGE_QT_TOOLS_QMLVIEWER) += qmlviewer
+QT_TARGET_PROGRAMS-$(BR2_PACKAGE_QT_TOOLS_QMLPLUGINDUMP) += qmlplugindump
 
 ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
 QT_INSTALL_LIBS    += QtGui
@@ -583,6 +592,9 @@ define QT_INSTALL_STAGING_CMDS
 	$(MAKE) -C $(@D) install
 	mkdir -p $(HOST_DIR)/usr/bin
 	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
+ifneq ($(strip $(QT_TARGET_PROGRAMS-y)),)
+	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_TARGET_PROGRAMS-y)) $(TARGET_DIR)/usr/bin
+endif
 	rm -rf $(HOST_DIR)/usr/mkspecs
 	mv $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr
 	$(QT_INSTALL_QT_CONF)
Signature · 1 line
1.7.9.1
#2 lore raw

PATCH v5 1/1 qt: Add option to build and install tools on the target

Hello Ismael,

I think you're going to get crazy, but...

Le Mon, 5 Mar 2012 09:10:27 -0200,
Ismael Luceno <[email protected]> a ?crit :

package/qt/qt.mk define QT_INSTALL_STAGING_CMDS · line 600

Quoted 10 lines
package/qt/qt.mk +3 -0
@@ -583,6 +592,9 @@ define QT_INSTALL_STAGING_CMDS
 	$(MAKE) -C $(@D) install
 	mkdir -p $(HOST_DIR)/usr/bin
 	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
+ifneq ($(strip $(QT_TARGET_PROGRAMS-y)),)
+	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_TARGET_PROGRAMS-y)) $(TARGET_DIR)/usr/bin
+endif
 	rm -rf $(HOST_DIR)/usr/mkspecs
 	mv $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr
 	$(QT_INSTALL_QT_CONF)

this will not work. You cannot do ifeq/ifneq tests within define...endef blocks.

I have another question about:

+menuconfig BR2_PACKAGE_QT_TOOLS
+ bool "Compile and install tools"
+ depends on BR2_PACKAGE_QT_SQL_MODULE && BR2_PACKAGE_QT_GUI_MODULE
+ # SQL module is needed to build, but only required at run-time by a
+ # few tools (assistant, designer, qmlviewer).
+
+if BR2_PACKAGE_QT_TOOLS
+
+config BR2_PACKAGE_QT_TOOLS_QTCONFIG
+ bool "qtconfig"
+ depends on BR2_PACKAGE_QT_GUI_X11
+
+config BR2_PACKAGE_QT_TOOLS_QMLVIEWER
+ bool "qmlviewer"
+ depends on BR2_PACKAGE_QT_DECLARATIVE
+
+config BR2_PACKAGE_QT_TOOLS_QMLPLUGINDUMP
+ bool "qmlplugindump"
+ depends on BR2_PACKAGE_QT_DECLARATIVE
+
+endif # BR2_PACKAGE_QT_TOOLS
+
+comment "Tools need the SQL and GUI modules"
+ depends on !BR2_PACKAGE_QT_SQL_MODULE || !BR2_PACKAGE_QT_GUI_MODULE

So it means that *all* tools depend on the GUI module and SQL module, and then qtconfig specifically needs X11 in addition to SQL and GUI, and qmlviewer and qmlplugindump need the QtDeclarative module in addition to SQL and GUI. I am a bit surprised that the qmlviewer and qmlplugindump tools require the SQL module. Is this correct?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH v5 1/1 qt: Add option to build and install tools on the target

On Mon, 5 Mar 2012 13:50:03 +0100
Thomas Petazzoni <[email protected]> wrote:
<...>

Quoted 17 lines

Le Mon, 5 Mar 2012 09:10:27 -0200,
Ismael Luceno <[email protected]> a ?crit :

package/qt/qt.mk define QT_INSTALL_STAGING_CMDS · line 600

Quoted 11 lines
package/qt/qt.mk +0 -0
@@ -583,6 +592,9 @@ define QT_INSTALL_STAGING_CMDS
 	$(MAKE) -C $(@D) install
 	mkdir -p $(HOST_DIR)/usr/bin
 	mv $(addprefix

$(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin

(quoted diff) +2 -0
+ifneq ($(strip $(QT_TARGET_PROGRAMS-y)),)
+	mv $(addprefix

$(STAGING_DIR)/usr/bin/,$(QT_TARGET_PROGRAMS-y)) $(TARGET_DIR)/usr/bin +endif rm -rf $(HOST_DIR)/usr/mkspecs

package/qt/qt.mk +0 -0
 	mv $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr
 	$(QT_INSTALL_QT_CONF)

this will not work. You cannot do ifeq/ifneq tests within define...endef blocks.

<...>

Oh :/. I gues I'll have to replace it with an $(if ...).

Quoted 1 line

So it means that *all* tools depend on the GUI module and SQL module,

<...>

Not exactly. The problem is, there's no way to choose which tools are built, so the dependency just serves as a way to predict if the tool will be built or not.

We're not telling anything to the build system based on those options. IMO, patching the project file is asking for problems.

Quoted 2 lines

I am a bit surprised that the qmlviewer and qmlplugindump tools require the SQL module. Is this correct?

Yes, I tried without the SQL module at first, but it gave an error.
I guess it's only needed by qmlviewer, but both are built together. -------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120305/b4189aa9/attachment.asc>