]>
Commit | Line | Data |
---|---|---|
5e3c2993 GKH |
1 | From d060d963e88f3e990cec2fe5214de49de9a49eca Mon Sep 17 00:00:00 2001 |
2 | From: Steven Rostedt <srostedt@redhat.com> | |
3 | Date: Fri, 13 Jan 2012 17:50:39 -0500 | |
4 | Subject: kconfig/streamline-config.pl: Simplify backslash line concatination | |
5 | ||
6 | From: Steven Rostedt <srostedt@redhat.com> | |
7 | ||
8 | commit d060d963e88f3e990cec2fe5214de49de9a49eca upstream. | |
9 | ||
10 | Simplify the way lines ending with backslashes (continuation) in Makefiles | |
11 | is parsed. This is needed to implement a necessary fix. | |
12 | ||
13 | Tested-by: Thomas Lange <thomas-lange2@gmx.de> | |
14 | Signed-off-by: Steven Rostedt <rostedt@goodmis.org> | |
15 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
16 | ||
17 | --- | |
18 | scripts/kconfig/streamline_config.pl | 25 ++++++++++++------------- | |
19 | 1 file changed, 12 insertions(+), 13 deletions(-) | |
20 | ||
21 | --- a/scripts/kconfig/streamline_config.pl | |
22 | +++ b/scripts/kconfig/streamline_config.pl | |
23 | @@ -245,17 +245,22 @@ if ($kconfig) { | |
24 | # Read all Makefiles to map the configs to the objects | |
25 | foreach my $makefile (@makefiles) { | |
26 | ||
27 | - my $cont = 0; | |
28 | + my $line = ""; | |
29 | ||
30 | open(MIN,$makefile) || die "Can't open $makefile"; | |
31 | while (<MIN>) { | |
32 | - my $objs; | |
33 | - | |
34 | - # is this a line after a line with a backslash? | |
35 | - if ($cont && /(\S.*)$/) { | |
36 | - $objs = $1; | |
37 | + # if this line ends with a backslash, continue | |
38 | + chomp; | |
39 | + if (/^(.*)\\$/) { | |
40 | + $line .= $1; | |
41 | + next; | |
42 | } | |
43 | - $cont = 0; | |
44 | + | |
45 | + $line .= $_; | |
46 | + $_ = $line; | |
47 | + $line = ""; | |
48 | + | |
49 | + my $objs; | |
50 | ||
51 | # collect objects after obj-$(CONFIG_FOO_BAR) | |
52 | if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) { | |
53 | @@ -263,12 +268,6 @@ foreach my $makefile (@makefiles) { | |
54 | $objs = $2; | |
55 | } | |
56 | if (defined($objs)) { | |
57 | - # test if the line ends with a backslash | |
58 | - if ($objs =~ m,(.*)\\$,) { | |
59 | - $objs = $1; | |
60 | - $cont = 1; | |
61 | - } | |
62 | - | |
63 | foreach my $obj (split /\s+/,$objs) { | |
64 | $obj =~ s/-/_/g; | |
65 | if ($obj =~ /(.*)\.o$/) { |