mirror of
https://github.com/openresty/openresty.git
synced 2024-10-13 00:29:41 +00:00
feature: now we automatically add the -msse4.2 compilation option for building the bundled LuaJIT when it is available.
This commit is contained in:
23
util/configure
vendored
23
util/configure
vendored
@ -5,6 +5,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use File::Spec;
|
||||
use File::Temp qw( tempfile tmpnam );
|
||||
|
||||
sub shell ($@);
|
||||
sub env ($$);
|
||||
@ -625,6 +626,28 @@ _END_
|
||||
$luajit_xcflags .= " -DLUAJIT_ENABLE_LUA52COMPAT";
|
||||
}
|
||||
|
||||
{
|
||||
# check -msse4.2
|
||||
my ($out, $cfile) = tempfile("resty-config-XXXXXX",
|
||||
SUFFIX => '.c', TMPDIR => 1,
|
||||
UNLINK => 1);
|
||||
|
||||
print $out "int main(void) { return 0; }";
|
||||
close $out;
|
||||
|
||||
my $ofile = tmpnam();
|
||||
my $comp = ($cc || 'cc');
|
||||
|
||||
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;
|
||||
|
||||
} else {
|
||||
print "WARNING: -msse4.2 not supported in $comp.\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($opts->{debug}) {
|
||||
$luajit_xcflags .= " -DLUA_USE_APICHECK -DLUA_USE_ASSERT";
|
||||
$luajit_xcflags =~ s/^ +//;
|
||||
|
Reference in New Issue
Block a user