summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-05-28 11:32:10 +0200
committerThomas Martitz <kugel@rockbox.org>2012-05-28 11:34:15 +0200
commiteb027788cf6a073f54d48f9dad92d66bf1dbf53c (patch)
tree77000876b858180c77377d3a43e65877f3d087e9
parentafc96087f8a6282cf732d142a4db7a3d604d39d8 (diff)
downloadrockbox-eb027788cf6a073f54d48f9dad92d66bf1dbf53c.tar.gz
rockbox-eb027788cf6a073f54d48f9dad92d66bf1dbf53c.zip
tools/autoconf.pl: 2 enhancements
* -y param to not ask for confirmation * detect <buildtype>-<target> as well Change-Id: Ie63f5882560cd7c7ee1c00f153e756b8695d567f
-rwxr-xr-xtools/autoconf.pl36
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 {
41 } 41 }
42 $command = "${srcdir}/configure --type=${type} --target=${target}"; 42 $command = "${srcdir}/configure --type=${type} --target=${target}";
43 %typenames = ("n" => "Normal", "s" => "Simulator", "b" => "Bootloader" ); 43 %typenames = ("n" => "Normal", "s" => "Simulator", "b" => "Bootloader" );
44 print "Rockbox autoconf: \n\tTarget: $target \n\tType: $typenames{$type} \nCorrect? [Y/n] "; 44 unless (@ARGV[0] eq "-y") {
45 chomp($response = <>); 45 print "Rockbox autoconf: \n\tTarget: $target \n\tType: $typenames{$type} \nCorrect? [Y/n] ";
46 if ($response eq "") { 46 chomp($response = <>);
47 $response = "y"; 47 if ($response eq "") {
48 } 48 $response = "y";
49 if ($response ne "y" && $response ne "Y") { 49 }
50 print "autoconf: Aborting\n"; 50 if ($response ne "y" && $response ne "Y") {
51 exit(0); 51 print "autoconf: Aborting\n";
52 } 52 exit(0);
53 }
54 }
53 system($command); 55 system($command);
54} 56}
55 57
@@ -59,18 +61,22 @@ sub buildtype {
59 $build = "s"; 61 $build = "s";
60 } elsif ($text eq "boot") { 62 } elsif ($text eq "boot") {
61 $build = "b"; 63 $build = "b";
62 } else { 64 } elsif ($text eq "build") {
63 $build = "n"; 65 $build = "n";
64 } 66 } else {
67 $build = "";
68 }
65 return $build; 69 return $build;
66} 70}
67 71
68if ($test =~ /(.*)-(.*)/) 72if ($test =~ /(.*)-(.*)/)
69{ 73{
70 $target = $1; 74 if (buildtype($2)) {
71 $build = buildtype($2); 75 doconfigure($1, buildtype($2));
72 doconfigure($target, $build); 76 } elsif (buildtype($1)) {
73} 77 doconfigure($2, buildtype($1));
78 }
79}
74elsif ($test =~ /(.*)/) 80elsif ($test =~ /(.*)/)
75{ 81{
76 $target = $1; 82 $target = $1;