]> git.saurik.com Git - apple/libc.git/blame - cc-3.3-or-greater
Libc-320.1.3.tar.gz
[apple/libc.git] / cc-3.3-or-greater
CommitLineData
9385eb3d
A
1#!/usr/bin/perl
2
3use strict;
4
5use constant VERSION3_3 => '3.3';
6
7sub 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
17my $info = `cc -v 2>&1`;
18my($version) = $info =~ /gcc\s+version\s+(\S+)/;
19printf "%s\n", (toint($version) >= toint(VERSION3_3) ? 'YES' : 'NO');