[svn:parrot] r43790 - in branches/rm_cflags: . config/gen/makefiles lib/Parrot/Docs/Section tools/build

coke at svn.parrot.org coke at svn.parrot.org
Tue Feb 9 03:14:40 UTC 2010


Author: coke
Date: Tue Feb  9 03:14:39 2010
New Revision: 43790
URL: https://trac.parrot.org/parrot/changeset/43790

Log:
Remove cc_flags.pl

This loses any special meaning from CFLAGS - no modified @ccflags@ just now.
Build is now straight $(CC) - no intermediate perl script. Windows users
should see a speedup (if it builds). Build just got a lot more verbose.
(half from warnings, half from actually showing the build line.)

Deleted:
   branches/rm_cflags/tools/build/cc_flags.pl
Modified:
   branches/rm_cflags/MANIFEST
   branches/rm_cflags/config/gen/makefiles/root.in
   branches/rm_cflags/lib/Parrot/Docs/Section/Tools.pm

Modified: branches/rm_cflags/MANIFEST
==============================================================================
--- branches/rm_cflags/MANIFEST	Tue Feb  9 02:52:10 2010	(r43789)
+++ branches/rm_cflags/MANIFEST	Tue Feb  9 03:14:39 2010	(r43790)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Feb  7 21:29:31 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Feb  9 02:55:36 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -2129,7 +2129,6 @@
 t/tools/testdata                                            [test]
 tools/build/addopstags.pl                                   []
 tools/build/c2str.pl                                        []
-tools/build/cc_flags.pl                                     []
 tools/build/fixup_gen_file.pl                               []
 tools/build/h2inc.pl                                        []
 tools/build/headerizer.pl                                   []

Modified: branches/rm_cflags/config/gen/makefiles/root.in
==============================================================================
--- branches/rm_cflags/config/gen/makefiles/root.in	Tue Feb  9 02:52:10 2010	(r43789)
+++ branches/rm_cflags/config/gen/makefiles/root.in	Tue Feb  9 03:14:39 2010	(r43790)
@@ -568,20 +568,13 @@
 
 .SUFFIXES : .c .S .s .pmc .dump $(O) .str .pir .pbc
 
-# Passing an empty argument in @ARGV to cc_flags.pl to indicate where extra -Is
-# (etc) should go. Otherwise it will insert them after the first space, which
-# makes life go horribly wrong if $(CC) contains spaces but can't have -I
-# arguments (etc) injected in the middle.
-# There is probably a better way to do this, but I can't work it out right now.
 .c$(O) : # suffix rule (limited support)
-	@$(PERL) tools/build/cc_flags.pl ./CFLAGS $(CC) "" $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
-
-# XXX probably should detect assembler, but right now this is only used on Sparc
+	$(CC) $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
 
 .s$(O) : # suffix rule (limited support)
-	@$(PERL) tools/build/cc_flags.pl ./CFLAGS $(CC) "" $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
+	$(CC) $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
 #UNLESS(win32).S$(O) : # suffix rule (limited support)
-#UNLESS(win32)	@$(PERL) tools/build/cc_flags.pl ./CFLAGS $(CC) "" $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
+#UNLESS(win32)	$(CC) $(CFLAGS) -I$(@D) @cc_o_out@$@ -c $<
 
 .pir.pbc : # suffix rule (limited support)
 	$(PARROT) -o $@ $<
@@ -612,7 +605,6 @@
     $(NQP_LIB_PBCS)
 
 corevm : \
-    flags_dummy \
 	$(GEN_PM_INCLUDES) \
     PARROT_LIBS \
     $(PARROT) \
@@ -801,10 +793,6 @@
 installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBC_MERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) $(INSTALLABLENQP)
 
 
-flags_dummy :
-	@echo "Compiling with:"
-	@$(PERL) tools/build/cc_flags.pl ./CFLAGS echo $(CC) $(CFLAGS) -I$(@D) @cc_o_out@ xx$(O) -c xx.c
-
 runtime/parrot/include/parrotlib.pbc: runtime/parrot/library/parrotlib.pir $(PARROT) $(GEN_PASM_INCLUDES)
 	$(PARROT) -o $@ runtime/parrot/library/parrotlib.pir
 

