tools/autoconf.pl: 2 enhancements

* -y param to not ask for confirmation
* detect <buildtype>-<target> as well

Change-Id: Ie63f5882560cd7c7ee1c00f153e756b8695d567f
This commit is contained in:
Thomas Martitz 2012-05-28 11:32:10 +02:00
parent afc96087f8
commit eb027788cf

View file

@ -41,6 +41,7 @@ sub doconfigure {
} }
$command = "${srcdir}/configure --type=${type} --target=${target}"; $command = "${srcdir}/configure --type=${type} --target=${target}";
%typenames = ("n" => "Normal", "s" => "Simulator", "b" => "Bootloader" ); %typenames = ("n" => "Normal", "s" => "Simulator", "b" => "Bootloader" );
unless (@ARGV[0] eq "-y") {
print "Rockbox autoconf: \n\tTarget: $target \n\tType: $typenames{$type} \nCorrect? [Y/n] "; print "Rockbox autoconf: \n\tTarget: $target \n\tType: $typenames{$type} \nCorrect? [Y/n] ";
chomp($response = <>); chomp($response = <>);
if ($response eq "") { if ($response eq "") {
@ -50,6 +51,7 @@ sub doconfigure {
print "autoconf: Aborting\n"; print "autoconf: Aborting\n";
exit(0); exit(0);
} }
}
system($command); system($command);
} }
@ -59,17 +61,21 @@ sub buildtype {
$build = "s"; $build = "s";
} elsif ($text eq "boot") { } elsif ($text eq "boot") {
$build = "b"; $build = "b";
} else { } elsif ($text eq "build") {
$build = "n"; $build = "n";
} else {
$build = "";
} }
return $build; return $build;
} }
if ($test =~ /(.*)-(.*)/) if ($test =~ /(.*)-(.*)/)
{ {
$target = $1; if (buildtype($2)) {
$build = buildtype($2); doconfigure($1, buildtype($2));
doconfigure($target, $build); } elsif (buildtype($1)) {
doconfigure($2, buildtype($1));
}
} }
elsif ($test =~ /(.*)/) elsif ($test =~ /(.*)/)
{ {