ngx_addon_name=ngx_http_cf_realip_module

# Support both dynamic (preferred) and static build contexts.
if test -n "$ngx_module_link"; then
    # Dynamic module path
    ngx_module_type=HTTP
    ngx_module_name=ngx_http_cf_realip_module
    ngx_module_srcs="$ngx_addon_dir/ngx_http_cf_realip_module.c"
    # OpenSSL crypto for SHA256 hashing
    ngx_module_libs="-lcrypto"
    . auto/module
else
    # Static fallback
    HTTP_MODULES="$HTTP_MODULES ngx_http_cf_realip_module"
    NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_cf_realip_module.c"
fi

# Ensure OpenSSL crypto for SHA256
case " $CORE_LIBS " in
    *" -lcrypto "*) ;;
    *) CORE_LIBS="$CORE_LIBS -lcrypto" ;;
esac
