[PATCH] Configure: introduced --with-*-module-opt option

Dmitry Volyntsev xeioex at nginx.com
Wed May 10 07:00:35 UTC 2023

# HG changeset patch
# User Dmitry Volyntsev <xeioex at nginx.com>
# Date 1683701820 25200
#      Tue May 09 23:57:00 2023 -0700
# Node ID 85643f113750f1c49a7ea3dea568da4e3137ec4b
# Parent  b71e69247483631bd8fc79a47cc32b762625b1fb
Configure: introduced --with-*-module-opt option.

--with-*-module-opt provides a generic way to pass arbitrary configure
options to an nginx addon configure script.

For example when --with-foo-module-opt=value is provided the following
variable is defined: $NGX_FOO_MODULE_OPT.

While $NGX_FOO_MODULE_OPT can be provided as an environment variable it
is inconsistent with other similar options like --with-pcre-opt or
--with-openssl-opt.  Also the introduced option enforces a unified named
convention for opt variables for nginx addons.

diff --git a/auto/options b/auto/options
--- a/auto/options
+++ b/auto/options
@@ -343,6 +343,11 @@ use the \"--with-mail_ssl_module\" optio
         --add-module=*)                  NGX_ADDONS="$NGX_ADDONS $value" ;;
         --add-dynamic-module=*)          DYNAMIC_ADDONS="$DYNAMIC_ADDONS $value" ;;
+        --with-*-module-opt=*)
+            mod=`echo "$option" | sed -e 's/--with-//' -e 's/-module-opt.*//' \
+                 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
+            eval "NGX_${mod}_MODULE_OPT"="$value"
+        ;;
         --with-compat)                   NGX_COMPAT=YES             ;;

More information about the nginx-devel mailing list