[debhelper-devel] [debhelper] 03/05: Make cross_command package specific

Niels Thykier nthykier at moszumanska.debian.org
Sat Nov 11 08:03:29 UTC 2017


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 901fc1aa308a409ffe8b9b9f937e2e8c25348993
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Oct 21 14:15:57 2017 +0000

    Make cross_command package specific
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 dh_makeshlibs                  | 2 +-
 dh_strip                       | 4 ++--
 lib/Debian/Debhelper/Dh_Lib.pm | 7 ++++++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dh_makeshlibs b/dh_makeshlibs
index 9c6b4da..d5441f2 100755
--- a/dh_makeshlibs
+++ b/dh_makeshlibs
@@ -145,7 +145,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	
 	my $tmp=tmpdir($package);
 
-	my $objdump=cross_command("objdump");
+	my $objdump = cross_command($package, "objdump");
 
 	my (%seen, $unversioned_so);
 	my $need_ldconfig = 0;
diff --git a/dh_strip b/dh_strip
index 14b5db7..d7fdc3f 100755
--- a/dh_strip
+++ b/dh_strip
@@ -312,8 +312,8 @@ my %all_packages = map { $_ => 1 } getpackages();
 sub process_packages {
 	foreach my $package (@_) {
 		my $tmp=tmpdir($package);
-		my $objcopy = cross_command("objcopy");
-		my $strip = cross_command("strip");
+		my $objcopy = cross_command($package, "objcopy");
+		my $strip = cross_command($package, "strip");
 
 		# Support for keeping the debugging symbols in a detached file.
 		my $keep_debug=$dh{K_FLAG};
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index fc2845a..ad142d1 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -1778,7 +1778,12 @@ sub clean_jobserver_makeflags {
 
 # If cross-compiling, returns appropriate cross version of command.
 sub cross_command {
-	my $command=shift;
+	my ($package, $command) = @_;
+	if (package_cross_type($package) eq 'target') {
+		if (dpkg_architecture_value("DEB_HOST_GNU_TYPE") ne dpkg_architecture_value("DEB_TARGET_GNU_TYPE")) {
+			return dpkg_architecture_value("DEB_TARGET_GNU_TYPE") . "-$command";
+		}
+	}
 	if (is_cross_compiling()) {
 		return dpkg_architecture_value("DEB_HOST_GNU_TYPE")."-$command";
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list