aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0010-Add-external-hostbindir-option-for-native-sdk.patch
blob: 949b323f65c0e2bc931d14ba1e5a215dd9969e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
From 6df8d620081bd78319fc97846e52b1a83042401a Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sat, 6 Apr 2013 13:15:07 +0200
Subject: [PATCH] Add -external-hostbindir option for native(sdk)

* when cross-compiling it's sometimes useful to use existing tools from machine
  (or in OpenEmbedded built with separate native recipe) when building for target

* this way we can skip bootstraping tools we already have

* qt_functions: temporary remove isEmpty check
* now we assume that every build will provide QT_EXTERNAL_HOST_BINS value
* isEmpty works correctly only with qmake variables (e.g. $$FOO -
  isEmpty(FOO)), but doesn't work with system properties like $$[FOO].

* cmake: Use OE_QMAKE_PATH_EXTERNAL_HOST_BINS to determine path to host binaries

Upstream-Status: Pending
  is a lot better for upstreaming (and it was already sort of approved by
  Oswald) but in 5.2.0 I've noticed that he added something similar for
  android builds

Change-Id: I4f6e634bf0b2cb96065ee5c38b9cd8a224c3bd37
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Simon Busch <morphis@gravedo.de>
Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

Conflicts:
        tools/configure/configureapp.cpp
---
 configure                           |  1 +
 qmake/property.cpp                  |  1 +
 src/corelib/global/qlibraryinfo.cpp |  3 ++-
 src/corelib/global/qlibraryinfo.h   |  1 +
 tools/configure/configureapp.cpp    | 11 +++++++++++
 5 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 6abdd6b..7c5a066 100755
--- a/configure
+++ b/configure
@@ -3824,6 +3824,7 @@ fi
 addConfStr "$QT_REL_HOST_BINS"
 addConfStr "$QT_REL_HOST_LIBS"
 addConfStr "$QT_REL_HOST_DATA"
+addConfStr "$QT_EXTERNAL_HOST_BINS"
 addConfStr "$shortxspec"
 addConfStr "$shortspec"
 
diff --git a/qmake/property.cpp b/qmake/property.cpp
index 9ee08f4..e6ecf92 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -63,6 +63,7 @@ static const struct {
     { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
     { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
     { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true },
+    { "QT_EXTERNAL_HOST_BINS", QLibraryInfo::ExternalHostBinariesPath, true },
     { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true },
     { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true },
 };
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index ff65ef9..3726831 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -381,7 +381,7 @@ QLibraryInfo::isDebugBuild()
  */
 
 static const struct {
-    char key[19], value[13];
+    char key[21], value[13];
 } qtConfEntries[] = {
     { "Prefix", "." },
     { "Documentation", "doc" }, // should be ${Data}/doc
@@ -406,6 +406,7 @@ static const struct {
     { "HostBinaries", "bin" },
     { "HostLibraries", "lib" },
     { "HostData", "." },
+    { "ExternalHostBinaries", "" },
     { "TargetSpec", "" },
     { "HostSpec", "" },
     { "HostPrefix", "" },
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 362d47d..a2326e2 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -87,6 +87,7 @@ public:
         HostBinariesPath,
         HostLibrariesPath,
         HostDataPath,
+        ExternalHostBinariesPath,
         TargetSpecPath,
         HostSpecPath,
         HostPrefixPath,
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 7fd0b98..47fa6c3 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -1202,6 +1202,13 @@ void Configure::parseCmdLine()
             dictionary[ "QT_EXT_PREFIX" ] = configCmdLine.at(i);
         }
 
+        else if (configCmdLine.at(i) == "-external-hostbindir") {
+            ++i;
+            if (i == argCount)
+                break;
+            dictionary[ "QT_EXTERNAL_HOST_BINS" ] = configCmdLine.at(i);
+        }
+
         else if (configCmdLine.at(i) == "-make-tool") {
             ++i;
             if (i == argCount)
@@ -4121,6 +4128,9 @@ void Configure::generateQConfigCpp()
 
     if (dictionary["QT_REL_HOST_DATA"].isEmpty())
         dictionary["QT_REL_HOST_DATA"] = haveHpx ? "." : dictionary["QT_REL_INSTALL_ARCHDATA"];
+    
+    if (dictionary["QT_EXTERNAL_HOST_BINS"].isEmpty())
+        dictionary["QT_EXTERNAL_HOST_BINS"] = haveHpx ? "bin" : dictionary["QT_REL_INSTALL_BINS"];
 
     confStringOff = 0;
     addConfStr(0, dictionary["QT_REL_INSTALL_DOCS"]);
@@ -4140,6 +4150,7 @@ void Configure::generateQConfigCpp()
     addConfStr(1, dictionary["QT_REL_HOST_BINS"]);
     addConfStr(1, dictionary["QT_REL_HOST_LIBS"]);
     addConfStr(1, dictionary["QT_REL_HOST_DATA"]);
+    addConfStr(1, dictionary["QT_EXTERNAL_HOST_BINS"]);
     addConfStr(1, targSpec);
     addConfStr(1, hostSpec);