mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-12 03:00:28 +00:00
8ceb79f0fe
This is another shot at fixing the linkage problems that have plagued our users particularly when upgrading from Qt 5.x to 5.(x+1). Quick recap: in Qt5, qmake will by default pass QMAKE_LIBDIR to the linker before other directories such as ${WRKSRC}/lib, which is where the port's libraries are built. When a user is upgrading Qt, we can end up with the following linker line: c++ -o SomeBinary -lfoo1 -L/usr/local/lib -L${WRKSRC}/lib -lfoo2 -lfoo3 If libfoo2.so is being built by the port and an older version is currently installed on the system, /usr/local/lib/libfoo2.so will be picked up instead of the newly-built ${WRKSRC}/lib/libfoo2.so. At best things just work, at worst SomeBinary needs some new symbol that is not present in the old libfoo2.so and linking fails. Case in point: bug 198720. The previous approach, adopted when fixing bug 194088, was to stop setting QMAKE_{INC,LIB}DIR in the FreeBSD mkspecs and set the CPATH and LIBRARY_PATH environment variables in Uses/qmake.mk. This way we just did not pass -L/usr/local/lib to the linker at all and things mostly worked. However, people using Qt to build their own software without the ports tree were out of luck, as they would then need need to deal with passing /usr/local/{include,lib} to the compiler/linker themselves (bug 195105). Not only that, but if a dependency mentioned /usr/local/lib we would still have problems anyway (in bug 198720, the GStreamer pkg-config files contain -L/usr/local/lib, for example). We now solve the issue by setting the QMAKE_LIBDIR_FLAGS variable in .qmake.cache to ${WRKSRC}/lib instead. qmake appends the value of QMAKE_LIBDIR to QMAKE_LIBDIR_FLAGS, so we are always sure -L${WRKSRC}/lib will come before -L/usr/local/lib in the linker options. Moreover, qmake is smart enough to automatically call sed(1) and remove references to ${WRKSRC}/lib from .prl and .pc files when installing them. PR: 194088 PR: 195105 PR: 198720 MFH: 2015Q4 |
||
---|---|---|
.. | ||
Scripts | ||
Uses | ||
bsd.apache.mk | ||
bsd.autotools.mk | ||
bsd.ccache.mk | ||
bsd.commands.mk | ||
bsd.database.mk | ||
bsd.default-versions.mk | ||
bsd.destdir.mk | ||
bsd.emacs.mk | ||
bsd.fpc.mk | ||
bsd.gcc.mk | ||
bsd.gecko.mk | ||
bsd.gnome.mk | ||
bsd.gstreamer.mk | ||
bsd.java.mk | ||
bsd.kde4.mk | ||
bsd.ldap.mk | ||
bsd.licenses.db.mk | ||
bsd.licenses.mk | ||
bsd.linux-apps.mk | ||
bsd.linux-rpm.mk | ||
bsd.local.mk | ||
bsd.mate.mk | ||
bsd.ocaml.mk | ||
bsd.octave.mk | ||
bsd.openssl.mk | ||
bsd.options.desc.mk | ||
bsd.options.mk | ||
bsd.php.mk | ||
bsd.port.mk | ||
bsd.port.options.mk | ||
bsd.port.post.mk | ||
bsd.port.pre.mk | ||
bsd.port.subdir.mk | ||
bsd.qt.mk | ||
bsd.ruby.mk | ||
bsd.sanity.mk | ||
bsd.sdl.mk | ||
bsd.sites.mk | ||
bsd.ssp.mk | ||
bsd.tex.mk | ||
bsd.wx.mk | ||
bsd.xorg.mk |