From b157ed379c3c9c5c1846caa594d6733e88406863 Mon Sep 17 00:00:00 2001
From: Jeffrey Kriegsman <jeffrey@kriegsman.eu>
Date: Mon, 15 Feb 2016 15:36:21 +0100
Subject: [PATCH] Feature: nginx dynamic module support
Origin: other, https://github.com/yaoweibin/ngx_http_substitutions_filter_module/pull/19

---
 config | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/config b/config
index fdb016c..f1de029 100644
--- a/config
+++ b/config
@@ -1,3 +1,15 @@
 ngx_addon_name=ngx_http_subs_filter_module
-HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_subs_filter_module"
-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_subs_filter_module.c"
+
+if test -n "$ngx_module_link"; then
+    ngx_module_type=HTTP_FILTER
+    ngx_module_name=ngx_http_subs_filter_module
+    ngx_module_incs=
+    ngx_module_deps=
+    ngx_module_srcs="$ngx_addon_dir/ngx_http_subs_filter_module.c"
+    ngx_module_libs=""
+
+    . auto/module
+else
+    HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_subs_filter_module"
+    NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_subs_filter_module.c"
+fi
