|
|
@ -632,18 +632,35 @@ _END_
|
|
|
|
SUFFIX => '.c', TMPDIR => 1,
|
|
|
|
SUFFIX => '.c', TMPDIR => 1,
|
|
|
|
UNLINK => 1);
|
|
|
|
UNLINK => 1);
|
|
|
|
|
|
|
|
|
|
|
|
print $out "int main(void) { return 0; }";
|
|
|
|
print $out "
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
|
|
|
|
#ifndef __SSE4_2__
|
|
|
|
|
|
|
|
# error SSE 4.2 not found
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
";
|
|
|
|
close $out;
|
|
|
|
close $out;
|
|
|
|
|
|
|
|
|
|
|
|
my $ofile = tmpnam();
|
|
|
|
my $ofile = tmpnam();
|
|
|
|
my $comp = ($cc || 'cc');
|
|
|
|
my $comp = ($cc || 'cc');
|
|
|
|
|
|
|
|
my $found;
|
|
|
|
|
|
|
|
|
|
|
|
if (system("$comp -o $ofile -msse4.2 -c $cfile") == 0 && -s $ofile) {
|
|
|
|
if (system("$comp -o $ofile -msse4.2 -c $cfile") == 0 && -s $ofile) {
|
|
|
|
print "INFO: found -msse4.2 in $comp.\n";
|
|
|
|
|
|
|
|
$luajit_xcflags .= " -msse4.2";
|
|
|
|
|
|
|
|
unlink $ofile;
|
|
|
|
unlink $ofile;
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if (system("$comp -o $ofile -march=native -c $cfile") == 0 && -s $ofile) {
|
|
|
|
|
|
|
|
print "INFO: found -msse4.2 in $comp.\n";
|
|
|
|
|
|
|
|
$found = 1;
|
|
|
|
|
|
|
|
$luajit_xcflags .= " -msse4.2";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (-f $ofile) {
|
|
|
|
|
|
|
|
unlink $ofile;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$found) {
|
|
|
|
print "WARNING: -msse4.2 not supported in $comp.\n";
|
|
|
|
print "WARNING: -msse4.2 not supported in $comp.\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|