Mercurial > hg > nginx-quic
comparison auto/modules @ 6383:85dea406e18f
Dynamic modules.
The auto/module script is extended to understand ngx_module_link=DYNAMIC.
When set, it links the module as a shared object rather than statically
into nginx binary. The module can later be loaded using the "load_module"
directive.
New auto/module parameter ngx_module_order allows to define module loading
order in complex cases. By default the order is set based on ngx_module_type.
3rd party modules can be compiled dynamically using the --add-dynamic-module
configure option, which will preset ngx_module_link to "DYNAMIC" before
calling the module config script.
Win32 support is rudimentary, and only works when using MinGW gcc (which
is able to handle exports/imports automatically).
In collaboration with Ruslan Ermilov.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Feb 2016 20:25:29 +0300 |
parents | 392959224560 |
children | e0d7c2f71851 |
comparison
equal
deleted
inserted
replaced
6382:392959224560 | 6383:85dea406e18f |
---|---|
157 # ngx_http_slice_filter | 157 # ngx_http_slice_filter |
158 | 158 |
159 ngx_module_type=HTTP_FILTER | 159 ngx_module_type=HTTP_FILTER |
160 HTTP_FILTER_MODULES= | 160 HTTP_FILTER_MODULES= |
161 | 161 |
162 ngx_module_order="ngx_http_static_module \ | |
163 ngx_http_gzip_static_module \ | |
164 ngx_http_dav_module \ | |
165 ngx_http_autoindex_module \ | |
166 ngx_http_index_module \ | |
167 ngx_http_random_index_module \ | |
168 ngx_http_access_module \ | |
169 ngx_http_realip_module \ | |
170 ngx_http_write_filter_module \ | |
171 ngx_http_header_filter_module \ | |
172 ngx_http_chunked_filter_module \ | |
173 ngx_http_v2_filter_module \ | |
174 ngx_http_range_header_filter_module \ | |
175 ngx_http_gzip_filter_module \ | |
176 ngx_http_postpone_filter_module \ | |
177 ngx_http_ssi_filter_module \ | |
178 ngx_http_charset_filter_module \ | |
179 ngx_http_xslt_filter_module \ | |
180 ngx_http_image_filter_module \ | |
181 ngx_http_sub_filter_module \ | |
182 ngx_http_addition_filter_module \ | |
183 ngx_http_gunzip_filter_module \ | |
184 ngx_http_userid_filter_module \ | |
185 ngx_http_headers_filter_module \ | |
186 ngx_http_copy_filter_module \ | |
187 ngx_http_range_body_filter_module \ | |
188 ngx_http_not_modified_filter_module \ | |
189 ngx_http_slice_filter_module" | |
190 | |
162 if :; then | 191 if :; then |
163 ngx_module_name=ngx_http_write_filter_module | 192 ngx_module_name=ngx_http_write_filter_module |
164 ngx_module_incs= | 193 ngx_module_incs= |
165 ngx_module_deps= | 194 ngx_module_deps= |
166 ngx_module_srcs=src/http/ngx_http_write_filter_module.c | 195 ngx_module_srcs=src/http/ngx_http_write_filter_module.c |
261 ngx_module_link=$HTTP_CHARSET | 290 ngx_module_link=$HTTP_CHARSET |
262 | 291 |
263 . auto/module | 292 . auto/module |
264 fi | 293 fi |
265 | 294 |
266 if [ $HTTP_XSLT = YES ]; then | 295 if [ $HTTP_XSLT != NO ]; then |
267 ngx_module_name=ngx_http_xslt_filter_module | 296 ngx_module_name=ngx_http_xslt_filter_module |
268 ngx_module_incs= | 297 ngx_module_incs= |
269 ngx_module_deps= | 298 ngx_module_deps= |
270 ngx_module_srcs=src/http/modules/ngx_http_xslt_filter_module.c | 299 ngx_module_srcs=src/http/modules/ngx_http_xslt_filter_module.c |
271 ngx_module_libs=LIBXSLT | 300 ngx_module_libs=LIBXSLT |
272 ngx_module_link=$HTTP_XSLT | 301 ngx_module_link=$HTTP_XSLT |
273 | 302 |
274 . auto/module | 303 . auto/module |
275 fi | 304 fi |
276 | 305 |
277 if [ $HTTP_IMAGE_FILTER = YES ]; then | 306 if [ $HTTP_IMAGE_FILTER != NO ]; then |
278 ngx_module_name=ngx_http_image_filter_module | 307 ngx_module_name=ngx_http_image_filter_module |
279 ngx_module_incs= | 308 ngx_module_incs= |
280 ngx_module_deps= | 309 ngx_module_deps= |
281 ngx_module_srcs=src/http/modules/ngx_http_image_filter_module.c | 310 ngx_module_srcs=src/http/modules/ngx_http_image_filter_module.c |
282 ngx_module_libs=LIBGD | 311 ngx_module_libs=LIBGD |
577 ngx_module_link=$HTTP_GEO | 606 ngx_module_link=$HTTP_GEO |
578 | 607 |
579 . auto/module | 608 . auto/module |
580 fi | 609 fi |
581 | 610 |
582 if [ $HTTP_GEOIP = YES ]; then | 611 if [ $HTTP_GEOIP != NO ]; then |
583 have=NGX_HTTP_X_FORWARDED_FOR . auto/have | 612 have=NGX_HTTP_X_FORWARDED_FOR . auto/have |
584 | 613 |
585 ngx_module_name=ngx_http_geoip_module | 614 ngx_module_name=ngx_http_geoip_module |
586 ngx_module_incs= | 615 ngx_module_incs= |
587 ngx_module_deps= | 616 ngx_module_deps= |
588 ngx_module_srcs=src/http/modules/ngx_http_geoip_module.c | 617 ngx_module_srcs=src/http/modules/ngx_http_geoip_module.c |
589 ngx_module_libs= | 618 ngx_module_libs=GEOIP |
590 ngx_module_link=$HTTP_GEOIP | 619 ngx_module_link=$HTTP_GEOIP |
591 | 620 |
592 . auto/module | 621 . auto/module |
593 fi | 622 fi |
594 | 623 |
862 | 891 |
863 . auto/module | 892 . auto/module |
864 fi | 893 fi |
865 | 894 |
866 | 895 |
867 if [ $MAIL == YES ]; then | 896 if [ $MAIL != NO ]; then |
868 MAIL_MODULES= | 897 MAIL_MODULES= |
869 MAIL_DEPS= | 898 MAIL_DEPS= |
870 MAIL_INCS= | 899 MAIL_INCS= |
871 | 900 |
872 ngx_module_type=MAIL | 901 ngx_module_type=MAIL |
873 ngx_module_libs= | 902 ngx_module_libs= |
874 ngx_module_link=YES | 903 ngx_module_link=YES |
904 | |
905 ngx_module_order= | |
875 | 906 |
876 ngx_module_name="ngx_mail_module ngx_mail_core_module" | 907 ngx_module_name="ngx_mail_module ngx_mail_core_module" |
877 ngx_module_incs="src/mail" | 908 ngx_module_incs="src/mail" |
878 ngx_module_deps="src/mail/ngx_mail.h" | 909 ngx_module_deps="src/mail/ngx_mail.h" |
879 ngx_module_srcs="src/mail/ngx_mail.c \ | 910 ngx_module_srcs="src/mail/ngx_mail.c \ |
935 | 966 |
936 . auto/module | 967 . auto/module |
937 fi | 968 fi |
938 | 969 |
939 | 970 |
940 if [ $STREAM = YES ]; then | 971 if [ $STREAM != NO ]; then |
941 STREAM_MODULES= | 972 STREAM_MODULES= |
942 STREAM_DEPS= | 973 STREAM_DEPS= |
943 STREAM_INCS= | 974 STREAM_INCS= |
944 | 975 |
945 have=NGX_STREAM . auto/have | 976 have=NGX_STREAM . auto/have |
946 | 977 |
947 ngx_module_type=STREAM | 978 ngx_module_type=STREAM |
948 ngx_module_libs= | 979 ngx_module_libs= |
949 ngx_module_link=YES | 980 ngx_module_link=YES |
981 | |
982 ngx_module_order= | |
950 | 983 |
951 ngx_module_name="ngx_stream_module \ | 984 ngx_module_name="ngx_stream_module \ |
952 ngx_stream_core_module \ | 985 ngx_stream_core_module \ |
953 ngx_stream_proxy_module \ | 986 ngx_stream_proxy_module \ |
954 ngx_stream_upstream_module" | 987 ngx_stream_upstream_module" |
1039 ngx_module_name= | 1072 ngx_module_name= |
1040 ngx_module_incs= | 1073 ngx_module_incs= |
1041 ngx_module_deps= | 1074 ngx_module_deps= |
1042 ngx_module_srcs= | 1075 ngx_module_srcs= |
1043 ngx_module_libs= | 1076 ngx_module_libs= |
1077 ngx_module_order= | |
1044 ngx_module_link=ADDON | 1078 ngx_module_link=ADDON |
1045 | 1079 |
1046 if test -f $ngx_addon_dir/config; then | 1080 if test -f $ngx_addon_dir/config; then |
1047 . $ngx_addon_dir/config | 1081 . $ngx_addon_dir/config |
1048 | 1082 |
1054 fi | 1088 fi |
1055 done | 1089 done |
1056 fi | 1090 fi |
1057 | 1091 |
1058 | 1092 |
1093 if test -n "$DYNAMIC_ADDONS"; then | |
1094 | |
1095 echo configuring additional dynamic modules | |
1096 | |
1097 for ngx_addon_dir in $DYNAMIC_ADDONS | |
1098 do | |
1099 echo "adding module in $ngx_addon_dir" | |
1100 | |
1101 ngx_module_type= | |
1102 ngx_module_name= | |
1103 ngx_module_incs= | |
1104 ngx_module_deps= | |
1105 ngx_module_srcs= | |
1106 ngx_module_libs= | |
1107 ngx_module_order= | |
1108 ngx_module_link=DYNAMIC | |
1109 | |
1110 if test -f $ngx_addon_dir/config; then | |
1111 . $ngx_addon_dir/config | |
1112 | |
1113 echo " + $ngx_addon_name was configured" | |
1114 | |
1115 else | |
1116 echo "$0: error: no $ngx_addon_dir/config was found" | |
1117 exit 1 | |
1118 fi | |
1119 done | |
1120 fi | |
1121 | |
1122 | |
1059 if [ $USE_OPENSSL = YES ]; then | 1123 if [ $USE_OPENSSL = YES ]; then |
1060 ngx_module_type=CORE | 1124 ngx_module_type=CORE |
1061 ngx_module_name=ngx_openssl_module | 1125 ngx_module_name=ngx_openssl_module |
1062 ngx_module_incs= | 1126 ngx_module_incs= |
1063 ngx_module_deps=src/event/ngx_event_openssl.h | 1127 ngx_module_deps=src/event/ngx_event_openssl.h |
1064 ngx_module_srcs="src/event/ngx_event_openssl.c | 1128 ngx_module_srcs="src/event/ngx_event_openssl.c |
1065 src/event/ngx_event_openssl_stapling.c" | 1129 src/event/ngx_event_openssl_stapling.c" |
1066 ngx_module_libs= | 1130 ngx_module_libs= |
1067 ngx_module_link=YES | 1131 ngx_module_link=YES |
1132 ngx_module_order= | |
1068 | 1133 |
1069 . auto/module | 1134 . auto/module |
1070 fi | 1135 fi |
1071 | 1136 |
1072 | 1137 |
1076 ngx_module_incs= | 1141 ngx_module_incs= |
1077 ngx_module_deps=src/core/ngx_regex.h | 1142 ngx_module_deps=src/core/ngx_regex.h |
1078 ngx_module_srcs=src/core/ngx_regex.c | 1143 ngx_module_srcs=src/core/ngx_regex.c |
1079 ngx_module_libs= | 1144 ngx_module_libs= |
1080 ngx_module_link=YES | 1145 ngx_module_link=YES |
1146 ngx_module_order= | |
1081 | 1147 |
1082 . auto/module | 1148 . auto/module |
1083 fi | 1149 fi |
1084 | 1150 |
1085 | 1151 |
1098 | 1164 |
1099 NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(HTTP_DEPS)" | 1165 NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(HTTP_DEPS)" |
1100 fi | 1166 fi |
1101 | 1167 |
1102 | 1168 |
1103 if [ $MAIL = YES ]; then | 1169 if [ $MAIL != NO ]; then |
1104 modules="$modules $MAIL_MODULES" | 1170 |
1171 if [ $MAIL = YES ]; then | |
1172 modules="$modules $MAIL_MODULES" | |
1173 | |
1174 elif [ $MAIL = DYNAMIC ]; then | |
1175 ngx_module_name=$MAIL_MODULES | |
1176 ngx_module_incs= | |
1177 ngx_module_deps=$MAIL_DEPS | |
1178 ngx_module_srcs=$MAIL_SRCS | |
1179 ngx_module_libs= | |
1180 ngx_module_link=DYNAMIC | |
1181 | |
1182 . auto/module | |
1183 fi | |
1184 | |
1105 NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(MAIL_DEPS)" | 1185 NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(MAIL_DEPS)" |
1106 fi | 1186 fi |
1107 | 1187 |
1108 | 1188 |
1109 if [ $STREAM = YES ]; then | 1189 if [ $STREAM != NO ]; then |
1110 modules="$modules $STREAM_MODULES" | 1190 |
1191 if [ $STREAM = YES ]; then | |
1192 modules="$modules $STREAM_MODULES" | |
1193 | |
1194 elif [ $STREAM = DYNAMIC ]; then | |
1195 ngx_module_name=$STREAM_MODULES | |
1196 ngx_module_incs= | |
1197 ngx_module_deps=$STREAM_DEPS | |
1198 ngx_module_srcs=$STREAM_SRCS | |
1199 ngx_module_libs= | |
1200 ngx_module_link=DYNAMIC | |
1201 | |
1202 . auto/module | |
1203 fi | |
1204 | |
1111 NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(STREAM_DEPS)" | 1205 NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(STREAM_DEPS)" |
1112 fi | 1206 fi |
1113 | 1207 |
1114 | 1208 |
1115 ngx_module_type=MISC | 1209 ngx_module_type=MISC |
1165 cat << END >> $NGX_MODULES_C | 1259 cat << END >> $NGX_MODULES_C |
1166 NULL | 1260 NULL |
1167 }; | 1261 }; |
1168 | 1262 |
1169 END | 1263 END |
1264 | |
1265 echo 'char *ngx_module_names[] = {' >> $NGX_MODULES_C | |
1266 | |
1267 for mod in $modules | |
1268 do | |
1269 echo " \"$mod\"," >> $NGX_MODULES_C | |
1270 done | |
1271 | |
1272 cat << END >> $NGX_MODULES_C | |
1273 NULL | |
1274 }; | |
1275 | |
1276 END |