Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv2] qt: X11 support
@ 2012-03-04  3:06 Ismael Luceno
  2012-03-04 14:14 ` Arnout Vandecappelle
  0 siblings, 1 reply; 2+ messages in thread
From: Ismael Luceno @ 2012-03-04  3:06 UTC (permalink / raw)
  To: buildroot

Also reworked the QT_QMAKE_SET macro, to make it work on all qmakespecs.

Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com>
---
 package/qt/Config.in |   22 ++++++++++++++++++++++
 package/qt/qt.mk     |   12 +++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/package/qt/Config.in b/package/qt/Config.in
index 3a552d0..ab0fc18 100644
--- a/package/qt/Config.in
+++ b/package/qt/Config.in
@@ -85,6 +85,26 @@ config BR2_PACKAGE_QT_GUI_MODULE
 	  video output, or you don't require Qt GUI, say n.
 
 if BR2_PACKAGE_QT_GUI_MODULE
+
+choice
+	prompt "GUI Backend"
+	help
+	  Select the graphic system, used to arbitrate screen access.
+
+config BR2_PACKAGE_QT_GUI_QWS
+	bool "QWS"
+	default y if !BR2_PACKAGE_XORG7
+	help
+	  QWS is a compact and efficient windowing system. Using it, Qt-based
+	  applications write directly to the Linux framebuffer, eliminating the
+	  need for the X Window System.
+
+config BR2_PACKAGE_QT_GUI_X11
+	depends on BR2_PACKAGE_XORG7
+	bool "X Window System"
+	default y if BR2_PACKAGE_XORG7
+endchoice
+
 menu "Pixel depths"
 comment "Deselecting each option leads to Qt's default (8,16,32)"
 
@@ -255,9 +275,11 @@ endchoice
 
 source "package/qt/Config.sql.in"
 if BR2_PACKAGE_QT_GUI_MODULE
+if BR2_PACKAGE_QT_GUI_QWS
 source "package/qt/Config.gfx.in"
 source "package/qt/Config.mouse.in"
 source "package/qt/Config.keyboard.in"
+endif
 
 config BR2_PACKAGE_QT_PHONON
 	bool "Phonon Module"
diff --git a/package/qt/qt.mk b/package/qt/qt.mk
index 776eb63..c6fd292 100644
--- a/package/qt/qt.mk
+++ b/package/qt/qt.mk
@@ -220,7 +220,14 @@ else
 QT_EMB_PLATFORM = generic
 endif
 
+ifeq ($(BR2_PACKAGE_QT_GUI_X11),y)
+QT_SPEC = linux-g++
+QT_CONFIGURE_OPTS += -xplatform linux-g++ -arch $(QT_EMB_PLATFORM)
+else
+QT_SPEC = qws/linux-$(QT_EMB_PLATFORM)-g++
 QT_CONFIGURE_OPTS += -embedded $(QT_EMB_PLATFORM)
+endif
+
 
 ifneq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
 QT_CONFIGURE_OPTS += -no-gui
@@ -433,7 +440,7 @@ endif
 # End of workaround.
 
 # Variable for other Qt applications to use
-QT_QMAKE:=$(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
+QT_QMAKE:=$(HOST_DIR)/usr/bin/qmake -spec $(QT_SPEC)
 
 ################################################################################
 # QT_QMAKE_SET -- helper macro to set <variable> = <value> in
@@ -448,8 +455,7 @@ QT_QMAKE:=$(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
 # $(call QT_QMAKE_SET,variable,value,directory)
 ################################################################################
 define QT_QMAKE_SET
-	$(SED) '/$(1)/d' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
-	$(SED) '/include.*qws.conf/a$(1) = $(2)' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
+	$(SED) '/$(1)/d;/^load(qt_config)/i$(1) = $(2)' $(3)/mkspecs/$(QT_SPEC)/qmake.conf
 endef
 
 ifneq ($(BR2_INET_IPV6),y)
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCHv2] qt: X11 support
  2012-03-04  3:06 [Buildroot] [PATCHv2] qt: X11 support Ismael Luceno
@ 2012-03-04 14:14 ` Arnout Vandecappelle
  0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2012-03-04 14:14 UTC (permalink / raw)
  To: buildroot

On Sunday 04 March 2012 04:06:41 Ismael Luceno wrote:
> Also reworked the QT_QMAKE_SET macro, to make it work on all qmakespecs.
> 
> Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com>

 Sorry, I tried your patch and it doesn't work...

> +choice
> +	prompt "GUI Backend"
> +	help
> +	  Select the graphic system, used to arbitrate screen access.
> +
> +config BR2_PACKAGE_QT_GUI_QWS
> +	bool "QWS"
> +	default y if !BR2_PACKAGE_XORG7
> +	help
> +	  QWS is a compact and efficient windowing system. Using it, Qt-based
> +	  applications write directly to the Linux framebuffer, eliminating the
> +	  need for the X Window System.
> +
> +config BR2_PACKAGE_QT_GUI_X11
> +	depends on BR2_PACKAGE_XORG7
> +	bool "X Window System"
> +	default y if BR2_PACKAGE_XORG7
> +endchoice

 It looks like this default construct isn't allowed for choices.  So it has
to become:

choice
	prompt "GUI Backend"
	default BR2_PACKAGE_QT_GUI_QWS if !BR2_PACKAGE_XORG7
	default BR2_PACKAGE_QT_GUI_X11 if BR2_PACKAGE_XORG7
...

 Note that I didn't test this, so please check if it does work (i.e. that
you see what you expect when you enable resp. disable XORG7).

[snip]
> diff --git a/package/qt/qt.mk b/package/qt/qt.mk
> index 776eb63..c6fd292 100644
> --- a/package/qt/qt.mk
> +++ b/package/qt/qt.mk
> @@ -220,7 +220,14 @@ else
>  QT_EMB_PLATFORM = generic
>  endif
>  
> +ifeq ($(BR2_PACKAGE_QT_GUI_X11),y)
> +QT_SPEC = linux-g++
> +QT_CONFIGURE_OPTS += -xplatform linux-g++ -arch $(QT_EMB_PLATFORM)

 You will need to add dependencies here.  At least libX11 is required, but
I see a lot more in build/qt-4.8.0/config.tests/x11.

 You have to test this with a clean build of a minimal config, e.g.

BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_QT=y
BR2_PACKAGE_QT_LICENSE_APPROVED=y
# BR2_PACKAGE_QT_XML is not set
# BR2_PACKAGE_QT_SCRIPT is not set
BR2_PACKAGE_XORG7=y

(again, I haven't tested if this config actually works).

 And if you want to be sure you have the dependencies right in the .mk
file, run 'make qt' rather than plain 'make'.


[snip]

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-04 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-04  3:06 [Buildroot] [PATCHv2] qt: X11 support Ismael Luceno
2012-03-04 14:14 ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox