Mon Nov 12 13:36:50 2018 UTC ()
mk/tools: Create a strip-dbg tool.

On platform where strip supports -g it is used, otherwise this is a no-op.


(jperkin)
diff -r1.5 -r1.6 pkgsrc/mk/tools/strip.mk

cvs diff -r1.5 -r1.6 pkgsrc/mk/tools/strip.mk (expand / switch to unified diff)

--- pkgsrc/mk/tools/strip.mk 2018/08/22 20:48:37 1.5
+++ pkgsrc/mk/tools/strip.mk 2018/11/12 13:36:50 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: strip.mk,v 1.5 2018/08/22 20:48:37 maya Exp $ 1# $NetBSD: strip.mk,v 1.6 2018/11/12 13:36:50 jperkin Exp $
2# 2#
3# Copyright (c) 2005 The NetBSD Foundation, Inc. 3# Copyright (c) 2005 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# This code is derived from software contributed to The NetBSD Foundation 6# This code is derived from software contributed to The NetBSD Foundation
7# by Johnny C. Lam. 7# by Johnny C. Lam.
8# 8#
9# Redistribution and use in source and binary forms, with or without 9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions 10# modification, are permitted provided that the following conditions
11# are met: 11# are met:
12# 1. Redistributions of source code must retain the above copyright 12# 1. Redistributions of source code must retain the above copyright
13# notice, this list of conditions and the following disclaimer. 13# notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright 14# 2. Redistributions in binary form must reproduce the above copyright
@@ -29,17 +29,30 @@ @@ -29,17 +29,30 @@
29# 29#
30 30
31# 31#
32# Depending on whether _INSTALL_UNSTRIPPED is defined, we cause 32# Depending on whether _INSTALL_UNSTRIPPED is defined, we cause
33# ${TOOLS_DIR}/bin/strip to be either the correct strip tool or a no-op. 33# ${TOOLS_DIR}/bin/strip to be either the correct strip tool or a no-op.
34# 34#
35.if defined(_INSTALL_UNSTRIPPED) || !defined(TOOLS_PLATFORM.strip) 35.if defined(_INSTALL_UNSTRIPPED) || !defined(TOOLS_PLATFORM.strip)
36TOOLS_NOOP+= strip 36TOOLS_NOOP+= strip
37.else 37.else
38TOOLS_CREATE+= strip 38TOOLS_CREATE+= strip
39TOOLS_PATH.strip= ${TOOLS_PLATFORM.strip} 39TOOLS_PATH.strip= ${TOOLS_PLATFORM.strip}
40.endif 40.endif
41 41
42# Make ${STRIP} call "strip" through the PATH, which should find the one 42#
 43# Create a special strip-dbg tool for stripping just debug information,
 44# used by the install-strip-debug target. Currently requires GNU strip.
 45#
 46.if !defined(TOOLS_PLATFORM.gstrip)
 47TOOLS_NOOP+= strip-dbg
 48.else
 49TOOLS_CREATE+= strip-dbg
 50TOOLS_PATH.strip-dbg= ${TOOLS_PLATFORM.gstrip}
 51TOOLS_ARGS.strip-dbg= -g
 52.endif
 53
 54# Make ${STRIP} and ${STRIP_DBG} call through the PATH so they find the ones
43# under ${TOOLS_DIR}. 55# under ${TOOLS_DIR}.
44# 56#
45STRIP?= strip 57STRIP?= strip
 58STRIP_DBG?= strip-dbg