# mv config_strip .config
# make oldconfig
#
+use strict;
+
my $config = ".config";
my $uname = `uname -r`;
my %prompts;
my %objects;
my $var;
-my $cont = 0;
my $iflevel = 0;
my @ifdeps;
my $config;
my @kconfigs;
+ my $cont = 0;
+ my $line;
+
my $source = "$ksource/$kconfig";
my $last_source = "";
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) {
# 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;
# 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;