diff options
author | Mike Pagano <mpagano@gentoo.org> | 2011-08-03 13:07:38 -0400 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2011-08-07 15:27:26 +0200 |
commit | 2901f37cd7a0a7b1d7adb8d63b38c77a23772b7c (patch) | |
tree | 79c4ead2a70a4dd433a85cc225bc684ee049d60e | |
parent | fc4e88562815e3ebe525e57b28934612257ed0c4 (diff) | |
download | klibc-2901f37cd7a0a7b1d7adb8d63b38c77a23772b7c.tar.gz |
[klibc] klcc: Enhance param parsing
Later versions of gcc include an option in the form of --param=name=value.
This patch adds support for this.
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | klcc/klcc.in | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/klcc/klcc.in b/klcc/klcc.in index 711a8321cda69..a6f1523000621 100644 --- a/klcc/klcc.in +++ b/klcc/klcc.in @@ -159,9 +159,17 @@ while ( defined($a = shift(@ARGV)) ) { # gcc options, that force preprocessing mode push(@ccopt, $a); $operation = 'E'; - } elsif ( $a eq '--param' ) { - push(@ccopt, $a); - push(@ccopt, shift(@ARGV)); + } elsif ( $a =~ /^--param/ ) { + # support --param name=value and --param=name=value + my @values=split('=', $a); + if ( @values == 1 ) { + push(@ccopt, $a); + push(@ccopt, shift(@ARGV)); + } + elsif ( @values == 3 ) { + push(@ccopt, $values[0]); + push(@ccopt, join('=', $values[1],$values[2])); + } } elsif ( $a =~ /^-[gp]/ || $a eq '-p' ) { # Debugging options to gcc push(@ccopt, $a); |