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;
11 B<autoconf> - GNU Autoconf (configure)
15 B<dh_auto_*> [B<--buildsystem>=I<autoconf>] ...
19 GNU Autoconf is a popular cross-platform build system. Autoconf F<configure>
20 script prepares the source for building and generates necessary F<Makefile>s
21 and other temporary files in the build directory. Then a standard set of
22 make targets needs to be executed in the build directory to complete source
23 build process. GNU Autoconf build system can be typically identified by
24 presence of the F<configure> script in the source directory.
28 Both in source (default) and out of source tree building modes are supported.
29 However, please note that some original source packages might not be compatible
30 with out of source tree building mode of Autoconf and hence build process may
31 fail later even if the I<configure> step succeeds.
38 use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value sourcepackage);
39 use base 'Debian::Debhelper::Buildsystem::makefile';
42 "GNU Autoconf (configure)"
45 sub check_auto_buildable {
49 # Handle configure; the rest - next class
50 if ($step eq "configure") {
51 return -x $this->get_sourcepath("configure");
62 Execute F<configure> from the source directory with working directory set to
63 the build directory. A set of standard arguments are passed to the F<configure>
66 --build=`dpkg_architecture -qDEB_BUILD_GNU_TYPE`
68 --includedir=${prefix}/include
69 --mandir=${prefix}/share/man
70 --infodir=${prefix}/share/info
73 --libexecdir=${prefix}/lib/$name_of_debian_source_package
74 --disable-maintainer-mode
75 --disable-dependency-tracking
76 --host=`dpkg_architecture -qDEB_HOST_GNU_TYPE` (if different from --build)
78 =item I<Auto-selection>
80 If executable file F<configure> exists in the source directory.
88 # Standard set of options for configure.
90 push @opts, "--build=" . dpkg_architecture_value("DEB_BUILD_GNU_TYPE");
91 push @opts, "--prefix=/usr";
92 push @opts, "--includedir=\${prefix}/include";
93 push @opts, "--mandir=\${prefix}/share/man";
94 push @opts, "--infodir=\${prefix}/share/info";
95 push @opts, "--sysconfdir=/etc";
96 push @opts, "--localstatedir=/var";
97 push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage();
98 push @opts, "--disable-maintainer-mode";
99 push @opts, "--disable-dependency-tracking";
100 # Provide --host only if different from --build, as recommended in
101 # autotools-dev README.Debian: When provided (even if equal)
102 # autoconf 2.52+ switches to cross-compiling mode.
103 if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE")
104 ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) {
105 push @opts, "--host=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE");
108 $this->mkdir_builddir();
109 $this->doit_in_builddir($this->get_source_rel2builddir("configure"), @opts, @_);
118 Execute C<make> in the build directory. See I<makefile> build system
119 documentation for more information.
121 =item I<Auto-selection>
123 It is normal for the I<makefile> build system to be auto-selected at this step.
133 Execute either C<make test> or C<make check> in the build directory. See
134 I<makefile> build system documentation for more information.
136 =item I<Auto-selection>
138 It is normal for the I<makefile> build system to be auto-selected at this step.
148 Execute C<make install DESTDIR=$destdir> in the build directory with $destdir
149 set to the appropriate temporary installation directory. See I<makefile> build
150 system documentation for more information.
152 =item I<Auto-selection>
154 It is normal for the I<makefile> build system to be auto-selected at this step.
164 Remove the build directory if building out of source tree or execute C<make
165 distclean> if building in source. See I<makefile> build system documentation
166 for more information.
168 =item I<Auto-selection>
170 It is normal for the I<makefile> build system to be auto-selected at this step.
176 L<dh_auto_makefile(7)>
182 Joey Hess <joeyh@debian.org>
183 Modestas Vainius <modestas@vainius.eu>