mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-23 20:42:30 +00:00
8b1d93b397
I was working on a patch earlier to fix some more things up to be more modern, and I added a couple lines from that cleanup patch I showed you on irc. Some commented code was removed, some stuff was made to not be broke (old head usage), the makefile should install things better, and a a few GCC warnings were gagged. I also attempted to version it but you'll probably want to change that to whatever versioning rules you decide on using.
47 lines
860 B
Perl
Executable file
47 lines
860 B
Perl
Executable file
#
|
|
# 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 -n 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;
|