From a08e167d51c33f91009ba27adaa083c783c1ac54 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Mon, 15 Apr 2013 04:29:32 +0200
Subject: [PATCH] Add linux-oe-g++ platform

* This qmake.conf unlike other platforms reads most variables from
  shell environment, because it's easier for qt recipes to export
  *FLAGS or CC specific for given recipe

Upstream-Status: Inappropriate [embedded specific]
                 too OE specific, probably cannot be upstreamed

Change-Id: I0591ed5da0d61d7cf1509d420e6b293582f1863c
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

---
 mkspecs/features/qt.prf              |  6 ++---
 mkspecs/features/qt_functions.prf    |  4 +--
 mkspecs/linux-oe-g++/qmake.conf      | 38 ++++++++++++++++++++++++++++
 mkspecs/linux-oe-g++/qplatformdefs.h |  1 +
 mkspecs/oe-device-extra.pri          |  0
 5 files changed, 44 insertions(+), 5 deletions(-)
 create mode 100644 mkspecs/linux-oe-g++/qmake.conf
 create mode 100644 mkspecs/linux-oe-g++/qplatformdefs.h
 create mode 100644 mkspecs/oe-device-extra.pri

diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 3c4b284b68..a7545ace5c 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -164,7 +164,7 @@ import_plugins {
             plug_name = $$QMAKE_PREFIX_STATICLIB$${plug}$$qtPlatformTargetSuffix($$config_variable).$$QMAKE_EXTENSION_STATICLIB
             plug_path = $$eval(QT_PLUGIN.$${plug}.PATH)
             isEmpty(plug_path): \
-                plug_path = $$[QT_INSTALL_PLUGINS/get]
+                plug_path = $$[QT_INSTALL_PLUGINS]
             LIBS += $$plug_path/$$plug_type/$$plug_name
         } else {
             LIBS += -l$${plug}$$qtPlatformTargetSuffix(CONFIG)
@@ -319,8 +319,8 @@ for(ever) {
 # static builds: link qml import plugins into the target.
 contains(all_qt_module_deps, qml): \
         qtConfig(static):import_plugins:!host_build:!no_import_scan {
-    exists($$[QT_INSTALL_QML/get]): \
-        QMLPATHS *= $$[QT_INSTALL_QML/get]
+    exists($$[QT_INSTALL_QML]): \
+        QMLPATHS *= $$[QT_INSTALL_QML]
 
     # run qmlimportscanner
     qtPrepareLibExecTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index f1371c8cc6..84cbf4a476 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -95,7 +95,7 @@ defineTest(qtPrepareTool) {
     cmd = $$eval(QT_TOOL.$${2}.binary)
     isEmpty(cmd) {
         isEmpty(5) {
-            instloc = $$[QT_HOST_BINS]
+            instloc = $$[QT_HOST_BINS/get]
         } else {
             instloc = $$5
         }
@@ -140,7 +140,7 @@ defineTest(qtPrepareTool) {
 # Forwards its arguments to qtPrepareTool but defaults the installation location to
 # $$[QT_HOST_LIBEXECS]
 defineTest(qtPrepareLibExecTool) {
-    isEmpty(instloc): instloc = "$$[QT_HOST_LIBEXECS]"
+    isEmpty(instloc): instloc = "$$[QT_HOST_LIBEXECS/get]"
     qtPrepareTool($$1, $$2, $$3, $$4, $$instloc)
 }
 
diff --git a/mkspecs/linux-oe-g++/qmake.conf b/mkspecs/linux-oe-g++/qmake.conf
new file mode 100644
index 0000000000..99ff3741d3
--- /dev/null
+++ b/mkspecs/linux-oe-g++/qmake.conf
@@ -0,0 +1,38 @@
+#
+# qmake configuration for linux-g++ with modifications for building with OpenEmbedded
+#
+
+MAKEFILE_GENERATOR = UNIX
+CONFIG += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(../common/linux.conf)
+
+QMAKE_AR              = $$(OE_QMAKE_AR) cqs
+QMAKE_STRIP           = $$(OE_QMAKE_STRIP)
+QMAKE_OBJCOPY         = $$(OE_QMAKE_OBJCOPY)
+
+include(../common/gcc-base-unix.conf)
+
+# *FLAGS from gcc-base.conf
+QMAKE_CFLAGS                += $$(OE_QMAKE_CFLAGS)
+QMAKE_CXXFLAGS              += $$(OE_QMAKE_CXXFLAGS)
+QMAKE_LFLAGS                += $$(OE_QMAKE_LDFLAGS)
+
+include(../common/g++-unix.conf)
+
+# tc settings from g++-base.conf
+QMAKE_CC       = $$(OE_QMAKE_CC)
+QMAKE_CXX      = $$(OE_QMAKE_CXX)
+
+QMAKE_LINK         = $$(OE_QMAKE_LINK)
+QMAKE_LINK_SHLIB   = $$(OE_QMAKE_LINK)
+QMAKE_LINK_C       = $$(OE_QMAKE_LINK)
+QMAKE_LINK_C_SHLIB = $$(OE_QMAKE_LINK)
+
+QMAKE_AR_LTCG      = $$(OE_QMAKE_AR_LTCG) cqs
+
+include(../oe-device-extra.pri)
+
+load(device_config)
+load(qt_config)
diff --git a/mkspecs/linux-oe-g++/qplatformdefs.h b/mkspecs/linux-oe-g++/qplatformdefs.h
new file mode 100644
index 0000000000..5d22fb4101
--- /dev/null
+++ b/mkspecs/linux-oe-g++/qplatformdefs.h
@@ -0,0 +1 @@
+#include "../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/oe-device-extra.pri b/mkspecs/oe-device-extra.pri
new file mode 100644
index 0000000000..e69de29bb2
