summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Buildsystem
diff options
context:
space:
mode:
authorModestas Vainius <modestas@vainius.eu>2009-11-18 14:16:41 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-11-18 14:16:41 -0500
commit758ce0bb1fbb505aa05f2dd3ac85d7d084b94312 (patch)
tree58aa6852c13e83aecdaaa000a0e3f4f17d99dcf1 /Debian/Debhelper/Buildsystem
parent93cab1844819ee8f761606f6ccc511ebf07d2213 (diff)
Improve build system auto-selection process
This patch alters semantics of check_auto_buildable() a bit. Now it can also indicate if the source has already been partitially built with the build system and if so, such build system may be auto-selected over a less specific its parent (in the inheritance tree) even if the latter is earlier in the @BUILDSYSTEMS array. However, this still leaves a requirement that a derivative build system must not do anything that may break packages of the parent build system. Otherwise, introduction of a new derivative build system might break packages which already had that build system implemented via overrides... Signed-off-by: Modestas Vainius <modestas@vainius.eu>
Diffstat (limited to 'Debian/Debhelper/Buildsystem')
-rw-r--r--Debian/Debhelper/Buildsystem/ant.pm2
-rw-r--r--Debian/Debhelper/Buildsystem/autoconf.pm4
-rw-r--r--Debian/Debhelper/Buildsystem/cmake.pm10
-rw-r--r--Debian/Debhelper/Buildsystem/makefile.pm14
-rw-r--r--Debian/Debhelper/Buildsystem/perl_build.pm2
-rw-r--r--Debian/Debhelper/Buildsystem/perl_makemaker.pm2
-rw-r--r--Debian/Debhelper/Buildsystem/python_distutils.pm12
7 files changed, 21 insertions, 25 deletions
diff --git a/Debian/Debhelper/Buildsystem/ant.pm b/Debian/Debhelper/Buildsystem/ant.pm
index 26bee95..938fb44 100644
--- a/Debian/Debhelper/Buildsystem/ant.pm
+++ b/Debian/Debhelper/Buildsystem/ant.pm
@@ -14,7 +14,7 @@ sub DESCRIPTION {
sub check_auto_buildable {
my $this=shift;
- return -e $this->get_sourcepath("build.xml");
+ return $this->get_sourcepath("build.xml") ? 1 : 0;
}
sub new {
diff --git a/Debian/Debhelper/Buildsystem/autoconf.pm b/Debian/Debhelper/Buildsystem/autoconf.pm
index a97de9c..d7b0bed 100644
--- a/Debian/Debhelper/Buildsystem/autoconf.pm
+++ b/Debian/Debhelper/Buildsystem/autoconf.pm
@@ -18,9 +18,9 @@ sub check_auto_buildable {
my $this=shift;
my ($step)=@_;
- # Handle configure; the rest - next class
+ # Handle configure; the rest - next class (compat with 7.0.x code path)
if ($step eq "configure") {
- return -x $this->get_sourcepath("configure");
+ return 1 if -x $this->get_sourcepath("configure");
}
return 0;
}
diff --git a/Debian/Debhelper/Buildsystem/cmake.pm b/Debian/Debhelper/Buildsystem/cmake.pm
index 03e6ade..3eddc74 100644
--- a/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/Debian/Debhelper/Buildsystem/cmake.pm
@@ -16,12 +16,12 @@ sub DESCRIPTION {
sub check_auto_buildable {
my $this=shift;
my ($step)=@_;
- my $ret = -e $this->get_sourcepath("CMakeLists.txt");
- if ($step ne "configure") {
- $ret &&= -e $this->get_buildpath("CMakeCache.txt") &&
- $this->SUPER::check_auto_buildable(@_);
+ if (-e $this->get_sourcepath("CMakeLists.txt")) {
+ my $ret = $this->SUPER::check_auto_buildable(@_);
+ $ret++ if ($ret && -e $this->get_buildpath("CMakeCache.txt"));
+ return $ret > 0 ? $ret : 1;
}
- return $ret;
+ return 0;
}
sub new {
diff --git a/Debian/Debhelper/Buildsystem/makefile.pm b/Debian/Debhelper/Buildsystem/makefile.pm
index 704f9c9..083abc4 100644
--- a/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/Debian/Debhelper/Buildsystem/makefile.pm
@@ -71,15 +71,11 @@ sub check_auto_buildable {
my $this=shift;
my ($step) = @_;
- # Handles build, test, install, clean; configure - next class
- if (grep /^\Q$step\E$/, qw{build test install clean}) {
- # This is always called in the source directory, but generally
- # Makefiles are created (or live) in the the build directory.
- return -e $this->get_buildpath("Makefile") ||
- -e $this->get_buildpath("makefile") ||
- -e $this->get_buildpath("GNUmakefile");
- }
- return 0;
+ # This is always called in the source directory, but generally
+ # Makefiles are created (or live) in the the build directory.
+ return (-e $this->get_buildpath("Makefile") ||
+ -e $this->get_buildpath("makefile") ||
+ -e $this->get_buildpath("GNUmakefile")) ? 1 : 0;
}
sub build {
diff --git a/Debian/Debhelper/Buildsystem/perl_build.pm b/Debian/Debhelper/Buildsystem/perl_build.pm
index 8974be2..2afa5e5 100644
--- a/Debian/Debhelper/Buildsystem/perl_build.pm
+++ b/Debian/Debhelper/Buildsystem/perl_build.pm
@@ -21,7 +21,7 @@ sub check_auto_buildable {
if ($step ne "configure") {
$ret &&= -e $this->get_sourcepath("Build");
}
- return $ret;
+ return $ret ? 1 : 0;
}
sub do_perl {
diff --git a/Debian/Debhelper/Buildsystem/perl_makemaker.pm b/Debian/Debhelper/Buildsystem/perl_makemaker.pm
index e109be5..473a3a7 100644
--- a/Debian/Debhelper/Buildsystem/perl_makemaker.pm
+++ b/Debian/Debhelper/Buildsystem/perl_makemaker.pm
@@ -19,7 +19,7 @@ sub check_auto_buildable {
# Handles everything if Makefile.PL exists. Otherwise - next class.
if (-e $this->get_sourcepath("Makefile.PL")) {
- if ($step eq "install" || $step eq "configure") {
+ if ($step eq "configure") {
return 1;
}
else {
diff --git a/Debian/Debhelper/Buildsystem/python_distutils.pm b/Debian/Debhelper/Buildsystem/python_distutils.pm
index 219c6f9..70307b0 100644
--- a/Debian/Debhelper/Buildsystem/python_distutils.pm
+++ b/Debian/Debhelper/Buildsystem/python_distutils.pm
@@ -31,7 +31,7 @@ sub new {
sub check_auto_buildable {
my $this=shift;
- return -e $this->get_sourcepath("setup.py");
+ return -e $this->get_sourcepath("setup.py") ? 1 : 0;
}
sub not_our_cfg {
@@ -117,10 +117,10 @@ sub setup_py {
# Then, run setup.py with each available python, to build
# extensions for each.
- my $python_default = `pyversions -d`;
- $python_default =~ s/^\s+//;
- $python_default =~ s/\s+$//;
- my @python_requested = split ' ', `pyversions -r 2>/dev/null`;
+ my $python_default = `pyversions -d`;
+ $python_default =~ s/^\s+//;
+ $python_default =~ s/\s+$//;
+ my @python_requested = split ' ', `pyversions -r 2>/dev/null`;
if (grep /^\Q$python_default\E/, @python_requested) {
@python_requested = (
grep(!/^\Q$python_default\E/, @python_requested),
@@ -129,7 +129,7 @@ sub setup_py {
}
my @python_dbg;
- my @dbg_build_needed = $this->dbg_build_needed();
+ my @dbg_build_needed = $this->dbg_build_needed();
foreach my $python (map { $_."-dbg" } @python_requested) {
if (grep /^(python-all-dbg|\Q$python\E)/, @dbg_build_needed) {
push @python_dbg, $python;