This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=1046c10897ba54a67ce5bd5760d054e39440a865 commit 1046c10897ba54a67ce5bd5760d054e39440a865 Author: Guillem Jover <[email protected]> AuthorDate: Sun Jun 2 23:13:02 2019 +0200 scripts/mk: Add support for nostrip DEB_BUILD_OPTIONS when setting STRIP --- debian/changelog | 2 ++ scripts/mk/buildtools.mk | 7 ++++++- scripts/t/mk.t | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 87ee5bb24..5cf0d7bfe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ dpkg (1.20.0) UNRELEASED; urgency=medium form «-ab» for «-a -b», which is not future-proof, as it does not allow these options to get new arguments without making them abiguous. * dpkg-buildpackage: Remove transient backwards R³ compatibility code. + * buildtools.mk: Add support for nostrip in DEB_BUILD_OPTIONS when setting + the STRIP variable. * Documentation: - man: Fix uncommon wording constructs. * Build system: diff --git a/scripts/mk/buildtools.mk b/scripts/mk/buildtools.mk index c3b44bb8a..cdf7734d3 100644 --- a/scripts/mk/buildtools.mk +++ b/scripts/mk/buildtools.mk @@ -32,6 +32,7 @@ include $(dpkg_datadir)/architecture.mk # not defined or contain the make built-in defaults. On native builds if # TOOL is defined and TOOL_FOR_BUILD is not, we fallback to use TOOL. define dpkg_buildtool_setvar +ifeq (,$(findstring $(3),$(DEB_BUILD_OPTIONS))) ifeq ($(origin $(1)),default) $(1) = $(DEB_HOST_GNU_TYPE)-$(2) endif @@ -44,6 +45,10 @@ $(1)_FOR_BUILD ?= $$($(1)) endif endif $(1)_FOR_BUILD ?= $(DEB_BUILD_GNU_TYPE)-$(2) +else +$(1) = : +$(1)_FOR_BUILD = : +endif ifdef DPKG_EXPORT_BUILDTOOLS export $(1) @@ -61,7 +66,7 @@ $(eval $(call dpkg_buildtool_setvar,GCJ,gcj)) $(eval $(call dpkg_buildtool_setvar,F77,f77)) $(eval $(call dpkg_buildtool_setvar,FC,f77)) $(eval $(call dpkg_buildtool_setvar,LD,ld)) -$(eval $(call dpkg_buildtool_setvar,STRIP,strip)) +$(eval $(call dpkg_buildtool_setvar,STRIP,strip,nostrip)) $(eval $(call dpkg_buildtool_setvar,OBJCOPY,objcopy)) $(eval $(call dpkg_buildtool_setvar,OBJDUMP,objdump)) $(eval $(call dpkg_buildtool_setvar,NM,nm)) diff --git a/scripts/t/mk.t b/scripts/t/mk.t index 98c7e5083..2e62cf5cf 100644 --- a/scripts/t/mk.t +++ b/scripts/t/mk.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 9; use Test::Dpkg qw(:paths); use File::Spec::Functions qw(rel2abs); @@ -109,6 +109,12 @@ foreach my $tool (keys %buildtools) { } test_makefile('buildtools.mk'); +$ENV{DEB_BUILD_OPTIONS} = 'nostrip'; +$ENV{TEST_STRIP} = ':'; +$ENV{TEST_STRIP_FOR_BUILD} = ':'; +test_makefile('buildtools.mk'); +delete $ENV{DEB_BUILD_OPTIONS}; + foreach my $tool (keys %buildtools) { delete $ENV{${tool}}; delete $ENV{"${tool}_FOR_BUILD"}; -- Dpkg.Org's dpkg

