summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-11-12 05:06:56 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-11-12 05:06:56 +0000
commit5be70dfb578c8793084aa8b4526fad08d68a6155 (patch)
treedf67c1174d33863318f90dbce91f22c7b204038c /scripts
parent13a66f12855066defdbc98f752caa5754a92a490 (diff)
implement target profiles in menuconfig
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5512 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_package_config.pl3
-rwxr-xr-xscripts/gen_target_config.pl116
2 files changed, 116 insertions, 3 deletions
diff --git a/scripts/gen_package_config.pl b/scripts/gen_package_config.pl
index 9c705af56..4ce117c06 100755
--- a/scripts/gen_package_config.pl
+++ b/scripts/gen_package_config.pl
@@ -89,10 +89,13 @@ sub print_category($) {
if ($c > 0) {
$title .= ("." x $c). " ". $pkg->{title};
}
+ print "\tconfig DEFAULT_".$pkg->{name}."\n";
+ print "\t\tbool\n\n";
print "\t";
$pkg->{menu} and print "menu";
print "config PACKAGE_".$pkg->{name}."\n";
print "\t\ttristate \"$title\"\n";
+ print "\t\tdefault y if DEFAULT_".$pkg->{name}."\n";
foreach my $default (split /\s*,\s*/, $pkg->{default}) {
print "\t\tdefault $default\n";
}
diff --git a/scripts/gen_target_config.pl b/scripts/gen_target_config.pl
index c0b83963b..4d0d6b13e 100755
--- a/scripts/gen_target_config.pl
+++ b/scripts/gen_target_config.pl
@@ -10,6 +10,8 @@ use strict;
my @target;
my $target;
+my $profiles;
+my $profile;
sub features(@) {
my $ret;
@@ -30,8 +32,11 @@ sub features(@) {
while (<>) {
chomp;
/^Target:\s*((.+)-(\d+\.\d+))\s*$/ and do {
+ my $conf = uc $3.'_'.$2;
+ $conf =~ tr/\.-/__/;
$target = {
id => $1,
+ conf => $conf,
board => $2,
kernel => $3
};
@@ -56,6 +61,22 @@ while (<>) {
/^Linux-Version:\s*(.+)\s*$/ and $target->{version} = $1;
/^Linux-Release:\s*(.+)\s*$/ and $target->{release} = $1;
/^Linux-Kernel-Arch:\s*(.+)\s*$/ and $target->{karch} = $1;
+ /^Default-Packages:\s*(.+)\s*$/ and do {
+ my @pkgs = split /\s+/, $1;
+ $target->{defaultpkgs} = \@pkgs;
+ };
+ /^Target-Profile:\s*(.+)\s*$/ and do {
+ $profiles = $target->{profiles} or $target->{profiles} = $profiles = [];
+ $profile = {
+ id => $1
+ };
+ push @$profiles, $profile;
+ };
+ /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
+ /^Target-Profile-Packages:\s*(.+)\s*$/ and do {
+ my @pkgs = split /\s+/, $1;
+ $profile->{pkgs} = \@pkgs;
+ };
}
@target = sort {
@@ -63,13 +84,18 @@ while (<>) {
} @target;
+print <<EOF;
+choice
+ prompt "Target System"
+ default LINUX_2_4_BRCM
+
+EOF
+
foreach $target (@target) {
- my $conf = uc $target->{kernel}.'_'.$target->{board};
my $features = features(@{$target->{features}});
my $help = $target->{desc};
chomp $features;
$features .= "\n";
- $conf =~ tr/\.-/__/;
if ($help =~ /\w+/) {
$help =~ s/^\s*/\t /mg;
$help = "\thelp\n$help";
@@ -78,7 +104,7 @@ foreach $target (@target) {
}
print <<EOF
-config LINUX_$conf
+config LINUX_$target->{conf}
bool "$target->{name}"
select $target->{arch}
$features$help
@@ -86,3 +112,87 @@ $features$help
EOF
}
+print <<EOF;
+if DEVEL
+
+config LINUX_2_6_ARM
+ bool "UNSUPPORTED little-endian arm platform"
+ depends BROKEN
+ select LINUX_2_6
+ select arm
+
+config LINUX_2_6_CRIS
+ bool "UNSUPPORTED cris platform"
+ depends BROKEN
+ select LINUX_2_6
+ select cris
+
+config LINUX_2_6_M68K
+ bool "UNSUPPORTED m68k platform"
+ depends BROKEN
+ select LINUX_2_6
+ select m68k
+
+config LINUX_2_6_SH3
+ bool "UNSUPPORTED little-endian sh3 platform"
+ depends BROKEN
+ select LINUX_2_6
+ select sh3
+
+config LINUX_2_6_SH3EB
+ bool "UNSUPPORTED big-endian sh3 platform"
+ depends BROKEN
+ select LINUX_2_6
+ select sh3eb
+
+config LINUX_2_6_SH4
+ bool "UNSUPPORTED little-endian sh4 platform"
+ depends BROKEN
+ select LINUX_2_6
+ select sh4
+
+config LINUX_2_6_SH4EB
+ bool "UNSUPPORTED big-endian sh4 platform"
+ depends BROKEN
+ select LINUX_2_6
+ select sh4eb
+
+config LINUX_2_6_SPARC
+ bool "UNSUPPORTED sparc platform"
+ depends BROKEN
+ select LINUX_2_6
+ select sparc
+
+endif
+
+endchoice
+
+choice
+ prompt "Target Profile"
+
+EOF
+
+foreach $target (@target) {
+ my $profiles;
+
+ $profiles = $target->{profiles} or $profiles = [
+ {
+ id => 'Default',
+ name => 'Default',
+ pkgs => []
+ }
+ ];
+ foreach my $profile (@$profiles) {
+ print <<EOF;
+config LINUX_$target->{conf}_$profile->{id}
+ bool "$profile->{name}"
+ depends LINUX_$target->{conf}
+EOF
+ foreach my $pkg (@{$target->{defaultpkgs}}, @{$profile->{pkgs}}) {
+ print "\tselect DEFAULT_$pkg\n";
+ }
+ print "\n";
+ }
+}
+
+print "endchoice\n";