summaryrefslogtreecommitdiffstats
path: root/configure.json
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-11-09 18:00:46 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-09-07 20:02:45 +0200
commit4ac872639ed0dd3ae6627e05bdda821f7d128500 (patch)
treefad45ce520ed8a394c99074505fed54591f68dca /configure.json
parent9a0ef07f154676cfc3b54b2b1042233b27fe8de9 (diff)
Make Qt relocatable
[ChangeLog][QtCore] Qt installations on the host system can now be relocated, i.e. moved to other directories. Add a new feature 'relocatable' that's by default enabled for non-static builds - on platforms where libdl is available, - on macOS when configured with -framework, - on Windows. If the feature is enabled, the directory where plugins, translations and other assets are loaded from is determined by the location of libQt5Core.so and the lib dir (bin dir on Windows) relative to the prefix. For static builds, the feature 'relocatable' is off by default. It can be turned on manually by passing -feature-relocatable to configure. In that case, QLibraryInfo::location(QLibraryInfo::TranslationsPaths) and friends will return paths rooted in the user application's directory. The installed and relocated qmake determines properties like QT_INSTALL_PREFIX and QT_HOST_PREFIX from the location of the qmake executable and the host bin dir relative to the host prefix. This is now always done, independent of the 'relocatable' feature. Note that qmake is currently only relocatable within an environment that has the same layout as the original build machine due to absolute paths to the original prefix in .prl, .pc and .la files. This will be addressed in a separate patch. Task-number: QTBUG-15234 Change-Id: I7319e2856d8fe17f277082d71216442f52580633 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'configure.json')
-rw-r--r--configure.json27
1 files changed, 27 insertions, 0 deletions
diff --git a/configure.json b/configure.json
index 5fc35a1658..13cca852f6 100644
--- a/configure.json
+++ b/configure.json
@@ -222,6 +222,21 @@
{ "type": "pkgConfig", "args": "libudev" },
"-ludev"
]
+ },
+ "libdl": {
+ "label": "dlopen()",
+ "test": {
+ "main": [
+ "dlclose(dlopen(0, 0));",
+ "dlsym(RTLD_DEFAULT, 0);",
+ "dlerror();"
+ ]
+ },
+ "headers": "dlfcn.h",
+ "sources": [
+ "",
+ "-ldl"
+ ]
}
},
@@ -1340,6 +1355,17 @@
"autoDetect": false,
"condition": "!features.shared",
"output": [ "publicConfig", "publicQtConfig" ]
+ },
+ "dlopen": {
+ "label": "dlopen()",
+ "condition": "config.unix && libs.libdl",
+ "output": [ "privateFeature" ]
+ },
+ "relocatable": {
+ "label": "Relocatable",
+ "autoDetect": "features.shared",
+ "condition": "features.dlopen || config.win32 || !features.shared",
+ "output": [ "privateFeature" ]
}
},
@@ -1466,6 +1492,7 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
"args": "enable_gdb_index",
"condition": "config.gcc && !config.clang && (features.debug || features.force_debug_info || features.debug_and_release)"
},
+ "relocatable",
"precompile_header",
"ltcg",
{