[svn:parrot] r44450 - in branches/rm_cflags: config/auto config/gen/makefiles lib/Parrot/Configure

coke at svn.parrot.org coke at svn.parrot.org
Wed Feb 24 07:07:18 UTC 2010


Author: coke
Date: Wed Feb 24 07:07:17 2010
New Revision: 44450
URL: https://trac.parrot.org/parrot/changeset/44450

Log:
- Change optional @@ syntax from URL-like ? to a more parrotish ::
- move spf/src_render's override into auto::warnings.  
- Split out cc_warn from cc_flags in the makefile

Modified:
   branches/rm_cflags/config/auto/warnings.pm
   branches/rm_cflags/config/gen/makefiles/root.in
   branches/rm_cflags/lib/Parrot/Configure/Compiler.pm

Modified: branches/rm_cflags/config/auto/warnings.pm
==============================================================================
--- branches/rm_cflags/config/auto/warnings.pm	Wed Feb 24 06:36:50 2010	(r44449)
+++ branches/rm_cflags/config/auto/warnings.pm	Wed Feb 24 07:07:17 2010	(r44450)
@@ -188,6 +188,12 @@
     $gcc->{'cage'} = $gcc_or_gpp_cage;
     $gpp->{'cage'} = $gcc_or_gpp_cage;
 
+    $gcc->{'todo'} = $gpp->{'todo'} = {
+        '-Wformat-nonliteral' => [
+            'src/spf_render.c',
+        ] 
+    };
+
     $data->{'warnings'}{'gcc'} = $gcc;
     $data->{'warnings'}{'gpp'} = $gpp;
 
@@ -253,7 +259,7 @@
 
     $conf->data->set('ccwarn', join(' ', @warnings));
     foreach my $file (keys %per_file) {
-        $conf->data->set("ccwarn?$file", join(' ', @{$per_file{$file}}));
+        $conf->data->set("ccwarn::$file", join(' ', @{$per_file{$file}}));
     } 
 
     $self->set_result('done');

Modified: branches/rm_cflags/config/gen/makefiles/root.in
==============================================================================
--- branches/rm_cflags/config/gen/makefiles/root.in	Wed Feb 24 06:36:50 2010	(r44449)
+++ branches/rm_cflags/config/gen/makefiles/root.in	Wed Feb 24 07:07:17 2010	(r44450)
@@ -83,7 +83,8 @@
 C_LIBS           = @libs@
 CC_SHARED        = @cc_shared@
 CC_O_OUT         = @cc_o_out@
-CFLAGS           = $(CC_INC) @ccflags@ @cc_build_call_frames@ @cc_debug@ @ccwarn@ @cg_flag@ @gc_flag@ @clock_best@ $(CC_SHARED)
+CC_WARN          = @ccwarn@
+CFLAGS           = $(CC_INC) @ccflags@ @cc_build_call_frames@ @cc_debug@ @cg_flag@ @gc_flag@ @clock_best@ $(CC_SHARED)
 LINK_DYNAMIC     = @link_dynamic@
 LINK             = @link@
 LINKFLAGS        = @linkflags@ @link_debug@ @ld_debug@
@@ -577,12 +578,12 @@
 .SUFFIXES : .c .S .s .pmc .dump $(O) .str .pir .pbc
 
 .c$(O) : # suffix rule (limited support)
-	$(CC) $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
+	$(CC) $(CFLAGS) $(CC_WARN) -I$(@D) @cc_o_out@$@ -c $<
 
 .s$(O) : # suffix rule (limited support)
-	$(CC) $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
+	$(CC) $(CFLAGS) $(CC_WARN) -I$(@D) @cc_o_out@$@ -c $<
 #UNLESS(win32).S$(O) : # suffix rule (limited support)
-#UNLESS(win32)	$(CC) $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
+#UNLESS(win32)	$(CC) $(CFLAGS) $(CC_WARN) -I$(@D) @cc_o_out@$@ -c $<
 
 .pir.pbc : # suffix rule (limited support)
 	$(PARROT) -o $@ $<
