Author: sparky
Date: Sat Aug  5 06:00:38 2006
New Revision: 7594

Modified:
   toys/tools/gcc.wrapper
Log:
- don't report anything if -M or -MM is specified and there is no -MF
- skip glibc


Modified: toys/tools/gcc.wrapper
==============================================================================
--- toys/tools/gcc.wrapper      (original)
+++ toys/tools/gcc.wrapper      Sat Aug  5 06:00:38 2006
@@ -9,8 +9,11 @@
 # no use strict by default to make it faster
 #use strict;
 
+(my $prog = $0) =~ s#.*/##;
+# warning: glibc changes flags order, assume it's OK
+goto EXEC if $ENV{PWD} =~ /glibc/;
+
 my $ldflags = "-Wl,--as-needed -Wl,-s";
-# warning: glibc changes flags order
 my $cflags = "-fno-align-loops -fno-align-jumps -fno-align-functions";
 
 my $wanted_optimize = "-Os";
@@ -21,16 +24,17 @@
 my $source = 0;
 my $optimize = "";
 my $asneeded_first = undef;
+my $make = 0;
 
 FORARGS:
 foreach my $arg (@ARGV) {
        foreach my $nocomp (qw(
-                       -E -MM --version -v -V --help --target-help
+                       -E --version -v -V --help --target-help
                        -print-search-dirs
                        -print-libgcc-file-name -dumpmachine -dumpversion
                        gcctest.c try.c
                        /dev/null
-                       -D__KERNEL__)) {
+                       -D__KERNEL__ scripts/mod/modpost)) {
                if ($arg eq $nocomp) {
                        $link = 0;
                        $compile = 0;
@@ -60,11 +64,12 @@
                        next;
                }
        }
+       $make |= 1 if $arg eq "-M" or $arg eq "-MM";
+       $make |= 2 if $arg eq "-MF";
        $source = 1 if $arg =~ /\.(c|cc|cpp|cxx)$/;
 }
 $compile = 0 unless $source;
-
-(my $prog = $0) =~ s#.*/##;
+goto EXEC if ($make == 1);
 
 if ($link or $compile) {
        (my $pwd = $ENV{PWD}) =~ s#.*BUILD/##;
@@ -101,6 +106,7 @@
        }
 }
 
+EXEC:
 exec("/usr/bin/$prog.real", @ARGV);
 
 # vim: ts=4:sw=4
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to