11ngx_addon_name=ngx_rust_examples
2- ngx_cargo_profile=ngx-module
2+
3+ if [ "$NGX_DEBUG" = YES ]; then
4+ ngx_cargo_profile=dev
5+ ngx_cargo_profile_dir=debug
6+ else
7+ ngx_cargo_profile=release
8+ ngx_cargo_profile_dir=$ngx_cargo_profile
9+ fi
310
411if [ $HTTP = YES ]; then
512 ngx_module_type=HTTP
@@ -8,7 +15,7 @@ if [ $HTTP = YES ]; then
815 ngx_module_name=ngx_http_async_module
916 ngx_module_lib=async
1017
11- ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile /examples/lib$ngx_module_lib.a
18+ ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile_dir /examples/lib$ngx_module_lib.a
1219 ngx_module_deps=$ngx_module_lib
1320 ngx_module_libs="$ngx_module_lib -lm"
1421
@@ -22,7 +29,7 @@ if [ $HTTP = YES ]; then
2229 ngx_module_name=ngx_http_awssigv4_module
2330 ngx_module_lib=awssig
2431
25- ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile /examples/lib$ngx_module_lib.a
32+ ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile_dir /examples/lib$ngx_module_lib.a
2633 ngx_module_deps=$ngx_module_lib
2734 ngx_module_libs="$ngx_module_lib -lm"
2835
@@ -36,7 +43,7 @@ if [ $HTTP = YES ]; then
3643 ngx_module_name=ngx_http_curl_module
3744 ngx_module_lib=curl
3845
39- ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile /examples/lib$ngx_module_lib.a
46+ ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile_dir /examples/lib$ngx_module_lib.a
4047 ngx_module_deps=$ngx_module_lib
4148 ngx_module_libs=$ngx_module_lib
4249
@@ -51,7 +58,7 @@ if [ $HTTP = YES ]; then
5158 ngx_module_name=ngx_http_orig_dst_module
5259 ngx_module_lib=httporigdst
5360
54- ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile /examples/lib$ngx_module_lib.a
61+ ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile_dir /examples/lib$ngx_module_lib.a
5562 ngx_module_deps=$ngx_module_lib
5663 ngx_module_libs=$ngx_module_lib
5764
@@ -66,7 +73,7 @@ if [ $HTTP = YES ]; then
6673 ngx_module_name=ngx_http_upstream_custom_module
6774 ngx_module_lib=upstream
6875
69- ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile /examples/lib$ngx_module_lib.a
76+ ngx_module_lib=$NGX_OBJS/$ngx_addon_name/$ngx_cargo_profile_dir /examples/lib$ngx_module_lib.a
7077 ngx_module_deps=$ngx_module_lib
7178 ngx_module_libs=$ngx_module_lib
7279
@@ -76,19 +83,3 @@ if [ $HTTP = YES ]; then
7683 . auto/module
7784 fi
7885fi
79-
80- # Write a cargo config with the $ngx_cargo_profile definition (optional)
81-
82- if [ "$NGX_DEBUG" = YES ]; then
83- NGX_CARGO_PROFILE_BASE=dev
84- else
85- NGX_CARGO_PROFILE_BASE=release
86- fi
87-
88- mkdir -p "$NGX_OBJS/.cargo"
89- cat > "$NGX_OBJS/.cargo/config.toml" << END
90-
91- [profile.$ngx_cargo_profile]
92- inherits = "$NGX_CARGO_PROFILE_BASE"
93-
94- END
0 commit comments