diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-05-28 11:32:10 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-05-28 11:34:15 +0200 |
commit | eb027788cf6a073f54d48f9dad92d66bf1dbf53c (patch) | |
tree | 77000876b858180c77377d3a43e65877f3d087e9 /tools/autoconf.pl | |
parent | afc96087f8a6282cf732d142a4db7a3d604d39d8 (diff) | |
download | rockbox-eb027788cf6a073f54d48f9dad92d66bf1dbf53c.tar.gz rockbox-eb027788cf6a073f54d48f9dad92d66bf1dbf53c.tar.bz2 rockbox-eb027788cf6a073f54d48f9dad92d66bf1dbf53c.zip |
tools/autoconf.pl: 2 enhancements
* -y param to not ask for confirmation
* detect <buildtype>-<target> as well
Change-Id: Ie63f5882560cd7c7ee1c00f153e756b8695d567f
Diffstat (limited to 'tools/autoconf.pl')
-rwxr-xr-x | tools/autoconf.pl | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/tools/autoconf.pl b/tools/autoconf.pl index 3dae96502f..24efc5aaf3 100755 --- a/tools/autoconf.pl +++ b/tools/autoconf.pl @@ -41,15 +41,17 @@ sub doconfigure { } $command = "${srcdir}/configure --type=${type} --target=${target}"; %typenames = ("n" => "Normal", "s" => "Simulator", "b" => "Bootloader" ); - print "Rockbox autoconf: \n\tTarget: $target \n\tType: $typenames{$type} \nCorrect? [Y/n] "; - chomp($response = <>); - if ($response eq "") { - $response = "y"; - } - if ($response ne "y" && $response ne "Y") { - print "autoconf: Aborting\n"; - exit(0); - } + unless (@ARGV[0] eq "-y") { + print "Rockbox autoconf: \n\tTarget: $target \n\tType: $typenames{$type} \nCorrect? [Y/n] "; + chomp($response = <>); + if ($response eq "") { + $response = "y"; + } + if ($response ne "y" && $response ne "Y") { + print "autoconf: Aborting\n"; + exit(0); + } + } system($command); } @@ -59,18 +61,22 @@ sub buildtype { $build = "s"; } elsif ($text eq "boot") { $build = "b"; - } else { + } elsif ($text eq "build") { $build = "n"; - } + } else { + $build = ""; + } return $build; } if ($test =~ /(.*)-(.*)/) { - $target = $1; - $build = buildtype($2); - doconfigure($target, $build); -} + if (buildtype($2)) { + doconfigure($1, buildtype($2)); + } elsif (buildtype($1)) { + doconfigure($2, buildtype($1)); + } +} elsif ($test =~ /(.*)/) { $target = $1; |