]> git.donarmstrong.com Git - debhelper.git/blob - Debian/Debhelper/Buildsystem/autoconf.pm
Use the term "build step" instead of "build action" everywhere in the source.
[debhelper.git] / Debian / Debhelper / Buildsystem / autoconf.pm
1 # A buildsystem plugin for handling autoconf based projects
2 #
3 # Copyright: © 2008 Joey Hess
4 #            © 2008-2009 Modestas Vainius
5 # License: GPL-2+
6
7 package Debian::Debhelper::Buildsystem::autoconf;
8
9 use strict;
10 use File::Spec;
11 use Debian::Debhelper::Dh_Lib;
12 use base 'Debian::Debhelper::Buildsystem::makefile';
13
14 sub DESCRIPTION {
15         "GNU Autoconf (configure)"
16 }
17
18 sub check_auto_buildable {
19         my $this=shift;
20         my ($step)=@_;
21
22         # Handle configure; the rest - next class
23         if ($step eq "configure") {
24                 return -x "configure";
25         }
26         return 0;
27 }
28
29 sub configure {
30         my $this=shift;
31
32         # Standard set of options for configure.
33         my @opts;
34         push @opts, "--build=" . dpkg_architecture_value("DEB_BUILD_GNU_TYPE");
35         push @opts, "--prefix=/usr";
36         push @opts, "--includedir=\${prefix}/include";
37         push @opts, "--mandir=\${prefix}/share/man";
38         push @opts, "--infodir=\${prefix}/share/info";
39         push @opts, "--sysconfdir=/etc";
40         push @opts, "--localstatedir=/var";
41         push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage();
42         push @opts, "--disable-maintainer-mode";
43         push @opts, "--disable-dependency-tracking";
44         # Provide --host only if different from --build, as recommended in
45         # autotools-dev README.Debian: When provided (even if equal)
46         # autoconf 2.52+ switches to cross-compiling mode.
47         if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
48             ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
49                 push @opts, "--host=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE");
50         }
51
52         $this->mkdir_builddir();
53         $this->doit_in_builddir($this->get_rel2builddir_path("configure"), @opts, @_);
54 }
55
56 1;