forked from bigplum/nginx-tcp-lua-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig
174 lines (155 loc) · 5.82 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#ngx_feature_libs="-llua -lm"
#ngx_feature_libs="-lluajit-5.1"
ngx_feature="Lua library"
ngx_feature_libs="-llua -lm"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <lauxlib.h>"
ngx_feature_path=
ngx_feature_test="(void) luaL_newstate();"
if [ -n "$LUAJIT_INC" -o -n "$LUAJIT_LIB" ]; then
# explicitly set Lua lib path
ngx_feature="LuaJIT library in $LUAJIT_LIB and $LUAJIT_INC (specified by the LUAJIT_LIB and LUAJIT_INC env)"
ngx_feature_path="$LUAJIT_INC"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R$LUAJIT_LIB -L$LUAJIT_LIB -lluajit-5.1 -lm"
else
ngx_feature_libs="-L$LUAJIT_LIB -lluajit-5.1 -lm"
fi
. auto/feature
if [ $ngx_found = no ]; then
cat << END
$0: error: ngx_tcp_lua_module requires the Lua or LuaJIT library and LUAJIT_LIB is defined as $LUAJIT_LIB and LUAJIT_INC (path for lua.h) $LUAJIT_INC, but we cannot find LuaJIT there.
END
exit 1
fi
case "$NGX_PLATFORM" in
Darwin:*)
case "$NGX_MACHINE" in
amd64 | x86_64 | i386)
echo "adding extra linking options needed by LuaJIT"
ngx_feature_libs="$ngx_feature_libs -pagezero_size 10000 -image_base 100000000"
;;
*)
;;
esac
;;
*)
;;
esac
else
if [ -n "$LUA_INC" -o -n "$LUA_LIB" ]; then
# explicitly set Lua lib path
ngx_feature="Lua library in $LUA_LIB and $LUA_INC (specified by the LUA_LIB and LUA_INC env)"
ngx_feature_path="$LUA_INC"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R$LUA_LIB -L$LUA_LIB -llua -lm"
else
ngx_feature_libs="-L$LUA_LIB -llua -lm"
fi
. auto/feature
if [ $ngx_found = no ]; then
cat << END
$0: error: ngx_tcp_lua_module requires the Lua or LuaJIT library and LUA_LIB is defined as $LUA_LIB and LUA_INC (path for lua.h) is $LUA_INC, but we cannot find standard Lua there.
END
exit 1
fi
else
# auto-discovery
ngx_feature="Lua library"
ngx_feature_libs="-llua -lm"
. auto/feature
if [ $ngx_found = no ]; then
# OpenBSD
ngx_feature="Lua library in /usr/local/"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -llua -lm"
else
ngx_feature_libs="-L/usr/local/lib -llua -lm"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD
ngx_feature="Lua library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include/"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lm -llua"
else
ngx_feature_libs="-L/usr/pkg/lib -lm -llua"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="Lua library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lm -llua"
else
ngx_feature_libs="-L/opt/local/lib -lm -llua"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# FreeBSD
ngx_feature="Lua library in /usr/local/../lua51/"
ngx_feature_path="/usr/local/include/lua51"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib/lua51 -L/usr/local/lib/lua51 -llua -lm"
else
ngx_feature_libs="-L/usr/local/lib/lua51 -llua -lm"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# Debian
ngx_feature="Lua library in /usr/"
ngx_feature_path="/usr/include/lua5.1"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/lib -L/usr/lib -lm -llua5.1"
else
ngx_feature_libs="-L/usr/lib -lm -llua5.1"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# Gentoo with LuaJIT-2.0
ngx_feature="LuaJIT library in /usr/"
ngx_feature_path="/usr/include/luajit-2.0"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/lib -L/usr/lib -lm -lluajit-5.1"
else
ngx_feature_libs="-L/usr/lib -lm -lluajit-5.1"
fi
. auto/feature
fi
fi
fi
if [ $ngx_found = yes ]; then
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
else
cat << END
$0: error: ngx_tcp_lua_module requires the Lua library.
END
exit 1
fi
#CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
ngx_addon_name=ngx_tcp_lua_module
EVENT_MODULES="$EVENT_MODULES ngx_tcp_module ngx_tcp_core_module ngx_tcp_lua_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_tcp.c \
$ngx_addon_dir/src/ngx_tcp_core_module.c \
$ngx_addon_dir/src/ngx_tcp_session.c \
$ngx_addon_dir/src/ngx_tcp_access.c \
$ngx_addon_dir/src/ngx_tcp_lua_module.c \
$ngx_addon_dir/src/ngx_tcp_lua_cache.c \
$ngx_addon_dir/src/ngx_tcp_lua_clfactory.c \
$ngx_addon_dir/src/ngx_tcp_lua_util.c \
$ngx_addon_dir/src/ngx_tcp_lua_exception.c \
$ngx_addon_dir/src/ngx_tcp_lua_output.c \
$ngx_addon_dir/src/ngx_tcp_lua_socket.c \
$ngx_addon_dir/src/ngx_tcp_lua_log.c \
$ngx_addon_dir/src/ngx_tcp_lua_time.c \
$ngx_addon_dir/src/ngx_tcp_lua_string.c"