? cflags.diff
? cflags.tar.gz
? coresplit.diff
? t.tar
Index: config/gen/cflags/imcc.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/cflags/imcc.in,v
retrieving revision 1.2
diff -u -a -r1.2 imcc.in
--- config/gen/cflags/imcc.in	22 Jul 2003 02:16:07 -0000	1.2
+++ config/gen/cflags/imcc.in	22 Jul 2003 12:20:17 -0000
@@ -1,8 +1,11 @@
-# [ filename | {regex} ] -{removed options} +{added options} ...
+# [ filename | {regex} ] -{removed options} +{added options} s/// ...
 #
-# note, empty regex/options are just ignored
+# Avoid using non-configure controlled +{} directly in this file, as
+# it'll most likely break on other platforms.
 #
-{.*} -{-Wwrite-strings -Wcast-qual -Wno-unused}
+# Note, empty regex/options are just ignored.
+#
+{.*} -{-Wwrite-strings -Wcast-qual} s/-Wno-unused/-Wunused/
 
 instructions.c -{-Wformat-nonliteral} # noisy
 debug.c        -{-Wformat-nonliteral} # noisy
Index: config/gen/cflags/root.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/cflags/root.in,v
retrieving revision 1.1
diff -u -a -r1.1 root.in
--- config/gen/cflags/root.in	21 Jul 2003 20:16:17 -0000	1.1
+++ config/gen/cflags/root.in	22 Jul 2003 12:20:17 -0000
@@ -1,6 +1,9 @@
-# [ filename | {regex} ] -{removed option} +{added option} ...
+# [ filename | {regex} ] -{removed options} +{added options} s/// ...
 #
-# note, empty regexen/options are just ignored
+# Avoid using non-configure controlled +{} directly in this file, as
+# it'll most likely break on other platforms.
+#
+# Note, empty regex/options are just ignored.
 #
 spf_render.c -{-Wformat-nonliteral}   # noisy
 tsq.c -{${optimize}} 		      # never optimize tsq.c!
Index: tools/dev/cc_flags.pl
===================================================================
RCS file: /cvs/public/parrot/tools/dev/cc_flags.pl,v
retrieving revision 1.1
diff -u -a -r1.1 cc_flags.pl
--- tools/dev/cc_flags.pl	21 Jul 2003 20:16:26 -0000	1.1
+++ tools/dev/cc_flags.pl	22 Jul 2003 12:20:18 -0000
@@ -25,16 +25,26 @@
 	die "syntax error in $cflags: line $., $_\n";
     }
     
-    while (s/^([-+])\{(.*?)\}\s*//) {
-	next unless $2;
-	my ($sign, $options) = ($1, $2);
-	foreach my $option (split ' ', $options) {
-	    push @options, [ $regex, $sign, $option ];
+    for (;;) {
+	if (s/^([-+])\{(.*?)\}\s*//) {
+	    next unless $2;
+	    my ($sign, $options) = ($1, $2);
+	    foreach my $option (split ' ', $options) {
+		push @options, [ $regex, $sign, $option ];
+	    }
+	}
+	elsif (s{s(.)(.*?)\1(.*?)\1([imsx]*)\s*}{}) {
+	    my $mod = "";
+	    $mod = "(?$4)" if $4;
+
+	    push @options, [ $regex, 's', "$mod$2", $3 ];
+	}
+	elsif (/\S/) {
+	    die "syntax error in $cflags: line $., $_\n";
+	}
+	else {
+	    last;
 	}
-    }
-    
-    if (/\S/) {
-	die "syntax error in $cflags: line $., $_\n";
     }
 }
 
@@ -45,8 +55,13 @@
 	if ($option->[1] eq '+') {
 	    splice @ARGV, 1, 0, $option->[2];
 	}
-	else {
+	elsif ($option->[1] eq '-') {
 	    @ARGV = grep { $_ ne $option->[2] } @ARGV;
+	}
+	else {
+	    foreach my $arg (@ARGV) {
+		$arg =~ s/$option->[2]/$option->[3]/;
+	    }
 	}
     }
 }

Reply via email to