[klibc] [PATCH 1/1] Modify --param support to include additional option

Mike Pagano mpagano at gentoo.org
Wed Jul 20 10:56:27 PDT 2011


Later versions of gcc include an option in the form of --param=name=value. This patch adds support for this and continues to support the --param name=value 
option.

Signed-off-by: Mike Pagano <mpagano at gentoo.org>
---
 klcc/klcc.in |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/klcc/klcc.in b/klcc/klcc.in
index 711a832..5d00bfd 100644
--- a/klcc/klcc.in
+++ b/klcc/klcc.in
@@ -159,10 +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 =~ /^-[gp]/ || $a eq '-p' ) {
+	} elsif ( $a =~ /(--param)[=]?/ ) {
+	# support --param name=value and --param=name=value
+	push(@ccopt, $1);
+	$a =~ /[=](.*)/;
+	my $val = $1;
+	if ( $a =~ /[=]/ ) {
+		push(@ccopt, $val);
+	}
+	else {
+		push(@ccopt, shift(@ARGV));
+	} elsif ( $a =~ /^-[gp]/ || $a eq '-p' ) {
 	# Debugging options to gcc
 	push(@ccopt, $a);
 	$debugging = 1;
-- 
1.7.3.4



More information about the klibc mailing list