# shellcheck source=auto/rust
. $ngx_addon_dir/auto/rust

# ngx_addon_name determines the build directory and should be set before
# any modules are defined

ngx_addon_name=ngx_rust_examples

if [ $HTTP = YES ]; then
    ngx_module_type=HTTP
    ngx_module_incs=
    ngx_module_deps=
    ngx_module_order=

    ngx_rust_target_type=EXAMPLE
    ngx_rust_target_features=

    if :; then
        ngx_module_name=ngx_http_async_module
        ngx_module_libs="-lm"
        ngx_rust_target_name=async

        ngx_rust_module
    fi

    if :; then
        ngx_module_name=ngx_http_awssigv4_module
        ngx_module_libs="-lm"
        ngx_rust_target_name=awssig

        ngx_rust_module
    fi

    if :; then
        ngx_module_name=ngx_http_curl_module
        ngx_module_libs=
        ngx_rust_target_name=curl

        ngx_rust_module
    fi

    if :; then
        ngx_module_name=ngx_http_shared_dict_module
        ngx_module_libs=
        ngx_rust_target_name=shared_dict

        ngx_rust_module
    fi

    if :; then
        ngx_module_name=ngx_http_upstream_custom_module
        ngx_module_libs=
        ngx_rust_target_name=upstream

        ngx_rust_module
    fi

    if [ "$NGX_SYSTEM" = Linux ]; then
        ngx_module_name=ngx_http_orig_dst_module
        ngx_module_libs=
        ngx_rust_target_name=httporigdst
        ngx_rust_target_features=linux

        ngx_rust_module
    fi
fi
