-
Notifications
You must be signed in to change notification settings - Fork 199
/
config
63 lines (46 loc) · 1.67 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
###################
## NGINX VERSION ##
###################
get_nginx_version() {
# We get the Nginx version number from the string form rather than
# nginx_version because it is available in more (every?) version
cat src/core/nginx.h |
grep '#define NGINX_VERSION' |
sed -r \
-e 's/[^0-9.]*([0-9.]+).*/\1/' \
-e 's/([0-9]+\.[0-9]+\.)([0-9]{1})$/\100\2/' \
-e 's/([0-9]+\.[0-9]+\.)([0-9]{2})$/\10\2/' \
-e 's/\.//g' \
-e 's/^0+(.*)/\1/'
}
NGINX_VERSION=`get_nginx_version`
########################
## MACROS & FUNCTIONS ##
########################
echo "building Nginx Development Kit utility functions and macros ..."
autobuild="$ngx_addon_dir/auto/build"
chmod +x $autobuild
$autobuild `pwd` $NGX_OBJS/addon/ndk || exit 1
#############
## PATCHES ##
#############
echo "applying Nginx Development Kit source patches ..."
patch -Np1 < $ngx_addon_dir/patches/auto_config
patch -Np1 < $ngx_addon_dir/patches/expose_rewrite_functions
if [ $NGINX_VERSION -ge 8042 ]; then
patch -Np1 < $ngx_addon_dir/patches/rewrite_phase_handler
fi
#####################
## CONFIG SETTINGS ##
#####################
ngx_addon_name=ngx_devel_kit
ngx_objs_dir=$NGX_OBJS/addon/ndk
CORE_INCS="$CORE_INCS $ngx_objs_dir"
HTTP_INCS="$HTTP_INCS $ngx_addon_dir/src $ngx_objs_dir"
HTTP_MODULES="$HTTP_MODULES ngx_http_devel_kit_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ndk.c"
have=NDK . auto/have
##############
## INCLUDES ##
##############
. $ngx_addon_dir/ngx_auto_lib_core