aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-5.0.2/0009-qt_module-Fix-paths-in-.prl-files.patch
blob: b7f648394a742854e764a70e6f03b61a03c27a30 (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
From a70d48880e27586efe5f6aa195385207abf3cead Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sun, 28 Apr 2013 12:56:55 +0200
Subject: [PATCH 09/16] qt_module: Fix paths in .prl files

* qmake does not prefix them with QT_SYSROOT when using them
  so e.g. when building qtdeclarative we get -L/usr/lib to LINKAGE
  variable, which is unsafe for cross-compilation
* writting QT_SYSROOT in .prl files is dangerous for sstate when
  builds are in different directories, so we need
  SSTATE_SCAN_FILES += "*.pri *.prl"
  to make them relocateble

Upstream-Status: Pending

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 mkspecs/features/qt_module.prf | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 7fbfd8d..226119f 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -132,17 +132,23 @@ unix|win32-g++* {
    pkgconfig_include_replace.replace = "\$$\\{includedir}"
    pkgconfig_lib_replace.match = $$rplbase/lib
    pkgconfig_lib_replace.replace = "\$$\\{libdir}"
-   include_replace.match = $$rplbase/include
-   include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
-   lib_replace.match = $$rplbase/lib
-   lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
-   lafile_replace.match = $$rplbase
-   lafile_replace.replace = "=$$[QT_INSTALL_PREFIX/raw]"
-
-   !isEmpty(SYSROOT): \
-      rplbase = $$[SYSROOT] \
-      lafile_replace.match = $$rplbase \
-      lafile_replace.replace = "=" \
+   !exists($$[QT_SYSROOT]) {
+      include_replace.match = $$rplbase/include
+      include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
+      lib_replace.match = $$rplbase/lib
+      lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
+      lafile_replace.match = $$rplbase
+      lafile_replace.replace = "$$[QT_INSTALL_PREFIX/raw]"
+   } else {
+      # include_replace and lib_replace are duplicate, but we don't want to
+      # make QMAKE_PKGCONFIG_INSTALL_REPLACE, QMAKE_PRL_INSTALL_REPLACE conditional
+      include_replace.match = $$rplbase
+      include_replace.replace = $$[QT_SYSROOT]$$[QT_INSTALL_PREFIX/raw]
+      lib_replace.match = $$rplbase
+      lib_replace.replace = $$[QT_SYSROOT]$$[QT_INSTALL_PREFIX/raw]
+      lafile_replace.match = $$rplbase
+      lafile_replace.replace = "=$$[QT_INSTALL_PREFIX/raw]"
+   }
 
    QMAKE_PKGCONFIG_INSTALL_REPLACE += pkgconfig_include_replace pkgconfig_lib_replace
    QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
-- 
1.8.2.1