diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-09-09 22:39:10 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-09-09 22:39:10 +0000 |
commit | fb68d6c468c3ef13f94fea1c9ee32ea9cdcba836 (patch) | |
tree | 8e6447ce03cce1f07e58799761ccb3363bf3876c | |
parent | d015eb9e31f9f4defaf978eaec829d09d5308823 (diff) | |
download | upstream-fb68d6c468c3ef13f94fea1c9ee32ea9cdcba836.tar.gz upstream-fb68d6c468c3ef13f94fea1c9ee32ea9cdcba836.tar.bz2 upstream-fb68d6c468c3ef13f94fea1c9ee32ea9cdcba836.zip |
define extra config symbols for targets containing multiple subtargets
SVN-Revision: 8724
-rwxr-xr-x | scripts/metadata.pl | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/scripts/metadata.pl b/scripts/metadata.pl index 2fcbf82dfa..695abf7b32 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -5,6 +5,7 @@ my %package; my %srcpackage; my %category; my %subdir; +my %board; sub get_multiline { my $prefix = shift; @@ -18,21 +19,28 @@ sub get_multiline { return $str; } +sub confstr($) { + my $conf = shift; + $conf =~ tr#/\.\-/#___#; + return $conf; +} + sub parse_target_metadata() { my ($target, @target, $profile); while (<>) { chomp; /^Target:\s*(.+)\s*$/ and do { - my $conf = $1; - $conf =~ tr#/\.\-/#___#; $target = { id => $1, - conf => $conf, + conf => confstr($1), profiles => [] }; 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-Name:\s*(.+)\s*$/ and $target->{name} = $1; /^Target-Path:\s*(.+)\s*$/ and $target->{path} = $1; @@ -247,14 +255,16 @@ EOF undef $help; } - print <<EOF + print <<EOF; config TARGET_$target->{conf} bool "$target->{name}" select $target->{arch} select LINUX_$kernel -$features$help - EOF + if ($target->{id} ne $target->{board}) { + print "\tselect TARGET_".$target->{boardconf}."\n"; + } + print "$features$help\n\n" } print <<EOF; @@ -266,6 +276,15 @@ EOF foreach my $target (@target) { 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; choice |