mirror of
https://github.com/openresty/openresty
synced 2024-11-09 18:35:51 +01:00
feature: ./configure: the user flags specified by the --with-luajit-xcflags=FLAGS option are not appended to the default flags instead of being prepended. thanks spacewander for the report in #256.
This commit is contained in:
parent
dafd10b27d
commit
a8ea810fdc
36
t/sanity.t
36
t/sanity.t
@ -1267,8 +1267,8 @@ install: all
|
||||
clean:
|
||||
rm -rf build
|
||||
--- err
|
||||
Can't exec "gcc-4.2": No such file or directory at ./configure line 614.
|
||||
Can't exec "gcc-4.2": No such file or directory at ./configure line 649.
|
||||
Can't exec "gcc-4.2": No such file or directory at ./configure line 615.
|
||||
Can't exec "gcc-4.2": No such file or directory at ./configure line 653.
|
||||
|
||||
|
||||
|
||||
@ -1432,8 +1432,8 @@ install: all
|
||||
clean:
|
||||
rm -rf build
|
||||
--- err
|
||||
Can't exec "cl": No such file or directory at ./configure line 614.
|
||||
Can't exec "cl": No such file or directory at ./configure line 649.
|
||||
Can't exec "cl": No such file or directory at ./configure line 615.
|
||||
Can't exec "cl": No such file or directory at ./configure line 653.
|
||||
|
||||
|
||||
|
||||
@ -2204,7 +2204,7 @@ install: all
|
||||
clean:
|
||||
rm -rf build
|
||||
--- err
|
||||
Can't exec "sw_vers": No such file or directory at ./configure line 699.
|
||||
Can't exec "sw_vers": No such file or directory at ./configure line 712.
|
||||
|
||||
|
||||
|
||||
@ -2286,7 +2286,7 @@ install: all
|
||||
clean:
|
||||
rm -rf build
|
||||
--- err
|
||||
Can't exec "sw_vers": No such file or directory at ./configure line 699.
|
||||
Can't exec "sw_vers": No such file or directory at ./configure line 712.
|
||||
|
||||
|
||||
|
||||
@ -3173,8 +3173,8 @@ cp -rp bundle/ build
|
||||
cd build
|
||||
cd LuaJIT-2.1-20170405
|
||||
INFO: found -msse4.2 in cc.
|
||||
gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
gmake install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/
|
||||
gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
gmake install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/
|
||||
export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib'
|
||||
export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1'
|
||||
cd ..
|
||||
@ -3209,14 +3209,14 @@ Type the following commands to build and install:
|
||||
.PHONY: all install clean
|
||||
|
||||
all:
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.5 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -fpic" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/nginx-1.11.2 && $(MAKE)
|
||||
|
||||
install: all
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||
cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.5 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -fpic" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
@ -3253,8 +3253,8 @@ cp -rp bundle/ build
|
||||
cd build
|
||||
cd LuaJIT-2.1-20170405
|
||||
INFO: found -msse4.2 in cc.
|
||||
gmake TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
gmake install TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/
|
||||
gmake TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
gmake install TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/
|
||||
export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib'
|
||||
export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1'
|
||||
cd ..
|
||||
@ -3290,14 +3290,14 @@ Type the following commands to build and install:
|
||||
.PHONY: all install clean
|
||||
|
||||
all:
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.5 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -O -fpic" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CFLAGS="-g -O -Wall" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CFLAGS="-g -O -Wall" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/nginx-1.11.2 && $(MAKE)
|
||||
|
||||
install: all
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_USE_VALGRIND -DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g Q= XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2 -DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_USE_VALGRIND' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||
cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.5 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -O -fpic" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CFLAGS="-g -O -Wall" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CFLAGS="-g -O -Wall" CC=cc
|
||||
@ -4223,8 +4223,8 @@ cp -rp bundle/ build
|
||||
cd build
|
||||
cd LuaJIT-2.1-20170405
|
||||
INFO: found -msse4.2 in cc.
|
||||
gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
gmake install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/
|
||||
gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
gmake install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$OPENRESTY_BUILD_DIR/luajit-root/
|
||||
export LUAJIT_LIB='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/lib'
|
||||
export LUAJIT_INC='$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1'
|
||||
cd ..
|
||||
@ -4259,14 +4259,14 @@ Type the following commands to build and install:
|
||||
.PHONY: all install clean
|
||||
|
||||
all:
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/openresty/luajit
|
||||
cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.5 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -fpic" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/nginx-1.11.2 && $(MAKE)
|
||||
|
||||
install: all
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-DLUAJIT_ENABLE_LUA52COMPAT -msse4.2' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||
cd $OPENRESTY_BUILD_DIR/LuaJIT-2.1-20170405 && $(MAKE) install TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR)
|
||||
cd $OPENRESTY_BUILD_DIR/lua-cjson-2.1.0.5 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_CMODULE_DIR=/usr/local/openresty/lualib LUA_MODULE_DIR=/usr/local/openresty/lualib CJSON_CFLAGS="-g -fpic" CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-redis-parser-0.13 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
cd $OPENRESTY_BUILD_DIR/lua-rds-parser-0.06 && $(MAKE) install DESTDIR=$(DESTDIR) LUA_INCLUDE_DIR=$OPENRESTY_BUILD_DIR/luajit-root/usr/local/openresty/luajit/include/luajit-2.1 LUA_LIB_DIR=/usr/local/openresty/lualib CC=cc
|
||||
|
17
util/configure
vendored
17
util/configure
vendored
@ -129,6 +129,7 @@ my @ngx_rpaths;
|
||||
my $cc;
|
||||
my $cores;
|
||||
my $luajit_xcflags = '';
|
||||
my $user_luajit_xcflags;
|
||||
my $no_luajit_lua52;
|
||||
|
||||
my (@ngx_opts, @ngx_cc_opts, @ngx_ld_opts);
|
||||
@ -256,7 +257,7 @@ for my $opt (@ARGV) {
|
||||
$resty_opts{luajit_path} = $1;
|
||||
|
||||
} elsif ($opt =~ /^--with-luajit-xcflags=(.*)/) {
|
||||
$luajit_xcflags .= " $1";
|
||||
$user_luajit_xcflags .= " $1";
|
||||
|
||||
} elsif ($opt =~ /^--without-luajit-lua52/) {
|
||||
$no_luajit_lua52 = 1;
|
||||
@ -621,11 +622,14 @@ _END_
|
||||
}
|
||||
|
||||
if (!$no_luajit_lua52
|
||||
&& (!$luajit_xcflags || $luajit_xcflags !~ /-DLUAJIT_ENABLE_LUA52COMPAT\b/))
|
||||
&& (!$user_luajit_xcflags
|
||||
|| $user_luajit_xcflags !~ /-DLUAJIT_ENABLE_LUA52COMPAT\b/))
|
||||
{
|
||||
$luajit_xcflags .= " -DLUAJIT_ENABLE_LUA52COMPAT";
|
||||
}
|
||||
|
||||
if (!$user_luajit_xcflags
|
||||
|| $user_luajit_xcflags !~ /-msse4\.2\b/)
|
||||
{
|
||||
# check -msse4.2
|
||||
my ($out, $cfile) = tempfile("resty-config-XXXXXX",
|
||||
@ -667,10 +671,19 @@ int main(void) {
|
||||
|
||||
if ($opts->{debug}) {
|
||||
$luajit_xcflags .= " -DLUA_USE_APICHECK -DLUA_USE_ASSERT";
|
||||
|
||||
if ($user_luajit_xcflags) {
|
||||
$luajit_xcflags .= $user_luajit_xcflags;
|
||||
}
|
||||
$luajit_xcflags =~ s/^ +//;
|
||||
|
||||
$extra_opts .= qq{ Q= XCFLAGS='$luajit_xcflags'};
|
||||
|
||||
} else {
|
||||
if ($user_luajit_xcflags) {
|
||||
$luajit_xcflags .= $user_luajit_xcflags;
|
||||
}
|
||||
|
||||
if ($luajit_xcflags) {
|
||||
$luajit_xcflags =~ s/^ +//;
|
||||
$extra_opts .= qq{ XCFLAGS='$luajit_xcflags'};
|
||||
|
Loading…
Reference in New Issue
Block a user