]> Pileus Git - ~andy/linux/commitdiff
localmodconfig: Add config depends by default settings
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Wed, 18 Dec 2013 17:35:20 +0000 (12:35 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 20 Dec 2013 22:02:44 +0000 (17:02 -0500)
Currently localmodconfig will miss dependencies from the default option.
For example:

config FOO
default y if BAR || ZOO

If FOO is needed for a module and is set to '=m', and so are BAR or ZOO,
localmodconfig will not see that BOO or ZOO are also needed for the foo
module, and will incorrectly disable them.

Link: http://lkml.kernel.org/r/20131218175137.162937350@goodmis.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
scripts/kconfig/streamline_config.pl

index 4606cdfb859d59ac71a8e6d353a33d6f2a7110a0..31331723e810746d08f46c01928c20b2555018a8 100644 (file)
@@ -219,6 +219,13 @@ sub read_kconfig {
            $depends{$config} = $1;
        } elsif ($state eq "DEP" && /^\s*depends\s+on\s+(.*)$/) {
            $depends{$config} .= " " . $1;
+       } elsif ($state eq "DEP" && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) {
+           my $dep = $3;
+           if ($dep !~ /^\s*(y|m|n)\s*$/) {
+               $dep =~ s/.*\sif\s+//;
+               $depends{$config} .= " " . $dep;
+               dprint "Added default depends $dep to $config\n";
+           }
 
        # Get the configs that select this config
        } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {