summaryrefslogtreecommitdiff
path: root/mk/install
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2018-11-12 13:42:16 +0000
committerjperkin <jperkin@pkgsrc.org>2018-11-12 13:42:16 +0000
commit6b7555c7c008a3a887420775e8559f315d866bbd (patch)
tree022c93c1f51c2b77edaf80a62f6d950772968aaa /mk/install
parent272558f684acc9f6bf1f1b06a4c57f69054b2382 (diff)
downloadpkgsrc-6b7555c7c008a3a887420775e8559f315d866bbd.tar.gz
mk/install: Improve the strip-debug target.
Use the new strip-dbg tool, ensuring that we don't fail when the native strip doesn't support -g. Actually check for the existence of the output file before trying to move it into place. Add support for STRIP_FILES_SKIP for certain files which should not be stripped. And finally, improve performance slightly by skipping symlinks.
Diffstat (limited to 'mk/install')
-rw-r--r--mk/install/install.mk26
1 files changed, 15 insertions, 11 deletions
diff --git a/mk/install/install.mk b/mk/install/install.mk
index fb50905518e..c1dadd011d4 100644
--- a/mk/install/install.mk
+++ b/mk/install/install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: install.mk,v 1.72 2017/08/08 17:17:25 jlam Exp $
+# $NetBSD: install.mk,v 1.73 2018/11/12 13:42:16 jperkin Exp $
#
# This file provides the code for the "install" phase.
#
@@ -338,16 +338,20 @@ post-install:
.PHONY: install-strip-debug
install-strip-debug: plist
@${STEP_MSG} "Automatic stripping of debug information"
- ${RUN}${CAT} ${_PLIST_NOKEYWORDS} \
- | ${SED} -e 's|^|${DESTDIR}${PREFIX}/|' \
- | while read f; do \
- tmp_f="$${f}.XXX"; \
- if ${STRIP} -g -o "$${tmp_f}" "$${f}" 2> /dev/null; then \
- [ ! -f "$${f}" ] || \
- ${MV} "$${tmp_f}" "$${f}"; \
- else \
- ${RM} -f "$${tmp_f}"; \
- fi \
+ ${RUN}cd ${DESTDIR:Q}${PREFIX:Q}; \
+ ${CAT} ${_PLIST_NOKEYWORDS} | while read f; do \
+ [ ! -h "$${f}" ] || continue; \
+ case "$${f}" in \
+ ${STRIP_FILES_SKIP:@p@${p}) continue;;@} \
+ *) ;; \
+ esac; \
+ tmp_f="$${f}.XXX"; \
+ if ${STRIP_DBG} -o "$${tmp_f}" "$${f}" 2>/dev/null; then \
+ if [ -f "$${tmp_f}" -a -f "$${f}" ]; then \
+ ${MV} "$${tmp_f}" "$${f}"; \
+ fi; \
+ fi; \
+ ${RM} -f "$${tmp_f}"; \
done
######################################################################