[debhelper-devel] [debhelper] 01/02: Dh_Lib: Add an is_cross_compiling sub

Niels Thykier nthykier at moszumanska.debian.org
Wed Aug 12 15:16:46 UTC 2015


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 17effbbbd7d931e00a5ea70830c1c90064cf8a32
Author: Niels Thykier <niels at thykier.net>
Date:   Wed Aug 12 16:40:22 2015 +0200

    Dh_Lib: Add an is_cross_compiling sub
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 16ac003..83ad659 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -23,7 +23,7 @@ use vars qw(@EXPORT %dh);
 	    &cross_command &set_buildflags &get_buildoption
 	    &install_dh_config_file &error_exitcode &package_multiarch
 	    &install_file &install_prog &install_lib &install_dir
-	    &get_source_date_epoch
+	    &get_source_date_epoch &is_cross_compiling
 );
 
 my $max_compat=10;
@@ -791,6 +791,12 @@ sub buildos {
 	dpkg_architecture_value("DEB_HOST_ARCH_OS");
 }
 
+# Returns a truth value if this seems to be a cross-compile
+sub is_cross_compiling {
+	return dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
+	    ne dpkg_architecture_value("DEB_HOST_GNU_TYPE");
+}
+
 # Passed an arch and a list of arches to match against, returns true if matched
 {
 	my %knownsame;
@@ -1135,8 +1141,7 @@ sub clean_jobserver_makeflags {
 # If cross-compiling, returns appropriate cross version of command.
 sub cross_command {
 	my $command=shift;
-	if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
-	    ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
+	if (is_cross_compiling()) {
 		return dpkg_architecture_value("DEB_HOST_GNU_TYPE")."-$command";
 	}
 	else {

-- 
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