1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00
freebsd-ports/Mk
Raphael Kubo da Costa 8ceb79f0fe Make sure ${WRKSRC}/lib is passed before /usr/local/lib when linking.
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
2015-12-28 18:51:41 +00:00
..
Scripts Do not advise to strip object files, it can be harmful 2015-12-25 23:22:47 +00:00
Uses Make sure ${WRKSRC}/lib is passed before /usr/local/lib when linking. 2015-12-28 18:51:41 +00:00
bsd.apache.mk - adopt new pkg keywords (CHANGES: 20150926) 2015-12-23 11:39:00 +00:00
bsd.autotools.mk Mark USE_AUTOTOOLS deprecated and remove support for libtoolize. 2015-04-19 18:16:40 +00:00
bsd.ccache.mk Let WITH_CCACHE_BUILD work on the pkg port that is not PKG_ORIGIN. 2015-04-14 20:58:26 +00:00
bsd.commands.mk Introduce a BSDMAKE?= /usr/bin/make and use it as the default MAKE_CMD. 2015-03-23 04:03:00 +00:00
bsd.database.mk New ports: databases/mysql57-client, databases/mysql57-server 2015-12-15 19:40:21 +00:00
bsd.default-versions.mk FPC ecosystem: Upgrade version 2.6.4 => 3.0.0 2015-12-05 23:29:36 +00:00
bsd.destdir.mk
bsd.emacs.mk GNU Emacs Updates 2015-04-27 10:28:00 +00:00
bsd.fpc.mk FPC framework: Use generic buildname to support DragonFly 2015-12-21 01:40:44 +00:00
bsd.gcc.mk Since there is not going to be any new version of GCC in the FreeBSD 2015-04-22 21:29:21 +00:00
bsd.gecko.mk gecko: phase out GStreamer support 2015-12-28 18:18:03 +00:00
bsd.gnome.mk Mk/bsd.gnome.mk : remove net/linc from the component list. 2015-09-27 10:52:16 +00:00
bsd.gstreamer.mk Update gstreamer1 ports to 1.6.0. 2015-09-26 14:36:23 +00:00
bsd.java.mk Make OpenJDK 1.8 the default 2015-10-19 16:14:29 +00:00
bsd.kde4.mk Update Calligra to 2.9.10. 2015-12-21 18:10:32 +00:00
bsd.ldap.mk
bsd.licenses.db.mk Adding CPAL-1.0, https://opensource.org/licenses/CPAL-1.0 2015-10-11 17:52:00 +00:00
bsd.licenses.mk Register license files with absolute path 2014-09-23 12:42:00 +00:00
bsd.linux-apps.mk Re-commit of 2015-08-09 19:14:13 +00:00
bsd.linux-rpm.mk Fix typo preventing using c6_64 2015-11-26 13:05:07 +00:00
bsd.local.mk
bsd.mate.mk Update MATE DE to 1.10.0. 2015-07-27 20:19:33 +00:00
bsd.ocaml.mk Explicitly run the ocaml command in post (de)installation 2015-09-26 08:41:45 +00:00
bsd.octave.mk Explicly force runnning load-octave-pkg during post (de)installation 2015-09-26 08:39:49 +00:00
bsd.openssl.mk security/libressl: Update to 2.2.2 2015-08-06 19:13:18 +00:00
bsd.options.desc.mk Add GCC_DESC to Mk/bsd.options.desc.mk. Use this in a number of ports 2015-11-16 00:30:00 +00:00
bsd.options.mk Mk/bsd.options.mk: Introduce SELECTED_OPTIONS, DESELECTED_OPTIONS 2015-12-14 22:44:39 +00:00
bsd.php.mk Add a message explaining how to fix poudriere build failures if the 2015-09-27 18:37:34 +00:00
bsd.port.mk Force DEBUG_FILES to be off when building with /usr/share/mk. Otherwise 2015-12-10 21:09:54 +00:00
bsd.port.options.mk
bsd.port.post.mk
bsd.port.pre.mk
bsd.port.subdir.mk Apply export handling fixes from bsd.port.mk. 2015-10-12 22:42:57 +00:00
bsd.qt.mk Make sure ${WRKSRC}/lib is passed before /usr/local/lib when linking. 2015-12-28 18:51:41 +00:00
bsd.ruby.mk - Update to 2.0.0p648 2015-12-23 19:11:44 +00:00
bsd.sanity.mk Remove support for WANT_SDL/HAVE_SDL knobs 2015-11-09 14:30:02 +00:00
bsd.sdl.mk Remove support for WANT_SDL/HAVE_SDL knobs 2015-11-09 14:30:02 +00:00
bsd.sites.mk - Add http://ftp.ruby-lang.org/ to MASTER_SITE_RUBY 2015-12-21 18:33:23 +00:00
bsd.ssp.mk - Enable SSP by default. 2014-11-02 20:01:31 +00:00
bsd.tex.mk Readd PORTSDIR for now we will only start removing them after 2016Q1 is branched 2015-10-15 07:36:38 +00:00
bsd.wx.mk Readd PORTSDIR for now we will only start removing them after 2016Q1 is branched 2015-10-15 07:36:38 +00:00
bsd.xorg.mk Readd PORTSDIR for now we will only start removing them after 2016Q1 is branched 2015-10-15 07:36:38 +00:00