Add support for autotools.

I am now aware of no major build system that couldn't be supported by
kdesrc-build...

The excuse in this case is the same as for last commit, namely to allow
for libraptor-2 support (their build system has CMake support, but it's
incomplete).
wilder
Michael Pyne 14 years ago
parent c29948e3a5
commit 3b22217486
  1. 5
      doc/index.docbook
  2. 50
      kdesrc-build

@ -2067,6 +2067,11 @@ the auto-detection. In this case you can manually specify the correct build type
<listitem><para>Used to build modules that use plain Makefiles and that do not
require any special configuration.</para></listitem>
</varlistentry>
<varlistentry>
<term>autotools</term>
<listitem><para>This is the standard configuration tool used for most Free and
open-source software not in any of the other categories.</para></listitem>
</varlistentry>
</variablelist>
</entry>

@ -4497,6 +4497,53 @@ EOF
}
# }}}
# package AutotoolsBuildSystem {{{
{
package AutotoolsBuildSystem;
# This is a module used to support configuring with autotools.
use parent -norequire, 'GenericBuildSystem';
ksb::Debug->import();
ksb::Util->import();
use List::Util qw(first);
sub name
{
return 'autotools';
}
# Return value style: boolean
sub configureInternal
{
my $self = assert_isa(shift, 'AutotoolsBuildSystem');
my $module = $self->module();
my $sourcedir = $module->fullpath('source');
my $installdir = $module->installationPath();
# 'module'-limited option grabbing can return undef, so use //
# to convert to empty string in that case.
my @bootstrapOptions = split_quoted_on_whitespace(
$module->getOption('configure-flags', 'module') // '');
p_chdir($module->fullpath('build'));
my $configureCommand = first { -e "$sourcedir/$_" } qw(configure autogen.sh);
croak_internal("No configure command available") unless $configureCommand;
return log_command($module, 'configure', [
$configureCommand, "--prefix=$installdir",
@bootstrapOptions
]) == 0;
}
1;
}
# }}}
# package CMakeBootstrapSystem {{{
{
package CMakeBootstrapSystem;
@ -5194,6 +5241,7 @@ EOF
when('cmake-bootstrap') { $buildSystem = CMakeBootstrapSystem -> new($self); }
when('kde') { $buildSystem = KDEBuildSystem -> new($self); }
when('qt') { $buildSystem = QtBuildSystem -> new($self); }
when('autotools') { $buildSystem = AutotoolsBuildSystem -> new($self); }
default { croak_runtime("Invalid build system $name requested"); }
}
@ -5248,7 +5296,7 @@ EOF
if (!$buildType &&
(-e "$sourceDir/configure" || -e "$sourceDir/autogen.sh"))
{
croak_internal('The autotools build system is unsupported');
$buildType = AutotoolsBuildSystem->new($self);
}
# Don't just assume the build system is KDE-based...

Loading…
Cancel
Save