view tools/find-gcc-include-path @ 799:56ba015b37ca

i64 fix register save offset, make diff2 passed.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 23 Nov 2010 23:05:08 +0900
parents c14a1426cfed
children c005a392e27e
line wrap: on
line source

#!/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[] = {
    "$gcc_path",
    "/usr/include/",
    0
};
EOF
} else {
	print "$gcc_path\n";
}