summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-02-08 15:32:22 -0400
committerJoey Hess <joey@kitenet.net>2011-02-08 15:32:22 -0400
commitc51b87a19648c4527a0c6612dd8f1bfbceda812d (patch)
tree463998575cc40f3a57c172e9b3edca431a1bc443 /Debian/Debhelper/Dh_Lib.pm
parent7bc99d44cfc0275e1b44b390bed1362c457da9ab (diff)
refactor cross command generation
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index fb83480..9b6118e 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