“ce723951a5093a47b312d828c2b975c4cf3d5a5b”上不存在“...usb/gadget/git@gitcode.net:openharmony/kernel_linux.git”
提交 0b58a99e 编写于 作者: S Steven Rostedt 提交者: Steven Rostedt

localmodconfig: Comments and cleanup for streamline_config.pl

Added some more comments and cleaned up part of the the code to use
a named variable instead of one of the special $1 perl variables.

No functional changes.
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 485802a6
...@@ -186,6 +186,7 @@ sub read_kconfig { ...@@ -186,6 +186,7 @@ sub read_kconfig {
$state = "NEW"; $state = "NEW";
$config = $2; $config = $2;
# Add depends for 'if' nesting
for (my $i = 0; $i < $iflevel; $i++) { for (my $i = 0; $i < $iflevel; $i++) {
if ($i) { if ($i) {
$depends{$config} .= " " . $ifdeps[$i]; $depends{$config} .= " " . $ifdeps[$i];
...@@ -204,10 +205,11 @@ sub read_kconfig { ...@@ -204,10 +205,11 @@ sub read_kconfig {
# Get the configs that select this config # Get the configs that select this config
} elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) { } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {
if (defined($selects{$1})) { my $conf = $1;
$selects{$1} .= " " . $config; if (defined($selects{$conf})) {
$selects{$conf} .= " " . $config;
} else { } else {
$selects{$1} = $config; $selects{$conf} = $config;
} }
# configs without prompts must be selected # configs without prompts must be selected
...@@ -250,6 +252,7 @@ if ($kconfig) { ...@@ -250,6 +252,7 @@ if ($kconfig) {
read_kconfig($kconfig); read_kconfig($kconfig);
} }
# Makefiles can use variables to define their dependencies
sub convert_vars { sub convert_vars {
my ($line, %vars) = @_; my ($line, %vars) = @_;
...@@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) { ...@@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) {
my $objs; my $objs;
# Convert variables in a line (could define configs)
$_ = convert_vars($_, %make_vars); $_ = convert_vars($_, %make_vars);
# collect objects after obj-$(CONFIG_FOO_BAR) # collect objects after obj-$(CONFIG_FOO_BAR)
...@@ -373,7 +377,8 @@ while (<LIN>) { ...@@ -373,7 +377,8 @@ while (<LIN>) {
close (LIN); close (LIN);
# add to the configs hash all configs that are needed to enable # add to the configs hash all configs that are needed to enable
# a loaded module. # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o
# where we know we need bar.o so we add FOO to the list.
my %configs; my %configs;
foreach my $module (keys(%modules)) { foreach my $module (keys(%modules)) {
if (defined($objects{$module})) { if (defined($objects{$module})) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册