view tools/find-gcc-include-path @ 636:72c4a8137fff intel-mac

String concatenation fix
author kono
date Wed, 11 Oct 2006 18:38:15 +0900
parents 2dee957ef988
children c14a1426cfed
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[] = {
    "/usr/include/",
    "$gcc_path",
    0
};
EOF
} else {
	print "$gcc_path\n";
}