qt: fix static linking
authorJörg Krause <joerg.krause@embedded.rocks>
Fri, 15 Apr 2016 06:54:45 +0000 (08:54 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 15 Apr 2016 07:42:16 +0000 (09:42 +0200)
commit92180f7fe14e293bb9edad61024691e76c7aff97
tree47a02fe656c3c3b6f0636d4f005c9c453c748bf8
parent036a1aaaa69f95853c58df6287519edbc9e82c80
qt: fix static linking

`-ldl` option is used unconditionally in `QMAKE_LIBS_DYNLOAD` while libdl is
not supported when libc is static. As the value of `QMAKE_LIBS_DYNLOAD` goes
into 'Libs.private' field of the pkgconfig files created by qmake, static
linking with qt will fail with:
  /usr/bin/ld: cannot find -ldl

Fix this issue by adding a build test to configure to check if libdl is
supported. `QMAKE_LIBS_DYNLOAD` in "src/corelib/plugin/plugin.pri" is now used
only if libdl is available.

Fixes:
http://autobuild.buildroot.net/results/459/4596b9c69cbc387f1071c730aaac76723afaa853/
http://autobuild.buildroot.net/results/459/4596b9c69cbc387f1071c730aaac76723afaa853/

Backported from Qt5:
https://github.com/qtproject/qtbase/commit/f669ea0d54302de31456d57286aa0e4ca1443e98

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/qt/0011-Link-with-ldl-option-only-when-it-is-supported.patch [new file with mode: 0644]