Skip to content

Commit

Permalink
Change patches to optional, include latest Auto Lib Core
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Clyne committed Oct 9, 2010
1 parent 0a168e0 commit 28eb532
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 358 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -4,7 +4,7 @@

Version

0.2.9
0.2.10


Synopsis
Expand Down
3 changes: 3 additions & 0 deletions auto/build
Expand Up @@ -33,6 +33,7 @@ srcs_dir=src
include_prefix=
file_prefix=ndk_
auto_file_name=config
auto_includes_name=includes

conf_merge_filename=conf_merge.h
conf_cmd_basic_filename=conf_cmd_basic.h
Expand Down Expand Up @@ -565,6 +566,8 @@ function generate_all_h_files {
generate_include_all_includes $out
generate_dependent_includes $out

out=$output_dir/${file_prefix}$auto_includes_name.h

generate_optional_h_includes $out
generate_non_optional_h_includes $out
generate_auto_generated_h_includes $out $list
Expand Down
2 changes: 2 additions & 0 deletions auto/data/module_dependencies
@@ -1,2 +1,4 @@
complex_path complex_value path
conf_file string
core log
set_var expose_rewrite_functions
61 changes: 53 additions & 8 deletions config
@@ -1,18 +1,63 @@
ngx_addon_name=ngx_devel_kit
HTTP_MODULES="$HTTP_MODULES ngx_http_devel_kit_module"
HTTP_INCS="$HTTP_INCS $ngx_addon_dir/src $NGX_OBJS/addon/ndk"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ndk.c"
have=NDK . auto/have

. $ngx_addon_dir/ngx_auto_lib_core
###################
## 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/rewrite_functions
patch -Np1 < $ngx_addon_dir/patches/rewrite_phase_handler
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

0 comments on commit 28eb532

Please sign in to comment.