Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Fix to Qt5base-build
@ 2013-09-17  7:37 Espen Frimann Koren
  2013-09-17  9:53 ` [Buildroot] [PATCH v1] Fix EGL support in qt5base Jérôme Pouiller
  0 siblings, 1 reply; 6+ messages in thread
From: Espen Frimann Koren @ 2013-09-17  7:37 UTC (permalink / raw)
  To: buildroot

Hi.

I have found a solution to why Qt5 does not find either OpenGL ES2 or EGL
during configuration.

In the file package/qt5/qt5base/qt5base-mkspecs-files.patch, two files are
created in output/build/qt5base-5.0.2/mkspecs/devices/linux-buildroot-g++.
In my opinion the following lines must be included in the file (from the
patch):

QMAKE_LIBS_EGL         += -lEGL
QMAKE_LIBS_OPENGL_ES2  += -lEGL -lGAL

QMAKE_CFLAGS           += -DEGL_API_FB=1
QMAKE_CXXFLAGS         += -DEGL_API_FB=1
QMAKE_CFLAGS_DEBUG     += -DEGL_API_FB=1
QMAKE_CXXFLAGS_DEBUG   += -DEGL_API_FB=1

I cannot commit to the buildroot tree, so someone have to do this. There
are other issues in the corresponding file in
output/build/qt5base-5.0.2/mkspecs/devices/linux-imx6-g++/qmake.conf, which
is provided by Qt themselves, that may need to be taken into consideration,
for instance

EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp

Maybe there should be possible to select Qt device mkspec in the make
menuconfig-system?

Sp1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130917/c46171b6/attachment.html>

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

* [Buildroot] [PATCH v1] Fix EGL support in qt5base
  2013-09-17  7:37 [Buildroot] Fix to Qt5base-build Espen Frimann Koren
@ 2013-09-17  9:53 ` Jérôme Pouiller
  2013-09-17 11:35   ` Fatih Aşıcı
  2013-09-17 18:33   ` Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Jérôme Pouiller @ 2013-09-17  9:53 UTC (permalink / raw)
  To: buildroot

For many EGL libraries, Qt5 need special instructions to compile correctly. 
This patch implement a more generic way to customize Qt5 compilation.

In add, it fix support for Rasberry Pi and Vivante GPUs.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---

 You may try this patch. I have not yet added/tested support for Omap and 
 Mali, but it should work imx6.


 ...nce-add-egl-to-CONFIG-to-get-correct-incl.patch |   32 --------------------
 package/qt5/qt5base/qt5base-mkspecs-files.patch    |    2 +-
 package/qt5/qt5base/qt5base.mk                     |   29 +++++++++++++++---
 3 files changed, 26 insertions(+), 37 deletions(-)
 delete mode 100644 package/qt5/qt5base/qt5base-eglconvenience-add-egl-to-CONFIG-to-get-correct-incl.patch