Modified: branches/rm_cflags/lib/Parrot/Docs/Section/Tools.pm
==============================================================================
--- branches/rm_cflags/lib/Parrot/Docs/Section/Tools.pm	Tue Feb  9 02:52:10 2010	(r43789)
+++ branches/rm_cflags/lib/Parrot/Docs/Section/Tools.pm	Tue Feb  9 03:14:39 2010	(r43790)
@@ -45,7 +45,6 @@
             'Configuration',
             '',
             $self->new_item( '', 'tools/dev/as2c.pl' ),
-            $self->new_item( '', 'tools/build/cc_flags.pl' ),
             $self->new_item( '', 'tools/build/nativecall.pl' ),
             $self->new_item( '', 'tools/build/vtable_h.pl' ),
             $self->new_item( '', 'tools/build/vtable_extend.pl' ),

Deleted: branches/rm_cflags/tools/build/cc_flags.pl
==============================================================================
--- branches/rm_cflags/tools/build/cc_flags.pl	Tue Feb  9 03:14:39 2010	(r43789)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,131 +0,0 @@
-#! perl
-################################################################################
-# Copyright (C) 2001-2003, Parrot Foundation.
-# $Id$
-################################################################################
-
-=head1 NAME
-
-tools/build/cc_flags.pl - Process compiler flags
-
-=head1 SYNOPSIS
-
-    % perl tools/build/cc_flags.pl transform compiler flags
-
-=head1 DESCRIPTION
-
-This script is used in a F<Makefile> to process the flags to pass to the
-compiler for each C file.
-
-See F<config/gen/makefiles/CFLAGS.in> for the transformation file format.
-
-=cut
-
-################################################################################
-
-use strict;
-use warnings;
-
-my $cflags = shift;
-
-open my $F, '<', $cflags or die "open $cflags: $!\n";
-
-my @options;
-
-while (<$F>) {
-    chomp;
-    s/#.*//;
-    next unless /\S/;
-
-    my $regex;
-    if (s/^\{(.*?)\}\s*//) {
-        next unless $1;
-        $regex = qr/$1/;
-    }
-    elsif (s/^(\S+)\s*//) {
-        $regex = qr/^\Q$1\E$/;
-    }
-    else {
-        die "syntax error in $cflags: line $., $_\n";
-    }
-
-    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;
-        }
-    }
-}
-
-my ($cfile) = grep /\.c$/, @ARGV;
-
-my ( $inject_point, $where );
-
-foreach (@ARGV) {
-    last if $_ eq '';
-    ++$where;
-}
-if ($where) {
-
-    # Found a "" - remove it
-    splice @ARGV, $where, 1;
-    $inject_point = $where;
-}
-else {
-    $inject_point = 1;
-}
-
-if ($cfile) {
-    foreach my $option (@options) {
-        if ( $cfile =~ $option->[0] ) {
-            if ( $option->[1] eq '+' ) {
-                splice @ARGV, $inject_point, 0, $option->[2];
-            }
-            elsif ( $option->[1] eq '-' ) {
-                @ARGV = grep { $_ ne $option->[2] } @ARGV;
-            }
-            else {
-                foreach my $arg (@ARGV) {
-                    $arg =~ s/$option->[2]/$option->[3]/;
-                }
-            }
-        }
-    }
-
-    # Visual C++ already prints the source file name...
-    if ( $ARGV[0] =~ /cl(?:\.exe)?/i ) {
-
-        # ...but only the file name, so we print the path
-        # to the directory first
-        if ( $cfile =~ /(.*[\/\\])/ ) {
-            print $1;
-        }
-    }
-    else {
-        print "$cfile\n";
-    }
-}
-
-exit system(@ARGV) / 256;
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:


More information about the parrot-commits mailing list