@@ -1257,7 +1258,7 @@
 ## SUFFIX OVERRIDE - dynloaded files need cc_shared
 src/extend$(O) : $(PARROT_H_HEADERS) $(INC_DIR)/extend.h \
     include/pmc/pmc_sub.h $(INC_DIR)/extend_vtable.h src/extend.c
-	$(CC) $(CFLAGS) @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/extend.c
+	$(CC) $(CFLAGS) $(CC_WARN) @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/extend.c
 
 src/runcore/main$(O) : \
 	src/runcore/main.str \
@@ -1423,7 +1424,7 @@
 
 ## SUFFIX OVERRIDE - Warnings
 src/spf_render$(O) : $(PARROT_H_HEADERS) src/spf_render.str
-	$(CC) $(CFLAGS) -Wno-format-nonliteral @cc_shared@ -I$(@D) @cc_o_out@ $@ -c src/spf_render.c
+	$(CC) $(CFLAGS) @ccwarn::src/spf_render.c@ @cc_shared@ -I$(@D) @cc_o_out@ $@ -c src/spf_render.c
 
 src/spf_vtable$(O) : $(PARROT_H_HEADERS) src/spf_vtable.str
 
@@ -1465,7 +1466,7 @@
     include/pmc/pmc_parrotlibrary.h \
     src/io/io_private.h $(INC_DIR)/dynext.h $(INC_DIR)/embed.h \
     $(INC_DIR)/oplib/core_ops.h $(INC_DIR)/runcore_api.h
-	$(CC) $(CFLAGS) @cc_shared@ -Wno-unused-parameter -Wno-unused-variable \
+	$(CC) $(CFLAGS) $(CC_WARN) @cc_shared@ -Wno-unused-parameter -Wno-unused-variable \
     -I$(@D) @cc_o_out@$@ -c src/ops/core_ops.c
 
 # .h files are built along with .c
@@ -2422,7 +2423,7 @@
 # for use by t/pmc/nci.t
 ## SUFFIX OVERRIDE - dynloaded files need cc_shared
 src/nci_test$(O): $(PARROT_H_HEADERS) src/nci_test.c
-	$(CC) $(CFLAGS) @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/nci_test.c
+	$(CC) $(CFLAGS) $(CC_WARN) @cc_shared@ -I$(@D) @cc_o_out@$@ -c src/nci_test.c
 
 $(LIBNCI_TEST_SO): src/nci_test$(O) $(LIBPARROT)
 	$(LD) $(LD_LOAD_FLAGS) @ncilib_link_extra@ $(LDFLAGS) \

Modified: branches/rm_cflags/lib/Parrot/Configure/Compiler.pm
==============================================================================
--- branches/rm_cflags/lib/Parrot/Configure/Compiler.pm	Wed Feb 24 06:36:50 2010	(r44449)
+++ branches/rm_cflags/lib/Parrot/Configure/Compiler.pm	Wed Feb 24 07:07:17 2010	(r44450)
@@ -201,10 +201,10 @@
 C<key>'s value from the configuration system's data, and writes the results
 to specified target file.
 
-If a C<?> is present in the C<@key@>, the replaced value will first try to
-use the full key, but if that is not present, the key up to the C<?> is used.
-For example, if C<@cc_warnings?src/embed.c@> is used, and that key doesn't
-exist, the fallback key would be C<@cc_warnings@>.
+If a C<::> is present in the C<@key@>, the replaced value will first try to
+use the full key, but if that is not present, the key up to the C<::> is used.
+For example, if C<@cc_warn::src/embed.c@> is used, and that key doesn't
+exist, the fallback key would be C<@cc_warn@>.
 
 Respects the following options when manipulating files (Note: most of the
 replacement syntax assumes the source text is on a single line.)
@@ -530,9 +530,9 @@
             }
         }egx;
 
-        # interpolate @foo?bar@ values
-        $line =~ s{ \@ (\w+) \? (\w+) \@ }{
-            my $full = $1 . '?' . $2;
+        # interpolate @foo::bar@ values
+        $line =~ s{ \@ (\w+) :: ([^\@]+) \@ }{
+            my $full = $1 . '::' . $2;
             my $base = $1;
             if(defined(my $val=$conf->data->get($full))) {
                 $val;


More information about the parrot-commits mailing list