blob: 59818769842153c5efd815023408cd6412d2ae23 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/usr/bin/perl
#
# GCC optimization flag generator
#
use strict;
use warnings;
my $gcc = $ARGV[0];
if ( ! $gcc ) {
die "Can't generate optimization flags (no compiler specified)\n";
}
if ( ! `which $gcc 2> /dev/null` ) {
die "Can't generate optimization flags ($gcc is missing?)\n";
}
#
# Detect architecture
#
my $arch = `uname -m`;
# Intel x86
#
# Matches ix86, i386, i486, i586, i686
#
my $pattern = "i([x3-6])86|x86_64";
if ($arch =~ $pattern) {
system("util/gcc-opt-x86.pl $gcc");
exit 0
}
exit 0
|