]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem/autoconf.pm
Improve build system auto-selection process
[debhelper.git] / Debian / Debhelper / Buildsystem / autoconf.pm
index fcdc256797a6dc0f1d709263e01ecc943519db09..d7b0bed251b251adcba7fafcdc229706cbb58b96 100644 (file)
@@ -1,4 +1,4 @@
-# A buildsystem plugin for handling autoconf based projects
+# A debhelper build system class for handling Autoconf based projects
 #
 # Copyright: © 2008 Joey Hess
 #            © 2008-2009 Modestas Vainius
@@ -7,8 +7,7 @@
 package Debian::Debhelper::Buildsystem::autoconf;
 
 use strict;
-use File::Spec;
-use Debian::Debhelper::Dh_Lib;
+use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage);
 use base 'Debian::Debhelper::Buildsystem::makefile';
 
 sub DESCRIPTION {
@@ -17,11 +16,11 @@ sub DESCRIPTION {
 
 sub check_auto_buildable {
        my $this=shift;
-       my ($action)=@_;
+       my ($step)=@_;
 
-       # Handle configure; the rest - next class
-       if ($action eq "configure") {
-               return -x "configure";
+       # Handle configure; the rest - next class (compat with 7.0.x code path)
+       if ($step eq "configure") {
+               return 1 if -x $this->get_sourcepath("configure");
        }
        return 0;
 }
@@ -50,7 +49,15 @@ sub configure {
        }
 
        $this->mkdir_builddir();
-       $this->doit_in_builddir($this->get_rel2builddir_path("configure"), @opts, @_);
+       eval {
+               $this->doit_in_builddir($this->get_source_rel2builddir("configure"), @opts, @_);
+       };
+       if ($@) {
+               if (-e $this->get_buildpath("config.log")) {
+                       $this->doit_in_builddir("tail -v -n +0 config.log");
+               }
+               die $@;
+       }
 }
 
-1;
+1