Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 5/9] Support for compiling Qt for X11
  2011-10-14 14:51 [Buildroot] [PATHC 0/9] Miscellaneous patch series Will Wagner
@ 2011-10-14 14:51 ` Will Wagner
  0 siblings, 0 replies; 2+ messages in thread
From: Will Wagner @ 2011-10-14 14:51 UTC (permalink / raw)
  To: buildroot

This patch enables you to cross compile the X11 version of Qt. Although cross compilation of Qt is not officially supported it works well and allows Qt to be build for a target running X11

Signed-off-by: Will Wagner <will_wagner@carallon.com>
---
 package/qt/Config.in |   12 ++++++++++++
 package/qt/qt.mk     |   44 +++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 51 insertions(+), 5 deletions(-)

diff --git a/package/qt/Config.in b/package/qt/Config.in
index ab231d9..513f135 100644
--- a/package/qt/Config.in
+++ b/package/qt/Config.in
@@ -11,6 +11,14 @@ menuconfig BR2_PACKAGE_QT
 
 if BR2_PACKAGE_QT
 
+comment "Qt will be built for use with an X server"
+	depends on BR2_PACKAGE_XSERVER_XORG_SERVER
+
+config BR2_PACKAGE_QT_X11
+	bool
+	depends on BR2_PACKAGE_XSERVER_XORG_SERVER
+	default y
+
 config BR2_PACKAGE_QT_DEBUG
 	bool "Compile with debug support"
 	help
@@ -85,6 +93,7 @@ config BR2_PACKAGE_QT_GUI_MODULE
 	  video output, or you don't require Qt GUI, say n.
 
 if BR2_PACKAGE_QT_GUI_MODULE
+if !BR2_PACKAGE_QT_X11
 menu "Pixel depths"
 comment "Deselecting each option leads to Qt's default (8,16,32)"
 
@@ -165,6 +174,7 @@ config BR2_PACKAGE_QT_SYSTEMFREETYPE
 	  Use shared libfreetype from the target system.
 	  See http://www.freetype.org/
 endchoice
+endif # !BR2_PACKAGE_QT_X11
 
 config BR2_PACKAGE_QT_GIF
 	bool "Enable GIF support"
@@ -255,9 +265,11 @@ endchoice
 
 source "package/qt/Config.sql.in"
 if BR2_PACKAGE_QT_GUI_MODULE
+if !BR2_PACKAGE_QT_X11
 source "package/qt/Config.gfx.in"
 source "package/qt/Config.mouse.in"
 source "package/qt/Config.keyboard.in"
+endif # !BR2_PACKAGE_QT_X11
 
 config BR2_PACKAGE_QT_PHONON
 	bool "Phonon Module"
diff --git a/package/qt/qt.mk b/package/qt/qt.mk
index cc035bf..a36fcb6 100644
--- a/package/qt/qt.mk
+++ b/package/qt/qt.mk
@@ -96,6 +96,10 @@ ifneq ($(QT_PIXEL_DEPTHS),)
 QT_CONFIGURE_OPTS += -depths $(subst $(space),$(comma),$(strip $(QT_PIXEL_DEPTHS)))
 endif
 
+ifneq ($(BR2_PACKAGE_QT_X11),y)
+### Embedded options
+QT_CONFIGURE_OPTS += -no-gfx-qnx -no-kbd-qnx -no-mouse-qnx
+
 ### Display drivers
 ifeq ($(BR2_PACKAGE_QT_GFX_LINUXFB),y)
 QT_CONFIGURE_OPTS += -qt-gfx-linuxfb
@@ -129,7 +133,6 @@ else
 QT_CONFIGURE_OPTS += -no-gfx-directfb
 endif
 
-
 ### Mouse drivers
 ifeq ($(BR2_PACKAGE_QT_MOUSE_PC),y)
 QT_CONFIGURE_OPTS += -qt-mouse-pc
@@ -178,6 +181,11 @@ else
 QT_CONFIGURE_OPTS += -no-kbd-qvfb
 endif
 
+else
+### X11 options
+QT_CONFIGURE_OPTS += -no-gtkstyle -no-opengl -no-openvg -no-glib --disable-script
+endif
+
 ifeq ($(BR2_PACKAGE_QT_DEBUG),y)
 QT_CONFIGURE_OPTS += -debug
 else
@@ -216,7 +224,12 @@ else
 QT_EMB_PLATFORM = generic
 endif
 
+ifneq ($(BR2_PACKAGE_QT_X11),y)
 QT_CONFIGURE_OPTS += -embedded $(QT_EMB_PLATFORM)
+else
+QT_CONFIGURE_OPTS += -xplatform linux-$(QT_EMB_PLATFORM)-g++ -arch i386
+QT_DEPENDENCIES   += xserver_xorg-server
+endif
 
 ifneq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
 QT_CONFIGURE_OPTS += -no-gui
@@ -415,6 +428,12 @@ else
 QT_CONFIGURE_OPTS += -no-declarative
 endif
 
+ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA),y)
+QT_CONFIGURE_OPTS += -xinerama
+else
+QT_CONFIGURE_OPTS += -no-xinerama
+endif
+
 # ccache and precompiled headers don't play well together
 ifeq ($(BR2_CCACHE),y)
 QT_CONFIGURE_OPTS += -no-pch
@@ -431,7 +450,11 @@ endif
 # End of workaround.
 
 # Variable for other Qt applications to use
+ifneq ($(BR2_PACKAGE_QT_X11),y)
 QT_QMAKE:=$(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
+else
+QT_QMAKE:=$(HOST_DIR)/usr/bin/qmake -spec linux-$(QT_EMB_PLATFORM)-g++
+endif
 
 ################################################################################
 # QT_QMAKE_SET -- helper macro to set QMAKE_<variable> = <value> in
@@ -445,10 +468,24 @@ QT_QMAKE:=$(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
 # E.G. use like this:
 # $(call QT_QMAKE_SET,variable,value,directory)
 ################################################################################
+ifneq ($(BR2_PACKAGE_QT_X11),y)
 define QT_QMAKE_SET
 	$(SED) '/QMAKE_$(1)/d' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
 	$(SED) '/include.*qws.conf/aQMAKE_$(1) = $(2)' $(3)/mkspecs/qws/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
 endef
+else
+define QT_QMAKE_SET
+	$(SED) '/QMAKE_$(1)/d' $(3)/mkspecs/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
+	$(SED) '/include.*linux.conf/aQMAKE_$(1) = $(2)' $(3)/mkspecs/linux-$(QT_EMB_PLATFORM)-g++/qmake.conf
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_QT_X11),y)
+define QT_CONFIGURE_MKSPECS
+	cp -R $(@D)/mkspecs/linux-g++ $(@D)/mkspecs/linux-$(QT_EMB_PLATFORM)-g++
+	$(call QT_QMAKE_SET,INCDIR_X11,$(STAGING_DIR)/usr/X11R6/include,$(@D))
+endef
+endif
 
 ifneq ($(BR2_INET_IPV6),y)
 define QT_CONFIGURE_IPV6
@@ -465,6 +502,7 @@ endif
 
 define QT_CONFIGURE_CMDS
 	-[ -f $(@D)/Makefile ] && $(MAKE) -C $(@D) confclean
+	$(QT_CONFIGURE_MKSPECS)
 	$(QT_CONFIGURE_IPV6)
 	$(QT_CONFIGURE_CONFIG_FILE)
 	# Fix compiler path
@@ -489,10 +527,6 @@ define QT_CONFIGURE_CMDS
 		$(if $(VERBOSE),-verbose,-silent) \
 		-force-pkg-config \
 		$(QT_CONFIGURE_OPTS) \
-		-no-gfx-qnx \
-		-no-kbd-qnx \
-		-no-mouse-qnx \
-		-no-xinerama \
 		-no-cups \
 		-no-nis \
 		-no-accessibility \
-- 
1.7.2.5

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

* [Buildroot] [PATCH 5/9] Support for compiling Qt for X11
@ 2011-10-17  9:02 Arnout Vandecappelle
  0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2011-10-17  9:02 UTC (permalink / raw)
  To: buildroot



On Friday 14 October 2011 16:51:57, Will Wagner wrote:
[snip]
> diff --git a/package/qt/qt.mk b/package/qt/qt.mk
> index cc035bf..a36fcb6 100644
> --- a/package/qt/qt.mk
> +++ b/package/qt/qt.mk
> @@ -96,6 +96,10 @@ ifneq ($(QT_PIXEL_DEPTHS),)
>  QT_CONFIGURE_OPTS += -depths $(subst $(space),$(comma),$(strip $(QT_PIXEL_DEPTHS)))
>  endif
>  
> +ifneq ($(BR2_PACKAGE_QT_X11),y)
> +### Embedded options
> +QT_CONFIGURE_OPTS += -no-gfx-qnx -no-kbd-qnx -no-mouse-qnx
> +
>  ### Display drivers
>  ifeq ($(BR2_PACKAGE_QT_GFX_LINUXFB),y)
>  QT_CONFIGURE_OPTS += -qt-gfx-linuxfb
> @@ -129,7 +133,6 @@ else
>  QT_CONFIGURE_OPTS += -no-gfx-directfb
>  endif
>  
> -
>  ### Mouse drivers
>  ifeq ($(BR2_PACKAGE_QT_MOUSE_PC),y)
>  QT_CONFIGURE_OPTS += -qt-mouse-pc
> @@ -178,6 +181,11 @@ else
>  QT_CONFIGURE_OPTS += -no-kbd-qvfb
>  endif
>  
> +else
> +### X11 options
> +QT_CONFIGURE_OPTS += -no-gtkstyle -no-opengl -no-openvg -no-glib --disable-script
> +endif
> +

 It's a matter of taste, but I prefer the small branch of a condition to be
at the top.  So
ifeq ($(BR2_PACKAGE_QT_X11),y)
### X11 options
QT_CONFIGURE_OPTS += -no-gtkstyle -no-opengl -no-openvg -no-glib --disable-script
else
...
endif # BR2_PACKAGE_QT_X11

>  ifeq ($(BR2_PACKAGE_QT_DEBUG),y)
>  QT_CONFIGURE_OPTS += -debug
>  else
> @@ -216,7 +224,12 @@ else
>  QT_EMB_PLATFORM = generic
>  endif
>  
> +ifneq ($(BR2_PACKAGE_QT_X11),y)
>  QT_CONFIGURE_OPTS += -embedded $(QT_EMB_PLATFORM)
> +else
> +QT_CONFIGURE_OPTS += -xplatform linux-$(QT_EMB_PLATFORM)-g++ -arch i386

 Does this really only work for i386?  In that case, add a condition on
BR2_ARCH to BR2_PACKAGE_QT_X11 in Config.in.  Else, use BR2_ARCH here
(and compile-test for some other platforms).

> +QT_DEPENDENCIES   += xserver_xorg-server

 This was just discussed on the list :-)  Qt-X11 probably doesn't really
depend on the Xserver, only on libX11 and libXinerama and perhaps others.

[snip]

 Otherwise, it does look good.


 Regards,
 Arnout
-- 
Arnout Vandecappelle                            arnout at mind be
Senior Embedded Software Architect              +32-16-286540  +32-478-010353
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:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43



-- 
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:  31BB CF53 8660 6F88 345D  54CC A836 5879 20D7 CF43

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

end of thread, other threads:[~2011-10-17  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17  9:02 [Buildroot] [PATCH 5/9] Support for compiling Qt for X11 Arnout Vandecappelle
  -- strict thread matches above, loose matches on Subject: below --
2011-10-14 14:51 [Buildroot] [PATHC 0/9] Miscellaneous patch series Will Wagner
2011-10-14 14:51 ` [Buildroot] [PATCH 5/9] Support for compiling Qt for X11 Will Wagner

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