1 # A debhelper build system class for handling Autoconf based projects
3 # Copyright: © 2008 Joey Hess
4 # © 2008-2009 Modestas Vainius
7 package Debian::Debhelper::Buildsystem::autoconf;
10 use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage compat);
11 use base 'Debian::Debhelper::Buildsystem::makefile';
14 "GNU Autoconf (configure)"
17 sub check_auto_buildable {
21 # Handle configure; the rest - next class (compat with 7.0.x code path)
22 if ($step eq "configure") {
23 return 1 if -x $this->get_sourcepath("configure");
31 # Standard set of options for configure.
33 push @opts, "--build=" . dpkg_architecture_value("DEB_BUILD_GNU_TYPE");
34 push @opts, "--prefix=/usr";
35 push @opts, "--includedir=\${prefix}/include";
36 push @opts, "--mandir=\${prefix}/share/man";
37 push @opts, "--infodir=\${prefix}/share/info";
38 push @opts, "--sysconfdir=/etc";
39 push @opts, "--localstatedir=/var";
40 my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
42 if (defined $multiarch) {
43 push @opts, "--libdir=\${prefix}/lib/$multiarch";
44 push @opts, "--libexecdir=\${prefix}/lib/$multiarch";
47 push @opts, "--libexecdir=\${prefix}/lib";
51 push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage();
53 push @opts, "--disable-maintainer-mode";
54 push @opts, "--disable-dependency-tracking";
55 # Provide --host only if different from --build, as recommended in
56 # autotools-dev README.Debian: When provided (even if equal)
57 # autoconf 2.52+ switches to cross-compiling mode.
58 if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
59 ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
60 push @opts, "--host=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE");
63 $this->mkdir_builddir();
65 $this->doit_in_builddir($this->get_source_rel2builddir("configure"), @opts, @_);
68 if (-e $this->get_buildpath("config.log")) {
69 $this->doit_in_builddir("tail -v -n +0 config.log");