ports/184540: emulators/dolphin-emu: New options framework + DEBUG option set = wrong INSTALL_TARGET
Ganael LAPLANCHE
martymac at FreeBSD.org
Thu Feb 6 07:44:15 UTC 2014
(the original patch included in this PR is no more useful, as Dolphin
has now been updated and includes a fix for the described problem.
Anyway, the problem still exists, so here is a more detailed explanation)
Well, here is what happens :
- ${STRIP} is set by default to '-s' by /usr/share/mk/bsd.own.mk
- ${INSTALL_TARGET} is defined by Mk/Uses/cmake.mk:70 given
${STRIP} value : if ${STRIP} is not empty, ${INSTALL_TARGET}
is forced to 'install/strip'. In my case, the problem is that
${STRIP} is never empty, even when DEBUG is on (through PORT_OPTIONS)
- Mk/Uses/cmake.mk is included by Mk/bsd.ports.mk:1518
(within pre-makefile section)
- ${STRIP} can be unset by Mk/bsd.ports.mk:1312 (within options
section) if DEBUG is on (it currently only handles WITH_DEBUG, not
DEBUG through PORT_OPTIONS)
This means that if I want to handle DEBUG as a standard PORT_OPTIONS,
I can :
- patch line 1311 of bsd.ports.mk to handle PORT_OPTIONS, i.e. :
-.if defined(WITH_DEBUG) && !defined(WITHOUT_DEBUG)
+.if (defined(WITH_DEBUG) || !empty(PORT_OPTIONS:MDEBUG)) &&
!defined(WITHOUT_DEBUG)
- include <bsd.port.options.mk> before <bsd.port.pre.mk> or else
${STRIP} will never be set properly when used by Mk/Uses/cmake.mk
The port currently fixes the problem by manually resetting
${INSTALL_TARGET} to 'install' if DEBUG is set. The fix described above
would also have worked, but required to patch bsd.ports.mk and include
<bsd.port.options.mk> before <bsd.port.pre.mk>, which seems weird, just
to handle the DEBUG option.
Find attached a patch that removes the need for a fix within the port
itself. It handles PORT_OPTIONS as well as moves the section that
unsets ${STRIP} (Mk/bsd.ports.mk:1312) from the options section to the
beginning of the pre-makefile section. That fixes the problem for
emulators/dolphin-emu but I don't know if it can have side-effects for
other ports or usage.
Also note that handling DEBUG as a standard PORT_OPTIONS will probably
need more code, see for example :
http://lists.freebsd.org/pipermail/freebsd-ports/2013-November/088064.html
--
Ganael LAPLANCHE <ganael.laplanche at martymac.org>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac at FreeBSD.org>, http://www.FreeBSD.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-INSTALL_TARGET.txt
URL: <http://lists.freebsd.org/pipermail/freebsd-ports-bugs/attachments/20140206/3a7cd19b/attachment.txt>
More information about the freebsd-ports-bugs
mailing list