]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - scripts/kconfig/streamline_config.pl
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mv-sheeva.git] / scripts / kconfig / streamline_config.pl
index 3c63aa943ee3db7abca36092369f6aa2ce681197..fd81fc33d6338858fc8352c82034937f26010ce8 100644 (file)
@@ -42,6 +42,8 @@
 #    mv config_strip .config
 #    make oldconfig
 #
+use strict;
+
 my $config = ".config";
 
 my $uname = `uname -r`;
@@ -123,7 +125,6 @@ my %selects;
 my %prompts;
 my %objects;
 my $var;
-my $cont = 0;
 my $iflevel = 0;
 my @ifdeps;
 
@@ -137,6 +138,9 @@ sub read_kconfig {
     my $config;
     my @kconfigs;
 
+    my $cont = 0;
+    my $line;
+
     my $source = "$ksource/$kconfig";
     my $last_source = "";
 
@@ -151,15 +155,28 @@ 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;
        }
 
        # configs found
-       if (/^\s*config\s+(\S+)\s*$/) {
+       if (/^\s*(menu)?config\s+(\S+)\s*$/) {
            $state = "NEW";
-           $config = $1;
+           $config = $2;
 
            for (my $i = 0; $i < $iflevel; $i++) {
                if ($i) {
@@ -228,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;
@@ -291,7 +310,7 @@ if (defined($lsmod_file)) {
     # see what modules are loaded on this system
     my $lsmod;
 
-    foreach $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) {
+    foreach my $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) {
        if ( -x "$dir/lsmod" ) {
            $lsmod = "$dir/lsmod";
            last;