Bug 193767 - INSTALL_TARGET strip target substitution is too inflexible
Summary: INSTALL_TARGET strip target substitution is too inflexible
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-19 12:31 UTC by Raphael Kubo da Costa
Modified: 2014-12-28 22:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-09-19 12:31:51 UTC
bsd.port.mk currently contains the following for not stripping targets when in, for example, debug mode:

.if defined(INSTALL_TARGET)
INSTALL_TARGET:=    ${INSTALL_TARGET:S/^install-strip$/install/g}
.endif

This assumes the target for installing stuff with symbols stripped is always called "install-strip", which is not the case -- CMake calls this target "install/strip", for example, so all CMake-based ports currently cannot benefit from the stripping infrastructure at the moment.

I'm not sure if there needs to be some INSTALL_STRIP_TARGET variable or something like that.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2014-12-28 21:31:33 UTC
I'm not sure this is a bug.

Ports using cmake do not use install-strip as a target so the line doesn't cause any problem to ports using cmake.

Substitution specific to cmake can go in Uses/cmake.mk
Comment 2 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-12-28 22:23:56 UTC
Ports using CMake don't use install-strip, but they do use install/strip. My point is that the latter does not work with the infrastructure in bsd.port.mk so the symbols are never stripped even though they should.
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2014-12-28 22:26:24 UTC
install-strip is not defined by default as well but defined port by port, the default still is install
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-12-28 22:29:22 UTC
I know. What I am saying is that this does not work:

  INSTALL_TARGET=install/strip.

It will stay like that even if I do not want to strip the symbols.
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2014-12-28 22:31:14 UTC
Uses/cmake.mk has some logic already:

 67 .if defined(STRIP) && ${STRIP} != "" && !defined(WITH_DEBUG)
 68 INSTALL_TARGET?=        install/strip
 69 .endif

% make -C www/faup -V INSTALL_TARGET
install/strip 

% make -C www/faup -V INSTALL_TARGET WITH_DEBUG=yes
install
Comment 6 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-12-28 22:37:19 UTC
Hmm, very interesting. IIRC I tested this with devel/cmake itself, but I guess the problem there's coming from bsd.port.mk being used instead of bsd.port.pre.mk + change INSTALL_TARGET + bsd.port.post.mk.

Thanks!