1
1
ngx_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
3
10
4
11
if [ $HTTP = YES ]; then
5
12
ngx_module_type=HTTP
@@ -8,7 +15,7 @@ if [ $HTTP = YES ]; then
8
15
ngx_module_name=ngx_http_async_module
9
16
ngx_module_lib=async
10
17
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
12
19
ngx_module_deps=$ngx_module_lib
13
20
ngx_module_libs="$ngx_module_lib -lm"
14
21
@@ -22,7 +29,7 @@ if [ $HTTP = YES ]; then
22
29
ngx_module_name=ngx_http_awssigv4_module
23
30
ngx_module_lib=awssig
24
31
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
26
33
ngx_module_deps=$ngx_module_lib
27
34
ngx_module_libs="$ngx_module_lib -lm"
28
35
@@ -36,7 +43,7 @@ if [ $HTTP = YES ]; then
36
43
ngx_module_name=ngx_http_curl_module
37
44
ngx_module_lib=curl
38
45
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
40
47
ngx_module_deps=$ngx_module_lib
41
48
ngx_module_libs=$ngx_module_lib
42
49
@@ -51,7 +58,7 @@ if [ $HTTP = YES ]; then
51
58
ngx_module_name=ngx_http_orig_dst_module
52
59
ngx_module_lib=httporigdst
53
60
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
55
62
ngx_module_deps=$ngx_module_lib
56
63
ngx_module_libs=$ngx_module_lib
57
64
@@ -66,7 +73,7 @@ if [ $HTTP = YES ]; then
66
73
ngx_module_name=ngx_http_upstream_custom_module
67
74
ngx_module_lib=upstream
68
75
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
70
77
ngx_module_deps=$ngx_module_lib
71
78
ngx_module_libs=$ngx_module_lib
72
79
@@ -76,19 +83,3 @@ if [ $HTTP = YES ]; then
76
83
. auto/module
77
84
fi
78
85
fi
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