Skip to content

Commit

Permalink
kconfig: Fix streamline_config to read multi line deps in Kconfig files
Browse files Browse the repository at this point in the history
I noticed that some Kconfig files have multi line dependencies
that continue with a backslash. Those dependencies on the next
line will be missed by streamline_config.

For example:

config CS89x0
	tristate "CS89x0 support"
	depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \
		|| ARCH_IXDP2X01 || MACH_MX31ADS)

The "|| ARCH_IXDP2X01 || MACH_MX31ADS)" will not be processed.

This patch adds code to handle this case.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Oct 29, 2010
1 parent cf5a189 commit 20d1904
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ sub find_config {
my %prompts;
my %objects;
my $var;
my $cont = 0;
my $iflevel = 0;
my @ifdeps;

Expand All @@ -139,6 +138,9 @@ sub read_kconfig {
my $config;
my @kconfigs;

my $cont = 0;
my $line;

my $source = "$ksource/$kconfig";
my $last_source = "";

Expand All @@ -153,6 +155,19 @@ sub read_kconfig {
while (<KIN>) {
chomp;

# Make sure that lines ending with \ continue
if ($cont) {
$_ = $line . " " . $_;
}

if (s/\\$//) {
$cont = 1;
$line = $_;
next;
}

$cont = 0;

# collect any Kconfig sources
if (/^source\s*"(.*)"/) {
$kconfigs[$#kconfigs+1] = $1;
Expand Down Expand Up @@ -230,6 +245,8 @@ sub read_kconfig {
# Read all Makefiles to map the configs to the objects
foreach my $makefile (@makefiles) {

my $cont = 0;

open(MIN,$makefile) || die "Can't open $makefile";
while (<MIN>) {
my $objs;
Expand Down

0 comments on commit 20d1904

Please sign in to comment.