summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2022-12-14 19:23:16 +0000
committerNiels Thykier <niels@thykier.net>2022-12-14 19:23:16 +0000
commit3d91b51f75c68209e5270ce7e1da0f4361b968a4 (patch)
tree64a8ed9e1fef393404cb14fd128792ac125ff056
parent65d29e845973a959d2cafb1d1f4cf6672b38ff8c (diff)
makefile.pm: Provide hook for subclasses to reuse cross-build support
Closes: #1024296 Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--lib/Debian/Debhelper/Buildsystem/makefile.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/makefile.pm b/lib/Debian/Debhelper/Buildsystem/makefile.pm
index 64b7c6bc..856a6dd4 100644
--- a/lib/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/lib/Debian/Debhelper/Buildsystem/makefile.pm
@@ -142,11 +142,17 @@ sub check_auto_buildable {
return 0;
}
+sub _should_inject_cross_build_tools {
+ my ($this) = @_;
+ return ref($this) eq 'Debian::Debhelper::Buildsystem::makefile';
+}
+
+
sub build {
my $this=shift;
if (not $this->_is_targetbuildsystem
- and ref($this) eq 'Debian::Debhelper::Buildsystem::makefile'
- and is_cross_compiling()) {
+ and is_cross_compiling()
+ and $this->_should_inject_cross_build_tools) {
# Only inject build tools variables during cross-compile when
# makefile is the explicit *main* build system.
for my $var (sort(keys(%DEB_DEFAULT_TOOLS))) {