q3cellshading/code/unix/Cons_gcc.pm
gmiranda db8ca37fa3 Initial commit
git-svn-id: https://svn.code.sf.net/p/q3cellshading/code/trunk@2 db09e94b-7117-0410-a7e6-85ae5ff6e0e9
2006-07-05 14:05:49 +00:00

47 lines
905 B
Perl

#
# Some utilities to handle gcc compiler setup
#
package Cons_gcc;
# pass the compiler name
# returns an array, first element is 2 for 2.x 3 for 3.x, then full version, then machine info
sub get_gcc_version
{
my @ret;
my ($CC) = @_;
my $version=`$CC --version | head -1`;
chop($version);
my $machine=`$CC -dumpmachine`;
chop($machine);
if($version =~ '2\.[0-9]*\.[0-9]*')
{
push @ret, '2';
} else {
push @ret, '3';
}
push @ret, $version;
push @ret, $machine;
return @ret;
}
# http://ccache.samba.org/
# check ccache existence and path
# returns an array, first element 0 / 1, then path
sub get_ccache
{
my @ret;
$ccache_path=`which ccache`;
chop($ccache_path);
if(-x $ccache_path)
{
push @ret, '1';
push @ret, $ccache_path;
return @ret;
}
push @ret, '0';
return @ret;
}
# close package
1;