From 26e5792c84d15ca8fb90c2f3b0ba3a53e52f242d Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 17 Sep 2009 11:53:14 +0200 Subject: Add a QMAKE_LFLAGS_EGL and QMAKE_LFLAGS_OPENGL When you link cross-compiled applications on Linux, the linker needs to be able to find not just the libraries the application links against (like libQtGui.so), but the libraries' dependencies. E.g. examples/widgets/wiggly links against QtGui. QtGui links against libEGL.so. Therefore, when you link wiggly, the linker has to be able to find libEGL.so, even though wiggly doesn't use EGL directly. To facilitate this, -Wl,rpath-link=/path/to/egl needs to be added to QMAKE_PRL_LIBS in libQtGui.prl and -Wl,rpath-link=/path/to/gl needs to be added to QMAKE_PRL_LIBS in libQtOpenGL.prl. This only needs to be done when the EGL/GL libs are not in the default search directories. As the paths will also change depending on the mkspec, two new variables have been added: QMAKE_LFLAGS_EGL & QMAKE_LFLAGS_OPENGL. These can be set in the mkspec and will be added to the relevent prls. E.g. QMAKE_LFLAGS_EGL += -Wl,-rpath-link=$${QMAKE_LIBDIR_EGL} QMAKE_LFLAGS_OPENGL += -Wl,-rpath-link=$${QMAKE_LIBDIR_OPENGL} Reviewed-by: Marius Storm-Olsen --- src/gui/egl/egl.pri | 1 + src/opengl/opengl.pro | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri index 22c8bd7..ba991bd 100644 --- a/src/gui/egl/egl.pri +++ b/src/gui/egl/egl.pri @@ -26,3 +26,4 @@ for(p, QMAKE_LIBDIR_EGL) { !isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL !isEmpty(QMAKE_LIBS_EGL): LIBS_PRIVATE += $$QMAKE_LIBS_EGL +!isEmpty(QMAKE_LFLAGS_EGL): LIBS += $$QMAKE_LFLAGS_EGL diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index da30e3d..d434725 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -159,4 +159,5 @@ wince*: { } else { LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL + LIBS += $$QMAKE_LFLAGS_OPENGL } -- cgit v0.12