]> git.saurik.com Git - apple/libc.git/blob - cc-3.3-or-greater
Libc-320.1.3.tar.gz
[apple/libc.git] / cc-3.3-or-greater
1 #!/usr/bin/perl
2
3 use strict;
4
5 use constant VERSION3_3 => '3.3';
6
7 sub toint {
8 my $str = shift;
9 my $vers = 0;
10 my @pieces = split(/\./, $str);
11 for(my $i = 0; $i < 3; $i++) {
12 $vers = 1000 * $vers + $pieces[$i];
13 }
14 return($vers);
15 }
16
17 my $info = `cc -v 2>&1`;
18 my($version) = $info =~ /gcc\s+version\s+(\S+)/;
19 printf "%s\n", (toint($version) >= toint(VERSION3_3) ? 'YES' : 'NO');