toys/tools/gcc.wrapper

sparky cvs at pld-linux.org
Wed Aug 9 14:47:04 CEST 2006


Author: sparky
Date: Wed Aug  9 14:46:56 2006
New Revision: 7633

Modified:
   toys/tools/gcc.wrapper
Log:
- some cosmetics


Modified: toys/tools/gcc.wrapper
==============================================================================
--- toys/tools/gcc.wrapper	(original)
+++ toys/tools/gcc.wrapper	Wed Aug  9 14:46:56 2006
@@ -11,7 +11,7 @@
 
 (my $prog = $0) =~ s#.*/##;
 # warning: glibc changes flags order, assume it's OK
-goto EXEC if $ENV{PWD} =~ /glibc/;
+goto EXEC if $ENV{PWD} =~ m#BUILD/glibc-2#;
 
 my $ldflags = "-Wl,--as-needed -Wl,-s";
 my $cflags = "-fno-align-loops -fno-align-jumps -fno-align-functions";
@@ -19,6 +19,8 @@
 my $wanted_optimize = "-Os";
 my $wanted_ldflag = "-Wl,--as-needed";
 
+my $arch = "ppc";
+
 my $link = 1;
 my $compile = 1;
 my $source = 0;
@@ -30,8 +32,8 @@
 foreach my $arg (@ARGV) {
 	foreach my $nocomp (qw(
 			-E --version -v -V --help --target-help
-			-print-search-dirs
-			-print-libgcc-file-name -dumpmachine -dumpversion
+			-print-search-dirs -print-libgcc-file-name
+			-dumpmachine -dumpversion
 			gcctest.c try.c
 			/dev/null
 			-D__KERNEL__ scripts/mod/modpost)) {
@@ -49,9 +51,9 @@
 			or $arg =~ /^-Wp,-MD,scripts/) {
 		$link = 0;
 		$compile = 0;
-		last FORARGS;
+		last;
 	}
-	if (length $wanted_optimize and $arg =~ /^(-O[s0-9])$/) {
+	if (length $wanted_optimize and $arg =~ /^(-O[s0-9]?)$/) {
 		$optimize = $1;
 		next;
 	}
@@ -75,14 +77,8 @@
 	(my $pwd = $ENV{PWD}) =~ s#.*BUILD/##;
 	my $args = join ' ', @ARGV;
 	my @problems;
-	if ($link) {
-		if (length $ldflags and $args !~ /$ldflags/) {
-			push @problems, "LDFLAGS";
-		}
-		if (length $wanted_ldflag and defined $asneeded_first
-				and $asneeded_first == 0 ) {
-			push @problems, "ASNEEDED";
-		}
+	unless ($prog eq "$arch-pld-linux-gcc" or $prog eq "$arch-pld-linux-g++") {
+		push @problems, "PROGRAM";
 	}
 	if ($compile) {
 		if (length $cflags and $args !~ /$cflags/) {
@@ -92,21 +88,26 @@
 			push @problems, "OPTIMIZE($optimize)";
 		}
 	}
-	unless ($prog eq "ppc-pld-linux-gcc" or $prog eq "ppc-pld-linux-g++") {
-		push @problems, "PROGRAM";
+	if ($link) {
+		if (length $ldflags and $args !~ /$ldflags/) {
+			push @problems, "LDFLAGS";
+		}
+		if (length $wanted_ldflag and defined $asneeded_first
+				and $asneeded_first == 0 ) {
+			push @problems, "ASNEEDED";
+		}
 	}
 	
-	#push @problems, "TEST";
 	if (@problems) {
-		open PROBLEMS, ">> $ENV{HOME}/ldflags-problems"
+		open PROBLEMS, ">> $ENV{HOME}/flags-problems"
 			or die "$!\n";
 		local $" = "! ";
-		print PROBLEMS "@problems! $pwd: $0 $args\n";
+		print PROBLEMS "@problems! $pwd: $prog $args\n";
 		close PROBLEMS;
 	}
 }
 
 EXEC:
-exec("/usr/bin/$prog.real", @ARGV);
+exec("/usr/bin/$prog", @ARGV);
 
 # vim: ts=4:sw=4


More information about the pld-cvs-commit mailing list