From 0d7ed8f5f3b8a308c495c71c7427b41157d769b1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 10 Feb 2017 17:39:47 +0100 Subject: streamline libdl detection and linking instead of having a library and a test, use a library with two sources, the first being empty (i.e., just libc). this allows us doing away with the "libdl" feature, and using just the "dlopen" one. subsequently, replace all LIBS+=$$QMAKE_LIBS_DYNLOAD with QMAKE_USE+=libdl. the definitions of QMAKE_LIBS_DYNLOAD remain in the qmakespecs for backwards compat only. n.b.: the only specs where it is not empty or "-ldl" (i.e., what we support now) are the hpux ones, where the library is called 'dld'. technically, the "library" feature should depend on '!unix || dlopen', but that's for a later patch. Change-Id: Ib8546affc4b7bc757f1a76729573ddd00e152176 Reviewed-by: Lars Knoll Reviewed-by: Ulf Hermann --- src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 4 ++-- src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/xcb/gl_integrations/xcb_glx') diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index 1f36a1ad2a..56b2b1fd23 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -54,7 +54,7 @@ #include #include -#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4) +#if !defined(QT_STATIC) && QT_CONFIG(dlopen) #include #endif @@ -564,7 +564,7 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName) if (!glXGetProcAddressARB) { QList glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' '); if (glxExt.contains("GLX_ARB_get_proc_address")) { -#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4) +#if QT_CONFIG(dlopen) void *handle = dlopen(NULL, RTLD_LAZY); if (handle) { glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB"); diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro index 8aa6e1febd..215f5a3fe1 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro @@ -12,7 +12,7 @@ qtConfig(xcb-glx) { QMAKE_USE += xcb_glx } -LIBS += $$QMAKE_LIBS_DYNLOAD +!static:qtConfig(dlopen): QMAKE_USE += libdl HEADERS += \ qxcbglxintegration.h \ -- cgit v1.2.3