]>
Commit | Line | Data |
---|---|---|
9385eb3d A |
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'); |