aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-01-13 17:50:39 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-25 20:24:47 -0500
commite5303c25bfacd745f6c6b99a2604ef4e11926c34 (patch)
tree14f22ac2afc1d6dda125ea38a6c596fdc8687b91 /scripts
parent065449fd56d2f75cc943a6d501b292f6b0e40325 (diff)
kconfig/streamline-config.pl: Simplify backslash line concatination
commit d060d963e88f3e990cec2fe5214de49de9a49eca upstream. Simplify the way lines ending with backslashes (continuation) in Makefiles is parsed. This is needed to implement a necessary fix. Tested-by: Thomas Lange <thomas-lange2@gmx.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/streamline_config.pl25
1 files changed, 12 insertions, 13 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index a4fe923c013..f25809200a9 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -245,17 +245,22 @@ if ($kconfig) {
245# Read all Makefiles to map the configs to the objects 245# Read all Makefiles to map the configs to the objects
246foreach my $makefile (@makefiles) { 246foreach my $makefile (@makefiles) {
247 247
248 my $cont = 0; 248 my $line = "";
249 249
250 open(MIN,$makefile) || die "Can't open $makefile"; 250 open(MIN,$makefile) || die "Can't open $makefile";
251 while (<MIN>) { 251 while (<MIN>) {
252 my $objs; 252 # if this line ends with a backslash, continue
253 253 chomp;
254 # is this a line after a line with a backslash? 254 if (/^(.*)\\$/) {
255 if ($cont && /(\S.*)$/) { 255 $line .= $1;
256 $objs = $1; 256 next;
257 } 257 }
258 $cont = 0; 258
259 $line .= $_;
260 $_ = $line;
261 $line = "";
262
263 my $objs;
259 264
260 # collect objects after obj-$(CONFIG_FOO_BAR) 265 # collect objects after obj-$(CONFIG_FOO_BAR)
261 if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) { 266 if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
@@ -263,12 +268,6 @@ foreach my $makefile (@makefiles) {
263 $objs = $2; 268 $objs = $2;
264 } 269 }
265 if (defined($objs)) { 270 if (defined($objs)) {
266 # test if the line ends with a backslash
267 if ($objs =~ m,(.*)\\$,) {
268 $objs = $1;
269 $cont = 1;
270 }
271
272 foreach my $obj (split /\s+/,$objs) { 271 foreach my $obj (split /\s+/,$objs) {
273 $obj =~ s/-/_/g; 272 $obj =~ s/-/_/g;
274 if ($obj =~ /(.*)\.o$/) { 273 if ($obj =~ /(.*)\.o$/) {