diff mbox

[4/5,4/5] kconfig: Fix streamline_config to read multi line deps in Kconfig files

Message ID 20101029054424.291908153@goodmis.org (mailing list archive)
State New, archived
Headers show

Commit Message

Steven Rostedt Oct. 29, 2010, 5:43 a.m. UTC
None
diff mbox

Patch

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 883748c..ebba407 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -125,7 +125,6 @@  my %selects;
 my %prompts;
 my %objects;
 my $var;
-my $cont = 0;
 my $iflevel = 0;
 my @ifdeps;
 
@@ -139,6 +138,9 @@  sub read_kconfig {
     my $config;
     my @kconfigs;
 
+    my $cont = 0;
+    my $line;
+
     my $source = "$ksource/$kconfig";
     my $last_source = "";
 
@@ -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;
@@ -230,6 +245,8 @@  if ($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;