From c51b87a19648c4527a0c6612dd8f1bfbceda812d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Feb 2011 15:32:22 -0400 Subject: refactor cross command generation --- Debian/Debhelper/Dh_Lib.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Debian/Debhelper/Dh_Lib.pm') diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index fb83480b..9b6118e9 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -17,7 +17,8 @@ use vars qw(@ISA @EXPORT %dh); &is_udeb &udeb_filename &debhelper_script_subst &escape_shell &inhibit_log &load_log &write_log &dpkg_architecture_value &sourcepackage - &is_make_jobserver_unavailable &clean_jobserver_makeflags); + &is_make_jobserver_unavailable &clean_jobserver_makeflags + &cross_command); my $max_compat=8; @@ -858,4 +859,16 @@ 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")) { + return dpkg_architecture_value("DEB_HOST_GNU_TYPE")."-$command"; + } + else { + return $command; + } +} + 1 -- cgit v1.2.3