diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 12:53:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 12:53:53 +0000 |
commit | 90169463f86997737ed5b9c0ea2b311cd3b056b7 (patch) | |
tree | 281a0f8d9850ea58cf2a3ddb8bf087fb52520925 /lib/Debian/Debhelper/Buildsystem/autoconf.pm | |
parent | Initial commit. (diff) | |
download | debhelper-8a9bdd902baff5b8ab5c3bdb664b77a41c4b9f3e.tar.xz debhelper-8a9bdd902baff5b8ab5c3bdb664b77a41c4b9f3e.zip |
Adding upstream version 13.15.3.upstream/13.15.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/Debian/Debhelper/Buildsystem/autoconf.pm')
-rw-r--r-- | lib/Debian/Debhelper/Buildsystem/autoconf.pm | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/autoconf.pm b/lib/Debian/Debhelper/Buildsystem/autoconf.pm new file mode 100644 index 0000000..8752ea1 --- /dev/null +++ b/lib/Debian/Debhelper/Buildsystem/autoconf.pm @@ -0,0 +1,98 @@ +# A debhelper build system class for handling Autoconf based projects +# +# Copyright: © 2008 Joey Hess +# © 2008-2009 Modestas Vainius +# License: GPL-2+ + +package Debian::Debhelper::Buildsystem::autoconf; + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib qw(%dh dpkg_architecture_value get_buildoption sourcepackage compat); +use parent qw(Debian::Debhelper::Buildsystem::makefile); + +sub DESCRIPTION { + "GNU Autoconf (configure)" +} + +sub check_auto_buildable { + my $this=shift; + my ($step)=@_; + + return 0 unless -f $this->get_sourcepath("configure") && + -x _; + + # Handle configure explicitly; inherit the rest + return 1 if $step eq "configure"; + return $this->SUPER::check_auto_buildable(@_); +} + +sub configure { + my $this=shift; + + # Standard set of options for configure. + my @opts; + push @opts, "--build=" . dpkg_architecture_value("DEB_BUILD_GNU_TYPE"); + push @opts, "--prefix=/usr"; + push @opts, "--includedir=\${prefix}/include"; + push @opts, "--mandir=\${prefix}/share/man"; + push @opts, "--infodir=\${prefix}/share/info"; + push @opts, "--sysconfdir=/etc"; + push @opts, "--localstatedir=/var"; + # We pass --disable/enable-* options that might be unknown, so we + # should not emit warnings. + push @opts, "--disable-option-checking"; + if ($dh{QUIET}) { + push @opts, "--enable-silent-rules"; + } else { + push @opts, "--disable-silent-rules"; + } + 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") if compat(11); + } + else { + push(@opts, "--libexecdir=\${prefix}/lib") if compat(11); + } + } + else { + push @opts, "--libexecdir=\${prefix}/lib/" . sourcepackage(); + } + push @opts, "--runstatedir=/run" if not compat(10); + push @opts, "--disable-maintainer-mode"; + push @opts, "--disable-dependency-tracking"; + # Provide --host only if different from --build, as recommended in + # autotools-dev README.Debian: When provided (even if equal) + # autoconf 2.52+ switches to cross-compiling mode. + if (dpkg_architecture_value("DEB_BUILD_GNU_TYPE") + ne dpkg_architecture_value("DEB_HOST_GNU_TYPE")) { + push @opts, "--host=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE"); + } + + $this->mkdir_builddir(); + 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 $@; + } +} + +sub test { + my $this=shift; + + my $parallel = $this->get_parallel(); + my @autotest; + push @autotest, "-j$parallel"; + push @autotest, "--verbose" if not get_buildoption("terse"); + $this->make_first_existing_target(['test', 'check'], + "TESTSUITEFLAGS=@autotest", + "VERBOSE=1", @_); +} + +1 |