summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-02-15 11:35:53 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-02-16 15:06:26 +0000
commit1aaf45e10680242511c047d84ec4f1c9a86cda7f (patch)
tree5f5869ded6fb0f507751a0285214f27fac66433e /src
parent0f730ef7b6cc9571147e779183b317547011526b (diff)
Eliminate QT_NO_DYNAMIC_LIBRARY
The library feature already covers this. As library depends on the dlopen compile check, we can assume dlopen to be available, also on vxworks. Change-Id: Idcdb07ab4688c6158651d9a5ad5e2ba126bd7d9e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/configure.json4
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp30
2 files changed, 11 insertions, 23 deletions
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 66bf0dac92..76dfed3128 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -211,8 +211,7 @@
},
"dlopen": {
"label": "dlopen()",
- "condition": "tests.dlopen || libs.libdl",
- "output": [ { "type": "define", "negative": true, "name": "QT_NO_DYNAMIC_LIBRARY" } ]
+ "condition": "tests.dlopen || libs.libdl"
},
"libdl": {
"label": "dlopen() in libdl",
@@ -456,6 +455,7 @@
"label": "QLibrary",
"purpose": "Provides a wrapper for dynamically loaded libraries.",
"section": "File I/O",
+ "condition": "config.win32 || config.hpux || (!config.nacl && features.dlopen)",
"output": [ "publicFeature", "feature" ]
},
"settings": {
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 9db0b7ff39..8b16021303 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -50,13 +50,9 @@
# include <private/qcore_mac_p.h>
#endif
-#if (defined(Q_OS_VXWORKS) && !defined(VXWORKS_RTP)) || defined (Q_OS_NACL)
-#define QT_NO_DYNAMIC_LIBRARY
-#endif
-
QT_BEGIN_NAMESPACE
-#if !defined(QT_HPUX_LD) && !defined(QT_NO_DYNAMIC_LIBRARY)
+#if !defined(QT_HPUX_LD)
QT_BEGIN_INCLUDE_NAMESPACE
#include <dlfcn.h>
QT_END_INCLUDE_NAMESPACE
@@ -64,9 +60,7 @@ QT_END_INCLUDE_NAMESPACE
static QString qdlerror()
{
-#if defined(QT_NO_DYNAMIC_LIBRARY)
- const char *err = "This platform does not support dynamic libraries.";
-#elif !defined(QT_HPUX_LD)
+#if !defined(QT_HPUX_LD)
const char *err = dlerror();
#else
const char *err = strerror(errno);
@@ -131,7 +125,6 @@ QStringList QLibraryPrivate::prefixes_sys()
bool QLibraryPrivate::load_sys()
{
QString attempt;
-#if !defined(QT_NO_DYNAMIC_LIBRARY)
QFileSystemEntry fsEntry(fileName);
QString path = fsEntry.path();
@@ -250,7 +243,6 @@ bool QLibraryPrivate::load_sys()
}
}
#endif
-#endif // QT_NO_DYNAMIC_LIBRARY
if (!pHnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName).arg(qdlerror());
}
@@ -263,29 +255,27 @@ bool QLibraryPrivate::load_sys()
bool QLibraryPrivate::unload_sys()
{
-#if !defined(QT_NO_DYNAMIC_LIBRARY)
-# if defined(QT_HPUX_LD)
+#if defined(QT_HPUX_LD)
if (shl_unload((shl_t)pHnd)) {
-# else
+#else
if (dlclose(pHnd)) {
-# endif
-# if defined (Q_OS_QNX) // Workaround until fixed in QNX; fixes crash in
+#endif
+#if defined (Q_OS_QNX) // Workaround until fixed in QNX; fixes crash in
char *error = dlerror(); // QtDeclarative auto test "qqmlenginecleanup" for instance
if (!qstrcmp(error, "Shared objects still referenced")) // On QNX that's only "informative"
return true;
errorString = QLibrary::tr("Cannot unload library %1: %2").arg(fileName)
.arg(QLatin1String(error));
-# else
+#else
errorString = QLibrary::tr("Cannot unload library %1: %2").arg(fileName).arg(qdlerror());
-# endif
+#endif
return false;
}
-#endif
errorString.clear();
return true;
}
-#if defined(Q_OS_LINUX) && !defined(QT_NO_DYNAMIC_LIBRARY)
+#if defined(Q_OS_LINUX)
Q_CORE_EXPORT QFunctionPointer qt_linux_find_symbol_sys(const char *symbol)
{
return QFunctionPointer(dlsym(RTLD_DEFAULT, symbol));
@@ -305,8 +295,6 @@ QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
QFunctionPointer address = 0;
if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
address = 0;
-#elif defined (QT_NO_DYNAMIC_LIBRARY)
- QFunctionPointer address = 0;
#else
QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol));
#endif