aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorwelinder@troll.com <welinder@troll.com>2004-08-12 13:40:32 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:38 -0700
commitbb9b7d06ff12902b1016a71576aa3f5a30082643 (patch)
treebafb11f15b891aa2a221c3bb1048714f82c00eb5
parentba4cf7e14abe23a880a8607f31136642b202f101 (diff)
downloadsparse-dev-bb9b7d06ff12902b1016a71576aa3f5a30082643.tar.gz
Wrapper to run check and gcc in series.
-rw-r--r--cgcc22
1 files changed, 22 insertions, 0 deletions
diff --git a/cgcc b/cgcc
new file mode 100644
index 00000000..ec9e7ce7
--- /dev/null
+++ b/cgcc
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+my $cc = $ENV{'REAL_CC'} || 'cc';
+my $check = $ENV{'CHECK'} || 'check';
+
+# Look for a .c file. We don't want to run the checker on .o or .so files
+# in the link run. (This simplistic check knows nothing about options
+# with arguments, but it seems to do the job.)
+my $seen_a_c_file = 0;
+foreach (@ARGV) {
+ if (/^[^-].*\.c/) {
+ $seen_a_c_file = 1;
+ last;
+ }
+}
+
+if ($seen_a_c_file) {
+ system ($check, @ARGV);
+}
+
+exec ($cc, @ARGV);