diff --git a/package/qt5/qt5base/qt5base-eglconvenience-add-egl-to-CONFIG-to-get-correct-incl.patch b/package/qt5/qt5base/qt5base-eglconvenience-add-egl-to-CONFIG-to-get-correct-incl.patch
deleted file mode 100644
index a85a5aa..0000000
--- a/package/qt5/qt5base/qt5base-eglconvenience-add-egl-to-CONFIG-to-get-correct-incl.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 588c60d0c3d11e79d19860fa62b03c935658d13a Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Date: Sun, 13 Jan 2013 14:36:48 +0100
-Subject: [PATCH qtbase] eglconvenience: add egl to CONFIG to get correct include
- paths
-
-The eglconvenience code includes <EGL/egl.h>. Therefore, it should get
-the appropriate EGL-specific include paths from QMAKE_INCDIR_EGL,
-otherwise the build might if the EGL library has its headers in
-special locations. In order to achieve this, we simply add the "egl"
-feature to the list of features imported by eglconvenience.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- .../eglconvenience/eglconvenience.pri              |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
-index 188eb1c..8996cea 100644
---- a/src/platformsupport/eglconvenience/eglconvenience.pri
-+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
-@@ -5,6 +5,7 @@ contains(QT_CONFIG,egl) {
-     SOURCES += \
-         $$PWD/qeglconvenience.cpp \
-         $$PWD/qeglplatformcontext.cpp
-+    CONFIG += egl
- 
-     contains(QT_CONFIG,xlib) {
-         HEADERS += \
--- 
-1.7.9.5
-
diff --git a/package/qt5/qt5base/qt5base-mkspecs-files.patch b/package/qt5/qt5base/qt5base-mkspecs-files.patch
index bfa9c15..2669c2c 100644
--- a/package/qt5/qt5base/qt5base-mkspecs-files.patch
+++ b/package/qt5/qt5base/qt5base-mkspecs-files.patch
@@ -52,7 +52,7 @@ Index: b/mkspecs/devices/linux-buildroot-g++/qmake.conf
 +QMAKE_LIBS             += -lrt -lpthread -ldl
 +
 +# device specific glue code
-+EGLFS_PLATFORM_HOOKS_SOURCES =
++include(qmake-extra-conf.conf)
 +
 +# Sanity check
 +deviceSanityCheckCompiler()
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 1686dad..41d7dfa 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -99,8 +99,30 @@ ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
 ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
-QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES = \
-	$(@D)/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
+define QT5BASE_EXTRA_OPTIONS
+EGLFS_PLATFORM_HOOKS_SOURCES = \
+	$(@D)/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp  \n\
+INCLUDEPATH += \
+	$(STAGING_DIR)/usr/include/interface/vcos/pthreads          \n
+endef
+else ifeq ($(BR2_PACKAGE_GPU_VIV_BIN_MX6Q)x$(BR2_PACKAGE_XORG7),yx)
+define QT5BASE_EXTRA_OPTIONS
+EGLFS_PLATFORM_HOOKS_SOURCES = \
+	$(@D)/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp   \n\
+QMAKE_CFLAGS += -DEGL_API_FB=1                                      \n\
+QMAKE_CXXFLAGS += -DEGL_API_FB=1                                    \n\
+QMAKE_LIBS_OPENGL_ES2 += -lEGL -lGAL                                \n\
+QMAKE_LIBS_OPENVG += -lEGL -lGAL                                    \n
+endef
+else ifeq ($(BR2_PACKAGE_GPU_VIV_BIN_MX6Q)x$(BR2_PACKAGE_XORG7),yxy)
+error("GPU_VIV_BIN_MX6Q + XORG7 + qt5 w/ eglfs is known to be broken.")
+define QT5BASE_EXTRA_OPTIONS
+# Notice this configuration is broken since eglvivante.h include    \n\
+# Xlib.h and Xlib.h defines tons of macros which conflict with Qt5  \n\
+# compilation                                                       \n\
+QMAKE_LIBS_OPENGL_ES2 += -lEGL -lGAL                                \n\
+QMAKE_LIBS_OPENVG += -lEGL -lGAL                                    \n
+endef
 endif
 else
 QT5BASE_CONFIGURE_OPTS += -no-opengl -no-eglfs
@@ -154,8 +176,7 @@ define QT5BASE_CONFIGURE_CMDS
 	$(call QT5BASE_CONFIG_SET,BUILDROOT_COMPILER_CFLAGS,$(TARGET_CFLAGS))
 	$(call QT5BASE_CONFIG_SET,BUILDROOT_COMPILER_CXXFLAGS,$(TARGET_CXXFLAGS))
 	$(call QT5BASE_CONFIG_SET,BUILDROOT_INCLUDE_PATH,$(STAGING_DIR)/usr/include)
-	$(call QT5BASE_CONFIG_SET,EGLFS_PLATFORM_HOOKS_SOURCES, \
-		$(QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES))
+	printf '$(QT5BASE_EXTRA_OPTIONS)' > $(@D)/mkspecs/devices/linux-buildroot-g++/qmake-extra-conf.conf
 	(cd $(@D); \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
 		PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
-- 
1.7.9.5

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

* [Buildroot] [PATCH v1] Fix EGL support in qt5base
  2013-09-17  9:53 ` [Buildroot] [PATCH v1] Fix EGL support in qt5base Jérôme Pouiller
@ 2013-09-17 11:35   ` Fatih Aşıcı
  2013-09-17 18:33   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Fatih Aşıcı @ 2013-09-17 11:35 UTC (permalink / raw)
  To: buildroot

Hi,

On Tue, 2013-09-17 at 11:53 +0200, J?r?me Pouiller wrote:
> +else ifeq ($(BR2_PACKAGE_GPU_VIV_BIN_MX6Q)x$(BR2_PACKAGE_XORG7),yx)
> +define QT5BASE_EXTRA_OPTIONS
> +EGLFS_PLATFORM_HOOKS_SOURCES = \
> +	$(@D)/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp   \n\
> +QMAKE_CFLAGS += -DEGL_API_FB=1                                      \n\
> +QMAKE_CXXFLAGS += -DEGL_API_FB=1                                    \n\
> +QMAKE_LIBS_OPENGL_ES2 += -lEGL -lGAL                                \n\
> +QMAKE_LIBS_OPENVG += -lEGL -lGAL                                    \n

Hardcoding device specific code in qt5base.mk is not nice; but it seems
impossible to get rid of them since qt needs a platform hook path.

I have sent a patch to the list which adds .pc files to gpu-viv-bin-mx6q
package. This helps qt5 to get needed flags; but for the platform
hook .mk file still needs to be modified.

I have also sent a bug report[1] to qt developers for another file with
hardcoded EGL flags.

[1] https://bugreports.qt-project.org/browse/QTBUG-33494

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

* [Buildroot] [PATCH v1] Fix EGL support in qt5base
  2013-09-17  9:53 ` [Buildroot] [PATCH v1] Fix EGL support in qt5base Jérôme Pouiller
  2013-09-17 11:35   ` Fatih Aşıcı
@ 2013-09-17 18:33   ` Thomas Petazzoni
  2013-09-18 11:13     ` Jérôme Pouiller
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2013-09-17 18:33 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Tue, 17 Sep 2013 11:53:09 +0200, J?r?me Pouiller wrote:
> For many EGL libraries, Qt5 need special instructions to compile correctly. 
> This patch implement a more generic way to customize Qt5 compilation.
> 
> In add, it fix support for Rasberry Pi and Vivante GPUs.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

I'm sorry, but this really looks ugly, and doesn't seem needed at all.
We already have a working solution for this problem (which we already
had for the RPi, and we solved in a much nicer way I believe) :

 (1) The OpenGL implementation should install proper pkg-config files
     to allow Qt5 to get the right compilation flags/libraries. See the
     "gpu-viv-bin-mx6q: add pkgconfig files for EGL and OpenGLESv2"
     patch that Fatih has sent today.

 (2) We already have a mechanism in qt5.mk to customize the EGL
     platform hook implementation. It just need to be extended to cover
     the i.MX6 case. I.e, next to:

ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES = \
        $(@D)/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
endif

     one should add:

ifeq ($(BR2_PACKAGE_GPU_VIV_BIN_MX6Q),y)
QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES = \
	$(@D)/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp
endif

If someone makes a patch with both of these changes, then it'll have my
Acked-by.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

* [Buildroot] [PATCH v1] Fix EGL support in qt5base
  2013-09-17 18:33   ` Thomas Petazzoni
@ 2013-09-18 11:13     ` Jérôme Pouiller
  2013-09-18 16:27       ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Jérôme Pouiller @ 2013-09-18 11:13 UTC (permalink / raw)
  To: buildroot

On 2013-09-17 20:33, Thomas Petazzoni wrote:
> Dear J?r?me Pouiller,
>
> On Tue, 17 Sep 2013 11:53:09 +0200, J?r?me Pouiller wrote:
>> For many EGL libraries, Qt5 need special instructions to compile 
>> correctly.
>> This patch implement a more generic way to customize Qt5 
>> compilation.
>>
>> In add, it fix support for Rasberry Pi and Vivante GPUs.
>>
>> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
>
> I'm sorry, but this really looks ugly.
I agree :-)

In fact, I mainly  wrote this patch as a work around for  one of my 
imx6
compilations. I sent it only because Espen seemed to have same issue.

> and doesn't seem needed at all.
> We already have a working solution for this problem (which we already
> had for the RPi, and we solved in a much nicer way I believe) :
>
>  (1) The OpenGL implementation should install proper pkg-config files
>      to allow Qt5 to get the right compilation flags/libraries. See 
> the
>      "gpu-viv-bin-mx6q: add pkgconfig files for EGL and OpenGLESv2"
>      patch that Fatih has sent today.
100% agree

>  (2) We already have a mechanism in qt5.mk to customize the EGL
>      platform hook implementation. It just need to be extended to 
> cover
>      the i.MX6 case. I.e, next to:
>
> ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
> QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES = \
>         $(@D)/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
> endif
>
>      one should add:
>
> ifeq ($(BR2_PACKAGE_GPU_VIV_BIN_MX6Q),y)
> QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES = \
> 	$(@D)/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp
> endif
My idea  was QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES may not  be 
sufficient
to  support all  future cases  and we  may have  a more  generic way  
to
customize qmake.conf. But I am agree, this case is not yet arrived.


-- 
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr

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

* [Buildroot] [PATCH v1] Fix EGL support in qt5base
  2013-09-18 11:13     ` Jérôme Pouiller
@ 2013-09-18 16:27       ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2013-09-18 16:27 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Wed, 18 Sep 2013 13:13:57 +0200, J?r?me Pouiller wrote:

> > I'm sorry, but this really looks ugly.
> I agree :-)
> 
> In fact, I mainly  wrote this patch as a work around for  one of my 
> imx6
> compilations. I sent it only because Espen seemed to have same issue.

Ok, no problem :)

> > ifeq ($(BR2_PACKAGE_GPU_VIV_BIN_MX6Q),y)
> > QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES = \
> > 	$(@D)/mkspecs/devices/linux-imx6-g++/qeglfshooks_imx6.cpp
> > endif
> My idea  was QT5BASE_EGLFS_PLATFORM_HOOKS_SOURCES may not  be 
> sufficient
> to  support all  future cases  and we  may have  a more  generic way  
> to
> customize qmake.conf. But I am agree, this case is not yet arrived.

Of course, this might happen, but until that happens, let's not plan
something in advance without having any idea of what will exactly
happen :-)

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

end of thread, other threads:[~2013-09-18 16:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17  7:37 [Buildroot] Fix to Qt5base-build Espen Frimann Koren
2013-09-17  9:53 ` [Buildroot] [PATCH v1] Fix EGL support in qt5base Jérôme Pouiller
2013-09-17 11:35   ` Fatih Aşıcı
2013-09-17 18:33   ` Thomas Petazzoni
2013-09-18 11:13     ` Jérôme Pouiller
2013-09-18 16:27       ` Thomas Petazzoni

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