view tools/find-gcc-include-path @ 769:74701505c42d

i64 switch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 18 Nov 2010 01:47:03 +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";
}