]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Buildsystem/autoconf.pm
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / Debian / Debhelper / Buildsystem / autoconf.pm
index 7229fc718e866a61a992f5f6b6509dc68917da40..20b9fd444160b003844e5d8aa19467138201bebc 100644 (file)
@@ -7,7 +7,7 @@
 package Debian::Debhelper::Buildsystem::autoconf;
 
 use strict;
-use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage);
+use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage compat);
 use base 'Debian::Debhelper::Buildsystem::makefile';
 
 sub DESCRIPTION {
@@ -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;
 }
@@ -37,7 +37,19 @@ sub configure {
        push @opts, "--infodir=\${prefix}/share/info";
        push @opts, "--sysconfdir=/etc";
        push @opts, "--localstatedir=/var";
-       push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage();
+       my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
+       if (! compat(8)) {
+              if (defined $multiarch) {
+                       push @opts, "--libdir=\${prefix}/lib/$multiarch";
+                       push @opts, "--libexecdir=\${prefix}/lib/$multiarch";
+               }
+               else {
+                       push @opts, "--libexecdir=\${prefix}/lib";
+               }
+       }
+       else {
+               push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage();
+       }
        push @opts, "--disable-maintainer-mode";
        push @opts, "--disable-dependency-tracking";
        # Provide --host only if different from --build, as recommended in
@@ -49,7 +61,15 @@ sub configure {
        }
 
        $this->mkdir_builddir();
-       $this->doit_in_builddir($this->get_source_rel2builddir("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