diff tools/find-gcc-include-path @ 615:2dee957ef988

test case on undeclared name gcc include path handling
author kono
date Wed, 06 Sep 2006 15:21:06 +0900
parents
children c14a1426cfed
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/find-gcc-include-path	Wed Sep 06 15:21:06 2006 +0900
@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+my $CC = $ARGV[1];
+my $gcc = `echo '#include <stddef.h>' | $CC -E - `;
+
+$gcc =~ m=\"(/[^"]+/)stddef\.h"=;
+my $gcc_path = $1;
+
+if ($ARGV[0]=~/-l/) {
+print <<EOF
+char *l_include_path[] = {
+    "/usr/include/",
+    "$gcc_path",
+    0
+};
+EOF
+} else {
+	print "$gcc_path\n";
+}