define extra config symbols for targets containing multiple subtargets
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8724 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
4d1536df48
commit
2286814531
|
@ -5,6 +5,7 @@ my %package;
|
||||||
my %srcpackage;
|
my %srcpackage;
|
||||||
my %category;
|
my %category;
|
||||||
my %subdir;
|
my %subdir;
|
||||||
|
my %board;
|
||||||
|
|
||||||
sub get_multiline {
|
sub get_multiline {
|
||||||
my $prefix = shift;
|
my $prefix = shift;
|
||||||
|
@ -18,21 +19,28 @@ sub get_multiline {
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub confstr($) {
|
||||||
|
my $conf = shift;
|
||||||
|
$conf =~ tr#/\.\-/#___#;
|
||||||
|
return $conf;
|
||||||
|
}
|
||||||
|
|
||||||
sub parse_target_metadata() {
|
sub parse_target_metadata() {
|
||||||
my ($target, @target, $profile);
|
my ($target, @target, $profile);
|
||||||
while (<>) {
|
while (<>) {
|
||||||
chomp;
|
chomp;
|
||||||
/^Target:\s*(.+)\s*$/ and do {
|
/^Target:\s*(.+)\s*$/ and do {
|
||||||
my $conf = $1;
|
|
||||||
$conf =~ tr#/\.\-/#___#;
|
|
||||||
$target = {
|
$target = {
|
||||||
id => $1,
|
id => $1,
|
||||||
conf => $conf,
|
conf => confstr($1),
|
||||||
profiles => []
|
profiles => []
|
||||||
};
|
};
|
||||||
push @target, $target;
|
push @target, $target;
|
||||||
};
|
};
|
||||||
/^Target-Board:\s*(.+)\s*$/ and $target->{board} = $1;
|
/^Target-Board:\s*(.+)\s*$/ and do {
|
||||||
|
$target->{board} = $1;
|
||||||
|
$target->{boardconf} = confstr($1);
|
||||||
|
};
|
||||||
/^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1;
|
/^Target-Kernel:\s*(\d+\.\d+)\s*$/ and $target->{kernel} = $1;
|
||||||
/^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
|
/^Target-Name:\s*(.+)\s*$/ and $target->{name} = $1;
|
||||||
/^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
|
/^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1;
|
||||||
|
@ -247,14 +255,16 @@ EOF
|
||||||
undef $help;
|
undef $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
print <<EOF
|
print <<EOF;
|
||||||
config TARGET_$target->{conf}
|
config TARGET_$target->{conf}
|
||||||
bool "$target->{name}"
|
bool "$target->{name}"
|
||||||
select $target->{arch}
|
select $target->{arch}
|
||||||
select LINUX_$kernel
|
select LINUX_$kernel
|
||||||
$features$help
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
if ($target->{id} ne $target->{board}) {
|
||||||
|
print "\tselect TARGET_".$target->{boardconf}."\n";
|
||||||
|
}
|
||||||
|
print "$features$help\n\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
|
@ -266,6 +276,15 @@ EOF
|
||||||
foreach my $target (@target) {
|
foreach my $target (@target) {
|
||||||
print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
|
print "\t\tdefault \"".$target->{board}."\" if TARGET_".$target->{conf}."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# add hidden target config options
|
||||||
|
foreach my $target (@target) {
|
||||||
|
next if $board{$target->{board}};
|
||||||
|
if ($target->{id} ne $target->{board}) {
|
||||||
|
print "\nconfig TARGET_".$target->{boardconf}."\n\tbool\n";
|
||||||
|
$board{$target->{board}} = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
|
|
||||||
choice
|
choice
|
||||||
|
|
Loading…
Reference in New Issue