summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Debhelper/Buildsystem.pm12
-rw-r--r--Debian/Debhelper/Buildsystem/cmake.pm3
-rw-r--r--Debian/Debhelper/Buildsystem/python_distutils.pm3
-rwxr-xr-xt/buildsystems/buildsystem_tests4
4 files changed, 11 insertions, 11 deletions
diff --git a/Debian/Debhelper/Buildsystem.pm b/Debian/Debhelper/Buildsystem.pm
index da43b7d7..3ee37a5f 100644
--- a/Debian/Debhelper/Buildsystem.pm
+++ b/Debian/Debhelper/Buildsystem.pm
@@ -119,13 +119,15 @@ sub enforce_in_source_building {
# Derived class can call this method in its constructor to enforce
# out of source building even if the user didn't request it. However,
-# if $builddir is specified, accept it even if it matches the source
-# directory (i.e. out of source is prefered to in source).
+# if 'builddir' named parameter is passed, accept its value as the
+# build directory even if it matches the source directory (meaning out
+# of source is only prefered to in source, not enforced).
sub enforce_out_of_source_building {
- my ($this, $builddir) = @_;
+ my $this=shift;
+ my %args=@_;
if (!defined $this->get_builddir()) {
- $this->_set_builddir($builddir);
- if (!defined $this->get_builddir() && !$builddir) {
+ $this->_set_builddir($args{builddir});
+ if (!defined $this->get_builddir() && !$args{builddir}) {
# If we are here, DEFAULT_BUILD_DIRECTORY matches
# the source directory, building might fail.
error("default build directory is the same as the source directory." .
diff --git a/Debian/Debhelper/Buildsystem/cmake.pm b/Debian/Debhelper/Buildsystem/cmake.pm
index c2a3769d..1ccab10e 100644
--- a/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/Debian/Debhelper/Buildsystem/cmake.pm
@@ -24,9 +24,8 @@ sub check_auto_buildable {
sub new {
my $class=shift;
my $this=$class->SUPER::new(@_);
- my %args=@_;
# Prefer out of source tree building.
- $this->enforce_out_of_source_building($args{builddir});
+ $this->enforce_out_of_source_building(@_);
return $this;
}
diff --git a/Debian/Debhelper/Buildsystem/python_distutils.pm b/Debian/Debhelper/Buildsystem/python_distutils.pm
index d05e3815..ad4ea877 100644
--- a/Debian/Debhelper/Buildsystem/python_distutils.pm
+++ b/Debian/Debhelper/Buildsystem/python_distutils.pm
@@ -24,9 +24,8 @@ sub DEFAULT_BUILD_DIRECTORY {
sub new {
my $class=shift;
my $this=$class->SUPER::new(@_);
- my %args=@_;
# Out of source tree building is prefered.
- $this->enforce_out_of_source_building($args{builddir});
+ $this->enforce_out_of_source_building(@_);
return $this;
}
diff --git a/t/buildsystems/buildsystem_tests b/t/buildsystems/buildsystem_tests
index 42d7f584..82d8c100 100755
--- a/t/buildsystems/buildsystem_tests
+++ b/t/buildsystems/buildsystem_tests
@@ -162,8 +162,8 @@ test_buildsystem_paths_api($bs, "no builddir, sourcedir=autoconf", \%tmp);
# Prefer out of source tree building when
# sourcedir=builddir=autoconf hence builddir should be dropped.
-$bs->enforce_out_of_source_building("autoconf");
-test_buildsystem_paths_api($bs, "soft out of source enforced, sourcedir=builddir", \%tmp);
+$bs->enforce_out_of_source_building(builddir => "autoconf");
+test_buildsystem_paths_api($bs, "out of source prefered, sourcedir=builddir", \%tmp);
# builddir=bld/dir, sourcedir=autoconf. Should be the same as sourcedir=autoconf.
$bs = $BS_CLASS->new(builddir => "bld/dir", sourcedir => "autoconf");