1 # A buildsystem plugin for handling autotools based projects
3 # Copyright: © 2008 Joey Hess
4 # © 2008-2009 Modestas Vainius
7 package Debian::Debhelper::Buildsystem::autotools;
11 use Debian::Debhelper::Dh_Lib;
12 use base 'Debian::Debhelper::Buildsystem::makefile';
15 "support for building GNU Autotools based packages"
21 if ($action eq "configure") {
22 return -x "configure";
24 return $self->SUPER::is_buildable(@_);
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 # XXX JEH this is where the sheer evil of Dh_Buildsystem_Chdir
41 # becomes evident. Why is exec_in_topdir needed here?
43 # - The parent class happens to be derived from Dh_Buildsystem_Chdir.
44 # - sourcepage() happens to, like many other parts of debhelper's
45 # library, assume it's being run in the top of the source tree,
46 # and fails if it's not.
47 # Having to worry about interactions like that for every line of
48 # every derived method is simply not acceptable.
49 # Dh_Buildsystem_Chdir must die! -- JEH
50 push @opts, "--libexecdir=\${prefix}/lib/" . $self->exec_in_topdir(\&sourcepackage);
51 push @opts, "--disable-maintainer-mode";
52 push @opts, "--disable-dependency-tracking";
53 # Provide --host only if different from --build, as recommended in
54 # autotools-dev README.Debian: When provided (even if equal) autotools
55 # 2.52+ switches to cross-compiling mode.
56 if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
57 ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
58 push @opts, "--host=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE");
61 # XXX JEH the reason it needs to use get_toppath here,
62 # but does not need to in the is_buildable method is not clear,
63 # unless one is familiar with the implementation of its parent
64 # class. I think that speaks to a bad design..
65 doit($self->get_toppath("configure"), @opts, @_);