ngx_addon_name=ngx_http_error_abuse_module
ngx_module_type=HTTP_FILTER
ngx_module_name=ngx_http_error_abuse_module
# Production sources -- always compiled, never depend on the ci/t/harness
# submodule. A plain (non-recursive) clone or a source archive contains only
# the submodule gitlink, so listing ci/t/harness files here for a packaged
# build breaks `make modules` with "No rule to make target".
ngx_module_srcs="$ngx_addon_dir/src/ngx_http_error_abuse_module.c \
                 $ngx_addon_dir/src/ngx_http_error_abuse_scan.c \
                 $ngx_addon_dir/src/ngx_http_error_abuse_win32.c \
                 $ngx_addon_dir/src/ngx_http_error_abuse_probe_hooks.c"
ngx_module_incs="$ngx_addon_dir/src ${NGX_ERROR_ABUSE_INCS:-}"
ngx_module_deps="$ngx_addon_dir/src/ngx_http_error_abuse_scan.h \
                 $ngx_addon_dir/src/ngx_http_error_abuse_win32.h \
                 $ngx_addon_dir/src/ngx_http_error_abuse_probe_hooks.h \
                 $ngx_addon_dir/src/ngx_http_error_abuse_stats.h \
                 $ngx_addon_dir/src/ngx_http_error_abuse_tls.h"

# The CI-only test probe comes from ci/t/harness (nginx-module-testkit). It is
# real code only when NGX_TEST_HARNESS is defined -- the CI build sets both
# TEST_HARNESS=1 (seen here) and -DNGX_TEST_HARNESS (the compile define), and
# never for a packaged build. Gate its sources on the same switch so the
# submodule is a hard prerequisite ONLY for the harness build.
if [ "${TEST_HARNESS:-0}" = "1" ]; then
    ngx_module_srcs="$ngx_module_srcs \
                 $ngx_addon_dir/ci/t/harness/src/ngx_test_probe.c \
                 $ngx_addon_dir/ci/t/harness/src/ngx_test_probe_arm.c"
    ngx_module_deps="$ngx_module_deps \
                 $ngx_addon_dir/ci/t/harness/src/ngx_test_probe.h"
    ngx_module_incs="$ngx_module_incs $ngx_addon_dir/ci/t/harness/src"
fi
if test -n "${NGX_ERROR_ABUSE_LIBS:-}"; then
    ngx_module_libs="$NGX_ERROR_ABUSE_LIBS"
elif [ "${NGX_PLATFORM:-}" = win32 ]; then
    case "${NGX_CC_NAME:-}" in
        clang | gcc)
            ngx_module_libs="-lhiredis -lhiredis_ssl -lssl -lcrypto \
                             -lcrypt32 -ladvapi32 -lws2_32"
            ;;
        *)
            ngx_module_libs="hiredis.lib hiredis_ssl.lib libssl.lib \
                             libcrypto.lib crypt32.lib advapi32.lib ws2_32.lib"
            ;;
    esac
else
    ngx_module_libs="-lhiredis -lhiredis_ssl -lssl -lcrypto"
fi
ngx_module_order="$ngx_module_name \
                  ngx_http_headers_filter_module \
                  ngx_http_copy_filter_module"

. auto/module
