aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/streamline_config.pl26
1 files changed, 24 insertions, 2 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 5c1ce8761205..ab4985f7af79 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -113,6 +113,10 @@ sub find_config {
113 113
114find_config; 114find_config;
115 115
116# Read in the entire config file into config_file
117my @config_file = <CIN>;
118close CIN;
119
116# Parse options 120# Parse options
117my $localmodconfig = 0; 121my $localmodconfig = 0;
118my $localyesconfig = 0; 122my $localyesconfig = 0;
@@ -392,7 +396,20 @@ foreach my $module (keys(%modules)) {
392 } 396 }
393} 397}
394 398
399# Read the current config, and see what is enabled. We want to
400# ignore configs that we would not enable anyway.
401
402my %orig_configs;
395my $valid = "A-Za-z_0-9"; 403my $valid = "A-Za-z_0-9";
404
405foreach my $line (@config_file) {
406 $_ = $line;
407
408 if (/(CONFIG_[$valid]*)=(m|y)/) {
409 $orig_configs{$1} = $2;
410 }
411}
412
396my $repeat = 1; 413my $repeat = 1;
397 414
398# 415#
@@ -414,6 +431,11 @@ sub parse_config_dep_select
414 431
415 $p =~ s/^[^$valid]*[$valid]+//; 432 $p =~ s/^[^$valid]*[$valid]+//;
416 433
434 # We only need to process if the depend config is a module
435 if (!defined($orig_configs{$conf}) || !$orig_configs{conf} eq "m") {
436 next;
437 }
438
417 if (!defined($configs{$conf})) { 439 if (!defined($configs{$conf})) {
418 # We must make sure that this config has its 440 # We must make sure that this config has its
419 # dependencies met. 441 # dependencies met.
@@ -450,7 +472,8 @@ my %setconfigs;
450 472
451# Finally, read the .config file and turn off any module enabled that 473# Finally, read the .config file and turn off any module enabled that
452# we could not find a reason to keep enabled. 474# we could not find a reason to keep enabled.
453while(<CIN>) { 475foreach my $line (@config_file) {
476 $_ = $line;
454 477
455 if (/CONFIG_IKCONFIG/) { 478 if (/CONFIG_IKCONFIG/) {
456 if (/# CONFIG_IKCONFIG is not set/) { 479 if (/# CONFIG_IKCONFIG is not set/) {
@@ -478,7 +501,6 @@ while(<CIN>) {
478 } 501 }
479 print; 502 print;
480} 503}
481close(CIN);
482 504
483# Integrity check, make sure all modules that we want enabled do 505# Integrity check, make sure all modules that we want enabled do
484# indeed have their configs set. 506# indeed have their configs set.