# libzstd discovery (ngx_zstd_opt_I / ngx_zstd_opt_L, version advisory) runs
# once in ../auto/zstd, sourced from the top-level config before this file.
# Here we only declare the static module itself; the link flags are passed
# via ngx_module_libs only (never the build-global NGX_LD_OPT — see
# ../auto/zstd).

# build the ngx_http_zstd_static_module
HTTP_ZSTD_SRCS="$ngx_addon_dir/ngx_http_zstd_static_module.c"

# Shared inline headers included by this .c file. Declare them as build
# dependencies so an incremental build rebuilds the object whenever either
# header changes; without this, edits can leave stale .o files behind.
HTTP_ZSTD_DEPS="$ngx_addon_dir/ngx_http_zstd_common.h \
                $ngx_addon_dir/ngx_http_zstd_frame_probe.h"

ngx_addon_name=ngx_http_zstd_static_module
ngx_module_type=HTTP
ngx_module_name=ngx_http_zstd_static_module
ngx_module_incs="$ngx_zstd_incs"
ngx_module_srcs=$HTTP_ZSTD_SRCS
ngx_module_deps=$HTTP_ZSTD_DEPS
# No libs on purpose: the static module serves pre-compressed .zst files
# and calls no libzstd function. Requesting $ngx_zstd_opt_L here only
# produced a toolchain-dependent vestigial DT_NEEDED on the .so —
# kept by linkers without --as-needed, dropped by toolchains that
# default to it (e.g. Ubuntu) — encoding a linker default instead of
# module behaviour, and differing from sibling static modules (the
# brotli static module requests nothing).
ngx_module_libs=
ngx_module_order="ngx_http_brotli_static_module \
                  $ngx_module_name"

. auto/module
