Patchwork [1/1,v2] qt4: fix qt4-native build failure on SLED-11

login
register
mail settings
Submitter wenzong.fan@windriver.com
Date Aug. 2, 2012, 1:43 a.m.
Message ID <c7a334ebda86790988cf6c189a37bc5d4a425e63.1343871487.git.wenzong.fan@windriver.com>
Download mbox | patch
Permalink /patch/33623/
State Accepted
Commit bb4b71552da0d1f4396955f35db5819f88a7d2ae
Headers show

Comments

wenzong.fan@windriver.com - Aug. 2, 2012, 1:43 a.m.
From: Wenzong Fan <wenzong.fan@windriver.com>

This issue is that with C++ compiler process an old version of kernel
header file, coincidently that file has a variable named 'new':

* 'embedded/qkbdtty_qws.cpp' include 'linux/vt.h';
* '/usr/include/linux/vt.h' has below code on SLED-11.x:
    + unsigned int new;

On mostly hosts it has been changed to: new -> newev.

[YOCTO #2845]

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
---
 meta/recipes-qt/qt4/files/fix_qkbdtty_qws.patch |   37 +++++++++++++++++++++++
 meta/recipes-qt/qt4/qt4-native.inc              |    6 ++--
 2 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-qt/qt4/files/fix_qkbdtty_qws.patch

Patch

diff --git a/meta/recipes-qt/qt4/files/fix_qkbdtty_qws.patch b/meta/recipes-qt/qt4/files/fix_qkbdtty_qws.patch
new file mode 100644
index 0000000..c2aed5c
--- /dev/null
+++ b/meta/recipes-qt/qt4/files/fix_qkbdtty_qws.patch
@@ -0,0 +1,37 @@ 
+Upstream-Status: Pending
+
+This issue is that with C++ compiler process an old version of kernel
+header file, coincidently that file has a variable named 'new':
+
+* 'embedded/qkbdtty_qws.cpp' include 'linux/vt.h';
+* '/usr/include/linux/vt.h' has below code on SLED-11.x:
+    + unsigned int new;
+
+On mostly hosts it has been changed to: new -> newev.
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+=======================================
+diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
+--- a/src/gui/embedded/qkbdtty_qws.cpp	2012-07-27 13:16:58.420198350 +0800
++++ b/src/gui/embedded/qkbdtty_qws.cpp	2012-07-27 13:24:43.924191127 +0800
+@@ -54,8 +54,20 @@
+ 
+ #if defined Q_OS_LINUX
+ #  include <linux/kd.h>
++
++/* Workaround kernel headers using "new" as variable name. The problem
++ is specific to SLED-11, other distros use "newev" rather than "new" */
++#ifdef __cplusplus
++#warning "workaround kernel headers using new as variable name on SLED 11"
++#define new newev
++#endif
++
+ #  include <linux/vt.h> //TODO: move vt handling somewhere else (QLinuxFbScreen?)
+ 
++#ifdef __cplusplus
++#undef new
++#endif
++
+ #  include "qscreen_qws.h"
+ #  include "qwindowsystem_qws.h"
+ #  include "qapplication.h"
diff --git a/meta/recipes-qt/qt4/qt4-native.inc b/meta/recipes-qt/qt4/qt4-native.inc
index 70adec4..90ea63c 100644
--- a/meta/recipes-qt/qt4/qt4-native.inc
+++ b/meta/recipes-qt/qt4/qt4-native.inc
@@ -9,14 +9,16 @@  LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \
                     file://LICENSE.GPL3;md5=babc5b6b77441da277f5c06b2e547720 \
                     file://LGPL_EXCEPTION.txt;md5=411080a56ff917a5a1aa08c98acae354"
 
-INC_PR = "r14"
+INC_PR = "r15"
 
 inherit native
 
 SRC_URI = "http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${PV}.tar.gz \
            file://qt-config.patch \
            file://g++.conf \
-           file://linux.conf"
+           file://linux.conf \
+           file://fix_qkbdtty_qws.patch \
+	"
 S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
 
 EXTRA_OECONF = "-prefix ${prefix} \