|
|
@ -739,51 +739,6 @@ _END_
|
|
|
|
$luajit_xcflags .= " -DLUAJIT_DISABLE_GC64";
|
|
|
|
$luajit_xcflags .= " -DLUAJIT_DISABLE_GC64";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!$user_luajit_xcflags
|
|
|
|
|
|
|
|
|| $user_luajit_xcflags !~ /-msse4\.2\b/)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
# check -msse4.2
|
|
|
|
|
|
|
|
my ($out, $cfile) = tempfile("resty-config-XXXXXX",
|
|
|
|
|
|
|
|
SUFFIX => '.c', TMPDIR => 1,
|
|
|
|
|
|
|
|
UNLINK => 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print $out "
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
|
|
|
|
#ifndef __SSE4_2__
|
|
|
|
|
|
|
|
# error SSE 4.2 not found
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
|
|
close $out;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $ofile = tmpnam();
|
|
|
|
|
|
|
|
my $comp = ($cc || 'cc');
|
|
|
|
|
|
|
|
my $found;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (system("$comp -o $ofile -msse4.2 -c $cfile") == 0
|
|
|
|
|
|
|
|
&& -s $ofile)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
unlink $ofile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($platform eq 'macosx') {
|
|
|
|
if ($platform eq 'macosx') {
|
|
|
|
# to work around a bug in the Xcode toolchain in macOS 11.15:
|
|
|
|
# to work around a bug in the Xcode toolchain in macOS 11.15:
|
|
|
|
# https://github.com/openresty/homebrew-brew/issues/10
|
|
|
|
# https://github.com/openresty/homebrew-brew/issues/10
|
|
|
|