Skip to content

Commit 4062f0d

Browse files
authored
feat: build apisix-openresty-debug (#51)
1 parent df64c52 commit 4062f0d

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
set -x
4+
5+
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
6+
yum -y install gcc gcc-c++ patch wget git make sudo
7+
yum -y install openresty-openssl111-debug-devel openresty-pcre-devel openresty-zlib-devel
8+
9+
export openssl_prefix=/usr/local/openresty-debug/openssl111
10+
export zlib_prefix=/usr/local/openresty/zlib
11+
export pcre_prefix=/usr/local/openresty/pcre
12+
13+
export cc_opt="-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -I${zlib_prefix}/include -I${pcre_prefix}/include -I${openssl_prefix}/include -O0"
14+
export ld_opt="-L${zlib_prefix}/lib -L${pcre_prefix}/lib -L${openssl_prefix}/lib -Wl,-rpath,${zlib_prefix}/lib:${pcre_prefix}/lib:${openssl_prefix}/lib"
15+
export luajit_xcflags="-DLUAJIT_ASSERT -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT -O0"
16+
export OR_PREFIX=/usr/local/openresty-debug
17+
export debug_args=--with-debug
18+
19+
./build-apisix-openresty.sh

build-apisix-openresty.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ else
1414
mod_dubbo_ver="-b 1.0.0"
1515
apisix_nginx_module_ver="-b 1.1.0"
1616
lua_var_nginx_module_ver="-b v0.5.2"
17-
debug_args=
17+
debug_args=${debug_args:-}
1818
OR_PREFIX=${OR_PREFIX:="/usr/local/openresty"}
1919
fi
2020

@@ -66,6 +66,8 @@ cd ../..
6666
version=${version:-0.0.0}
6767
cc_opt=${cc_opt:-}
6868
ld_opt=${ld_opt:-}
69+
luajit_xcflags=${luajit_xcflags:="-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT"}
70+
no_pool_patch=${no_pool_patch:-}
6971

7072
cd openresty-${or_ver} || exit 1
7173
./configure --prefix="$OR_PREFIX" \
@@ -102,8 +104,11 @@ cd openresty-${or_ver} || exit 1
102104
--with-http_gunzip_module \
103105
--with-threads \
104106
--with-compat \
105-
--with-luajit-xcflags='-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT'
106-
make
107+
--with-luajit-xcflags="$luajit_xcflags" \
108+
$no_pool_patch \
109+
-j`nproc`
110+
111+
make -j`nproc`
107112
sudo make install
108113
cd ..
109114

0 commit comments

Comments
 (0)