xref: /nginx/auto/modules (revision 7233:2713b2dbf5bb)
1
2# Copyright (C) Igor Sysoev
3# Copyright (C) Nginx, Inc.
4
5
6if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then
7    EVENT_SELECT=YES
8fi
9
10if [ $EVENT_SELECT = YES ]; then
11    have=NGX_HAVE_SELECT . auto/have
12    CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
13    EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
14fi
15
16
17if [ $EVENT_POLL = NO -a $EVENT_FOUND = NO ]; then
18    EVENT_POLL=YES
19fi
20
21if [ $EVENT_POLL = YES ]; then
22    have=NGX_HAVE_POLL . auto/have
23    CORE_SRCS="$CORE_SRCS $POLL_SRCS"
24    EVENT_MODULES="$EVENT_MODULES $POLL_MODULE"
25fi
26
27
28if [ $NGX_TEST_BUILD_DEVPOLL = YES ]; then
29    have=NGX_HAVE_DEVPOLL . auto/have
30    have=NGX_TEST_BUILD_DEVPOLL . auto/have
31    EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
32    CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
33fi
34
35
36if [ $NGX_TEST_BUILD_EVENTPORT = YES ]; then
37    have=NGX_HAVE_EVENTPORT . auto/have
38    have=NGX_TEST_BUILD_EVENTPORT . auto/have
39    EVENT_MODULES="$EVENT_MODULES $EVENTPORT_MODULE"
40    CORE_SRCS="$CORE_SRCS $EVENTPORT_SRCS"
41fi
42
43if [ $NGX_TEST_BUILD_EPOLL = YES ]; then
44    have=NGX_HAVE_EPOLL . auto/have
45    have=NGX_HAVE_EPOLLRDHUP . auto/have
46    have=NGX_HAVE_EPOLLEXCLUSIVE . auto/have
47    have=NGX_HAVE_EVENTFD . auto/have
48    have=NGX_TEST_BUILD_EPOLL . auto/have
49    EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
50    CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
51fi
52
53if [ $NGX_TEST_BUILD_SOLARIS_SENDFILEV = YES ]; then
54    have=NGX_TEST_BUILD_SOLARIS_SENDFILEV . auto/have
55    CORE_SRCS="$CORE_SRCS $SOLARIS_SENDFILEV_SRCS"
56fi
57
58
59if [ $HTTP = YES ]; then
60    HTTP_MODULES=
61    HTTP_DEPS=
62    HTTP_INCS=
63
64    ngx_module_type=HTTP
65
66    if :; then
67        ngx_module_name="ngx_http_module \
68                         ngx_http_core_module \
69                         ngx_http_log_module \
70                         ngx_http_upstream_module"
71        ngx_module_incs="src/http src/http/modules"
72        ngx_module_deps="src/http/ngx_http.h \
73                         src/http/ngx_http_request.h \
74                         src/http/ngx_http_config.h \
75                         src/http/ngx_http_core_module.h \
76                         src/http/ngx_http_cache.h \
77                         src/http/ngx_http_variables.h \
78                         src/http/ngx_http_script.h \
79                         src/http/ngx_http_upstream.h \
80                         src/http/ngx_http_upstream_round_robin.h"
81        ngx_module_srcs="src/http/ngx_http.c \
82                         src/http/ngx_http_core_module.c \
83                         src/http/ngx_http_special_response.c \
84                         src/http/ngx_http_request.c \
85                         src/http/ngx_http_parse.c \
86                         src/http/modules/ngx_http_log_module.c \
87                         src/http/ngx_http_request_body.c \
88                         src/http/ngx_http_variables.c \
89                         src/http/ngx_http_script.c \
90                         src/http/ngx_http_upstream.c \
91                         src/http/ngx_http_upstream_round_robin.c"
92        ngx_module_libs=
93        ngx_module_link=YES
94
95        . auto/module
96    fi
97
98
99    if [ $HTTP_CACHE = YES ]; then
100        have=NGX_HTTP_CACHE . auto/have
101        HTTP_SRCS="$HTTP_SRCS $HTTP_FILE_CACHE_SRCS"
102    fi
103
104
105    if [ $HTTP_SSI = YES ]; then
106        HTTP_POSTPONE=YES
107    fi
108
109
110    if [ $HTTP_SLICE = YES ]; then
111        HTTP_POSTPONE=YES
112    fi
113
114
115    if [ $HTTP_ADDITION = YES ]; then
116        HTTP_POSTPONE=YES
117    fi
118
119
120    # the module order is important
121    #     ngx_http_static_module
122    #     ngx_http_gzip_static_module
123    #     ngx_http_dav_module
124    #     ngx_http_autoindex_module
125    #     ngx_http_index_module
126    #     ngx_http_random_index_module
127    #
128    #     ngx_http_access_module
129    #     ngx_http_realip_module
130    #
131    #
132    # the filter order is important
133    #     ngx_http_write_filter
134    #     ngx_http_header_filter
135    #     ngx_http_chunked_filter
136    #     ngx_http_v2_filter
137    #     ngx_http_range_header_filter
138    #     ngx_http_gzip_filter
139    #     ngx_http_postpone_filter
140    #     ngx_http_ssi_filter
141    #     ngx_http_charset_filter
142    #         ngx_http_xslt_filter
143    #         ngx_http_image_filter
144    #         ngx_http_sub_filter
145    #         ngx_http_addition_filter
146    #         ngx_http_gunzip_filter
147    #         ngx_http_userid_filter
148    #         ngx_http_headers_filter
149    #     ngx_http_copy_filter
150    #     ngx_http_range_body_filter
151    #     ngx_http_not_modified_filter
152    #     ngx_http_slice_filter
153
154    ngx_module_type=HTTP_FILTER
155    HTTP_FILTER_MODULES=
156
157    ngx_module_order="ngx_http_static_module \
158                      ngx_http_gzip_static_module \
159                      ngx_http_dav_module \
160                      ngx_http_autoindex_module \
161                      ngx_http_index_module \
162                      ngx_http_random_index_module \
163                      ngx_http_access_module \
164                      ngx_http_realip_module \
165                      ngx_http_write_filter_module \
166                      ngx_http_header_filter_module \
167                      ngx_http_chunked_filter_module \
168                      ngx_http_v2_filter_module \
169                      ngx_http_range_header_filter_module \
170                      ngx_http_gzip_filter_module \
171                      ngx_http_postpone_filter_module \
172                      ngx_http_ssi_filter_module \
173                      ngx_http_charset_filter_module \
174                      ngx_http_xslt_filter_module \
175                      ngx_http_image_filter_module \
176                      ngx_http_sub_filter_module \
177                      ngx_http_addition_filter_module \
178                      ngx_http_gunzip_filter_module \
179                      ngx_http_userid_filter_module \
180                      ngx_http_headers_filter_module \
181                      ngx_http_copy_filter_module \
182                      ngx_http_range_body_filter_module \
183                      ngx_http_not_modified_filter_module \
184                      ngx_http_slice_filter_module"
185
186    if :; then
187        ngx_module_name=ngx_http_write_filter_module
188        ngx_module_incs=
189        ngx_module_deps=
190        ngx_module_srcs=src/http/ngx_http_write_filter_module.c
191        ngx_module_libs=
192        ngx_module_link=YES
193
194        . auto/module
195    fi
196
197    if :; then
198        ngx_module_name=ngx_http_header_filter_module
199        ngx_module_incs=
200        ngx_module_deps=
201        ngx_module_srcs=src/http/ngx_http_header_filter_module.c
202        ngx_module_libs=
203        ngx_module_link=YES
204
205        . auto/module
206    fi
207
208    if :; then
209        ngx_module_name=ngx_http_chunked_filter_module
210        ngx_module_incs=
211        ngx_module_deps=
212        ngx_module_srcs=src/http/modules/ngx_http_chunked_filter_module.c
213        ngx_module_libs=
214        ngx_module_link=YES
215
216        . auto/module
217    fi
218
219    if [ $HTTP_V2 = YES ]; then
220        ngx_module_name=ngx_http_v2_filter_module
221        ngx_module_incs=
222        ngx_module_deps=
223        ngx_module_srcs=src/http/v2/ngx_http_v2_filter_module.c
224        ngx_module_libs=
225        ngx_module_link=$HTTP_V2
226
227        . auto/module
228    fi
229
230    if :; then
231        ngx_module_name=ngx_http_range_header_filter_module
232        ngx_module_incs=
233        ngx_module_deps=
234        ngx_module_srcs=src/http/modules/ngx_http_range_filter_module.c
235        ngx_module_libs=
236        ngx_module_link=YES
237
238        . auto/module
239    fi
240
241    if [ $HTTP_GZIP = YES ]; then
242        have=NGX_HTTP_GZIP . auto/have
243        USE_ZLIB=YES
244
245        ngx_module_name=ngx_http_gzip_filter_module
246        ngx_module_incs=
247        ngx_module_deps=
248        ngx_module_srcs=src/http/modules/ngx_http_gzip_filter_module.c
249        ngx_module_libs=
250        ngx_module_link=$HTTP_GZIP
251
252        . auto/module
253    fi
254
255    if [ $HTTP_POSTPONE = YES ]; then
256        ngx_module_name=ngx_http_postpone_filter_module
257        ngx_module_incs=
258        ngx_module_deps=
259        ngx_module_srcs=src/http/ngx_http_postpone_filter_module.c
260        ngx_module_libs=
261        ngx_module_link=$HTTP_POSTPONE
262
263        . auto/module
264    fi
265
266    if [ $HTTP_SSI = YES ]; then
267        have=NGX_HTTP_SSI . auto/have
268
269        ngx_module_name=ngx_http_ssi_filter_module
270        ngx_module_incs=
271        ngx_module_deps=src/http/modules/ngx_http_ssi_filter_module.h
272        ngx_module_srcs=src/http/modules/ngx_http_ssi_filter_module.c
273        ngx_module_libs=
274        ngx_module_link=$HTTP_SSI
275
276        . auto/module
277    fi
278
279    if [ $HTTP_CHARSET = YES ]; then
280        ngx_module_name=ngx_http_charset_filter_module
281        ngx_module_incs=
282        ngx_module_deps=
283        ngx_module_srcs=src/http/modules/ngx_http_charset_filter_module.c
284        ngx_module_libs=
285        ngx_module_link=$HTTP_CHARSET
286
287        . auto/module
288    fi
289
290    if [ $HTTP_XSLT != NO ]; then
291        ngx_module_name=ngx_http_xslt_filter_module
292        ngx_module_incs=
293        ngx_module_deps=
294        ngx_module_srcs=src/http/modules/ngx_http_xslt_filter_module.c
295        ngx_module_libs=LIBXSLT
296        ngx_module_link=$HTTP_XSLT
297
298        . auto/module
299    fi
300
301    if [ $HTTP_IMAGE_FILTER != NO ]; then
302        ngx_module_name=ngx_http_image_filter_module
303        ngx_module_incs=
304        ngx_module_deps=
305        ngx_module_srcs=src/http/modules/ngx_http_image_filter_module.c
306        ngx_module_libs=LIBGD
307        ngx_module_link=$HTTP_IMAGE_FILTER
308
309        . auto/module
310    fi
311
312    if [ $HTTP_SUB = YES ]; then
313        ngx_module_name=ngx_http_sub_filter_module
314        ngx_module_incs=
315        ngx_module_deps=
316        ngx_module_srcs=src/http/modules/ngx_http_sub_filter_module.c
317        ngx_module_libs=
318        ngx_module_link=$HTTP_SUB
319
320        . auto/module
321    fi
322
323    if [ $HTTP_ADDITION = YES ]; then
324        ngx_module_name=ngx_http_addition_filter_module
325        ngx_module_incs=
326        ngx_module_deps=
327        ngx_module_srcs=src/http/modules/ngx_http_addition_filter_module.c
328        ngx_module_libs=
329        ngx_module_link=$HTTP_ADDITION
330
331        . auto/module
332    fi
333
334    if [ $HTTP_GUNZIP = YES ]; then
335        have=NGX_HTTP_GZIP . auto/have
336        USE_ZLIB=YES
337
338        ngx_module_name=ngx_http_gunzip_filter_module
339        ngx_module_incs=
340        ngx_module_deps=
341        ngx_module_srcs=src/http/modules/ngx_http_gunzip_filter_module.c
342        ngx_module_libs=
343        ngx_module_link=$HTTP_GUNZIP
344
345        . auto/module
346    fi
347
348    if [ $HTTP_USERID = YES ]; then
349        ngx_module_name=ngx_http_userid_filter_module
350        ngx_module_incs=
351        ngx_module_deps=
352        ngx_module_srcs=src/http/modules/ngx_http_userid_filter_module.c
353        ngx_module_libs=
354        ngx_module_link=$HTTP_USERID
355
356        . auto/module
357    fi
358
359    if :; then
360        ngx_module_name=ngx_http_headers_filter_module
361        ngx_module_incs=
362        ngx_module_deps=
363        ngx_module_srcs=src/http/modules/ngx_http_headers_filter_module.c
364        ngx_module_libs=
365        ngx_module_link=YES
366
367        . auto/module
368    fi
369
370
371    ngx_module_type=HTTP_INIT_FILTER
372    HTTP_INIT_FILTER_MODULES=
373
374    if :; then
375        ngx_module_name=ngx_http_copy_filter_module
376        ngx_module_incs=
377        ngx_module_deps=
378        ngx_module_srcs=src/http/ngx_http_copy_filter_module.c
379        ngx_module_libs=
380        ngx_module_link=YES
381
382        . auto/module
383    fi
384
385    if :; then
386        ngx_module_name=ngx_http_range_body_filter_module
387        ngx_module_incs=
388        ngx_module_deps=
389        ngx_module_srcs=
390        ngx_module_libs=
391        ngx_module_link=YES
392
393        . auto/module
394    fi
395
396    if :; then
397        ngx_module_name=ngx_http_not_modified_filter_module
398        ngx_module_incs=
399        ngx_module_deps=
400        ngx_module_srcs=src/http/modules/ngx_http_not_modified_filter_module.c
401        ngx_module_libs=
402        ngx_module_link=YES
403
404        . auto/module
405    fi
406
407    if [ $HTTP_SLICE = YES ]; then
408        ngx_module_name=ngx_http_slice_filter_module
409        ngx_module_incs=
410        ngx_module_deps=
411        ngx_module_srcs=src/http/modules/ngx_http_slice_filter_module.c
412        ngx_module_libs=
413        ngx_module_link=$HTTP_SLICE
414
415        . auto/module
416    fi
417
418
419    ngx_module_type=HTTP
420
421    if [ $HTTP_V2 = YES ]; then
422        have=NGX_HTTP_V2 . auto/have
423        have=NGX_HTTP_HEADERS . auto/have
424
425        ngx_module_name=ngx_http_v2_module
426        ngx_module_incs=src/http/v2
427        ngx_module_deps="src/http/v2/ngx_http_v2.h \
428                         src/http/v2/ngx_http_v2_module.h"
429        ngx_module_srcs="src/http/v2/ngx_http_v2.c \
430                         src/http/v2/ngx_http_v2_table.c \
431                         src/http/v2/ngx_http_v2_encode.c \
432                         src/http/v2/ngx_http_v2_huff_decode.c \
433                         src/http/v2/ngx_http_v2_huff_encode.c \
434                         src/http/v2/ngx_http_v2_module.c"
435        ngx_module_libs=
436        ngx_module_link=$HTTP_V2
437
438        . auto/module
439    fi
440
441    if :; then
442        ngx_module_name=ngx_http_static_module
443        ngx_module_incs=
444        ngx_module_deps=
445        ngx_module_srcs=src/http/modules/ngx_http_static_module.c
446        ngx_module_libs=
447        ngx_module_link=YES
448
449        . auto/module
450    fi
451
452    if [ $HTTP_GZIP_STATIC = YES ]; then
453        have=NGX_HTTP_GZIP . auto/have
454
455        ngx_module_name=ngx_http_gzip_static_module
456        ngx_module_incs=
457        ngx_module_deps=
458        ngx_module_srcs=src/http/modules/ngx_http_gzip_static_module.c
459        ngx_module_libs=
460        ngx_module_link=$HTTP_GZIP_STATIC
461
462        . auto/module
463    fi
464
465    if [ $HTTP_DAV = YES ]; then
466        have=NGX_HTTP_DAV . auto/have
467
468        ngx_module_name=ngx_http_dav_module
469        ngx_module_incs=
470        ngx_module_deps=
471        ngx_module_srcs=src/http/modules/ngx_http_dav_module.c
472        ngx_module_libs=
473        ngx_module_link=$HTTP_DAV
474
475        . auto/module
476    fi
477
478    if [ $HTTP_AUTOINDEX = YES ]; then
479        ngx_module_name=ngx_http_autoindex_module
480        ngx_module_incs=
481        ngx_module_deps=
482        ngx_module_srcs=src/http/modules/ngx_http_autoindex_module.c
483        ngx_module_libs=
484        ngx_module_link=$HTTP_AUTOINDEX
485
486        . auto/module
487    fi
488
489    if :; then
490        ngx_module_name=ngx_http_index_module
491        ngx_module_incs=
492        ngx_module_deps=
493        ngx_module_srcs=src/http/modules/ngx_http_index_module.c
494        ngx_module_libs=
495        ngx_module_link=YES
496
497        . auto/module
498    fi
499
500    if [ $HTTP_RANDOM_INDEX = YES ]; then
501        ngx_module_name=ngx_http_random_index_module
502        ngx_module_incs=
503        ngx_module_deps=
504        ngx_module_srcs=src/http/modules/ngx_http_random_index_module.c
505        ngx_module_libs=
506        ngx_module_link=$HTTP_RANDOM_INDEX
507
508        . auto/module
509    fi
510
511    if [ $HTTP_MIRROR = YES ]; then
512        ngx_module_name=ngx_http_mirror_module
513        ngx_module_incs=
514        ngx_module_deps=
515        ngx_module_srcs=src/http/modules/ngx_http_mirror_module.c
516        ngx_module_libs=
517        ngx_module_link=$HTTP_MIRROR
518
519        . auto/module
520    fi
521
522    if :; then
523        ngx_module_name=ngx_http_try_files_module
524        ngx_module_incs=
525        ngx_module_deps=
526        ngx_module_srcs=src/http/modules/ngx_http_try_files_module.c
527        ngx_module_libs=
528        ngx_module_link=YES
529
530        . auto/module
531    fi
532
533    if [ $HTTP_AUTH_REQUEST = YES ]; then
534        ngx_module_name=ngx_http_auth_request_module
535        ngx_module_incs=
536        ngx_module_deps=
537        ngx_module_srcs=src/http/modules/ngx_http_auth_request_module.c
538        ngx_module_libs=
539        ngx_module_link=$HTTP_AUTH_REQUEST
540
541        . auto/module
542    fi
543
544    if [ $HTTP_AUTH_BASIC = YES ]; then
545        have=NGX_CRYPT . auto/have
546
547        ngx_module_name=ngx_http_auth_basic_module
548        ngx_module_incs=
549        ngx_module_deps=
550        ngx_module_srcs=src/http/modules/ngx_http_auth_basic_module.c
551        ngx_module_libs=$CRYPT_LIB
552        ngx_module_link=$HTTP_AUTH_BASIC
553
554        . auto/module
555    fi
556
557    if [ $HTTP_ACCESS = YES ]; then
558        ngx_module_name=ngx_http_access_module
559        ngx_module_incs=
560        ngx_module_deps=
561        ngx_module_srcs=src/http/modules/ngx_http_access_module.c
562        ngx_module_libs=
563        ngx_module_link=$HTTP_ACCESS
564
565        . auto/module
566    fi
567
568    if [ $HTTP_LIMIT_CONN = YES ]; then
569        ngx_module_name=ngx_http_limit_conn_module
570        ngx_module_incs=
571        ngx_module_deps=
572        ngx_module_srcs=src/http/modules/ngx_http_limit_conn_module.c
573        ngx_module_libs=
574        ngx_module_link=$HTTP_LIMIT_CONN
575
576        . auto/module
577    fi
578
579    if [ $HTTP_LIMIT_REQ = YES ]; then
580        ngx_module_name=ngx_http_limit_req_module
581        ngx_module_incs=
582        ngx_module_deps=
583        ngx_module_srcs=src/http/modules/ngx_http_limit_req_module.c
584        ngx_module_libs=
585        ngx_module_link=$HTTP_LIMIT_REQ
586
587        . auto/module
588    fi
589
590    if [ $HTTP_REALIP = YES ]; then
591        have=NGX_HTTP_REALIP . auto/have
592        have=NGX_HTTP_X_FORWARDED_FOR . auto/have
593
594        ngx_module_name=ngx_http_realip_module
595        ngx_module_incs=
596        ngx_module_deps=
597        ngx_module_srcs=src/http/modules/ngx_http_realip_module.c
598        ngx_module_libs=
599        ngx_module_link=$HTTP_REALIP
600
601        . auto/module
602    fi
603
604    if [ $HTTP_STATUS = YES ]; then
605        ngx_module_name=ngx_http_status_module
606        ngx_module_incs=
607        ngx_module_deps=
608        ngx_module_srcs=src/http/modules/ngx_http_status_module.c
609        ngx_module_libs=
610        ngx_module_link=$HTTP_STATUS
611
612        . auto/module
613    fi
614
615    if [ $HTTP_GEO = YES ]; then
616        have=NGX_HTTP_X_FORWARDED_FOR . auto/have
617
618        ngx_module_name=ngx_http_geo_module
619        ngx_module_incs=
620        ngx_module_deps=
621        ngx_module_srcs=src/http/modules/ngx_http_geo_module.c
622        ngx_module_libs=
623        ngx_module_link=$HTTP_GEO
624
625        . auto/module
626    fi
627
628    if [ $HTTP_GEOIP != NO ]; then
629        have=NGX_HTTP_X_FORWARDED_FOR . auto/have
630
631        ngx_module_name=ngx_http_geoip_module
632        ngx_module_incs=
633        ngx_module_deps=
634        ngx_module_srcs=src/http/modules/ngx_http_geoip_module.c
635        ngx_module_libs=GEOIP
636        ngx_module_link=$HTTP_GEOIP
637
638        . auto/module
639    fi
640
641    if [ $HTTP_MAP = YES ]; then
642        ngx_module_name=ngx_http_map_module
643        ngx_module_incs=
644        ngx_module_deps=
645        ngx_module_srcs=src/http/modules/ngx_http_map_module.c
646        ngx_module_libs=
647        ngx_module_link=$HTTP_MAP
648
649        . auto/module
650    fi
651
652    if [ $HTTP_SPLIT_CLIENTS = YES ]; then
653        ngx_module_name=ngx_http_split_clients_module
654        ngx_module_incs=
655        ngx_module_deps=
656        ngx_module_srcs=src/http/modules/ngx_http_split_clients_module.c
657        ngx_module_libs=
658        ngx_module_link=$HTTP_SPLIT_CLIENTS
659
660        . auto/module
661    fi
662
663    if [ $HTTP_REFERER = YES ]; then
664        ngx_module_name=ngx_http_referer_module
665        ngx_module_incs=
666        ngx_module_deps=
667        ngx_module_srcs=src/http/modules/ngx_http_referer_module.c
668        ngx_module_libs=
669        ngx_module_link=$HTTP_REFERER
670
671        . auto/module
672    fi
673
674    if [ $HTTP_REWRITE = YES -a $USE_PCRE != DISABLED ]; then
675        USE_PCRE=YES
676
677        ngx_module_name=ngx_http_rewrite_module
678        ngx_module_incs=
679        ngx_module_deps=
680        ngx_module_srcs=src/http/modules/ngx_http_rewrite_module.c
681        ngx_module_libs=
682        ngx_module_link=$HTTP_REWRITE
683
684        . auto/module
685    fi
686
687    if [ $HTTP_SSL = YES ]; then
688        USE_OPENSSL=YES
689        have=NGX_HTTP_SSL . auto/have
690
691        ngx_module_name=ngx_http_ssl_module
692        ngx_module_incs=
693        ngx_module_deps=src/http/modules/ngx_http_ssl_module.h
694        ngx_module_srcs=src/http/modules/ngx_http_ssl_module.c
695        ngx_module_libs=
696        ngx_module_link=$HTTP_SSL
697
698        . auto/module
699    fi
700
701    if [ $HTTP_PROXY = YES ]; then
702        have=NGX_HTTP_X_FORWARDED_FOR . auto/have
703
704        ngx_module_name=ngx_http_proxy_module
705        ngx_module_incs=
706        ngx_module_deps=
707        ngx_module_srcs=src/http/modules/ngx_http_proxy_module.c
708        ngx_module_libs=
709        ngx_module_link=$HTTP_PROXY
710
711        . auto/module
712    fi
713
714    if [ $HTTP_FASTCGI = YES ]; then
715        ngx_module_name=ngx_http_fastcgi_module
716        ngx_module_incs=
717        ngx_module_deps=
718        ngx_module_srcs=src/http/modules/ngx_http_fastcgi_module.c
719        ngx_module_libs=
720        ngx_module_link=$HTTP_FASTCGI
721
722        . auto/module
723    fi
724
725    if [ $HTTP_UWSGI = YES ]; then
726        ngx_module_name=ngx_http_uwsgi_module
727        ngx_module_incs=
728        ngx_module_deps=
729        ngx_module_srcs=src/http/modules/ngx_http_uwsgi_module.c
730        ngx_module_libs=
731        ngx_module_link=$HTTP_UWSGI
732
733        . auto/module
734    fi
735
736    if [ $HTTP_SCGI = YES ]; then
737        ngx_module_name=ngx_http_scgi_module
738        ngx_module_incs=
739        ngx_module_deps=
740        ngx_module_srcs=src/http/modules/ngx_http_scgi_module.c
741        ngx_module_libs=
742        ngx_module_link=$HTTP_SCGI
743
744        . auto/module
745    fi
746
747    if [ $HTTP_GRPC = YES -a $HTTP_V2 = YES ]; then
748        ngx_module_name=ngx_http_grpc_module
749        ngx_module_incs=
750        ngx_module_deps=
751        ngx_module_srcs=src/http/modules/ngx_http_grpc_module.c
752        ngx_module_libs=
753        ngx_module_link=$HTTP_GRPC
754
755        . auto/module
756    fi
757
758    if [ $HTTP_PERL != NO ]; then
759        ngx_module_name=ngx_http_perl_module
760        ngx_module_incs=src/http/modules/perl
761        ngx_module_deps=src/http/modules/perl/ngx_http_perl_module.h
762        ngx_module_srcs=src/http/modules/perl/ngx_http_perl_module.c
763        ngx_module_libs=PERL
764        ngx_module_link=$HTTP_PERL
765
766        . auto/module
767    fi
768
769    if [ $HTTP_MEMCACHED = YES ]; then
770        ngx_module_name=ngx_http_memcached_module
771        ngx_module_incs=
772        ngx_module_deps=
773        ngx_module_srcs=src/http/modules/ngx_http_memcached_module.c
774        ngx_module_libs=
775        ngx_module_link=$HTTP_MEMCACHED
776
777        . auto/module
778    fi
779
780    if [ $HTTP_EMPTY_GIF = YES ]; then
781        ngx_module_name=ngx_http_empty_gif_module
782        ngx_module_incs=
783        ngx_module_deps=
784        ngx_module_srcs=src/http/modules/ngx_http_empty_gif_module.c
785        ngx_module_libs=
786        ngx_module_link=$HTTP_EMPTY_GIF
787
788        . auto/module
789    fi
790
791    if [ $HTTP_BROWSER = YES ]; then
792        ngx_module_name=ngx_http_browser_module
793        ngx_module_incs=
794        ngx_module_deps=
795        ngx_module_srcs=src/http/modules/ngx_http_browser_module.c
796        ngx_module_libs=
797        ngx_module_link=$HTTP_BROWSER
798
799        . auto/module
800    fi
801
802    if [ $HTTP_SECURE_LINK = YES ]; then
803        ngx_module_name=ngx_http_secure_link_module
804        ngx_module_incs=
805        ngx_module_deps=
806        ngx_module_srcs=src/http/modules/ngx_http_secure_link_module.c
807        ngx_module_libs=
808        ngx_module_link=$HTTP_SECURE_LINK
809
810        . auto/module
811    fi
812
813    if [ $HTTP_DEGRADATION = YES ]; then
814        have=NGX_HTTP_DEGRADATION . auto/have
815
816        ngx_module_name=ngx_http_degradation_module
817        ngx_module_incs=
818        ngx_module_deps=
819        ngx_module_srcs=src/http/modules/ngx_http_degradation_module.c
820        ngx_module_libs=
821        ngx_module_link=$HTTP_DEGRADATION
822
823        . auto/module
824    fi
825
826    if [ $HTTP_FLV = YES ]; then
827        ngx_module_name=ngx_http_flv_module
828        ngx_module_incs=
829        ngx_module_deps=
830        ngx_module_srcs=src/http/modules/ngx_http_flv_module.c
831        ngx_module_libs=
832        ngx_module_link=$HTTP_FLV
833
834        . auto/module
835    fi
836
837    if [ $HTTP_MP4 = YES ]; then
838        ngx_module_name=ngx_http_mp4_module
839        ngx_module_incs=
840        ngx_module_deps=
841        ngx_module_srcs=src/http/modules/ngx_http_mp4_module.c
842        ngx_module_libs=
843        ngx_module_link=$HTTP_MP4
844
845        . auto/module
846    fi
847
848    if [ $HTTP_UPSTREAM_HASH = YES ]; then
849        ngx_module_name=ngx_http_upstream_hash_module
850        ngx_module_incs=
851        ngx_module_deps=
852        ngx_module_srcs=src/http/modules/ngx_http_upstream_hash_module.c
853        ngx_module_libs=
854        ngx_module_link=$HTTP_UPSTREAM_HASH
855
856        . auto/module
857    fi
858
859    if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
860        ngx_module_name=ngx_http_upstream_ip_hash_module
861        ngx_module_incs=
862        ngx_module_deps=
863        ngx_module_srcs=src/http/modules/ngx_http_upstream_ip_hash_module.c
864        ngx_module_libs=
865        ngx_module_link=$HTTP_UPSTREAM_IP_HASH
866
867        . auto/module
868    fi
869
870    if [ $HTTP_UPSTREAM_LEAST_CONN = YES ]; then
871        ngx_module_name=ngx_http_upstream_least_conn_module
872        ngx_module_incs=
873        ngx_module_deps=
874        ngx_module_srcs=src/http/modules/ngx_http_upstream_least_conn_module.c
875        ngx_module_libs=
876        ngx_module_link=$HTTP_UPSTREAM_LEAST_CONN
877
878        . auto/module
879    fi
880
881    if [ $HTTP_UPSTREAM_KEEPALIVE = YES ]; then
882        ngx_module_name=ngx_http_upstream_keepalive_module
883        ngx_module_incs=
884        ngx_module_deps=
885        ngx_module_srcs=src/http/modules/ngx_http_upstream_keepalive_module.c
886        ngx_module_libs=
887        ngx_module_link=$HTTP_UPSTREAM_KEEPALIVE
888
889        . auto/module
890    fi
891
892    if [ $HTTP_UPSTREAM_ZONE = YES ]; then
893        have=NGX_HTTP_UPSTREAM_ZONE . auto/have
894
895        ngx_module_name=ngx_http_upstream_zone_module
896        ngx_module_incs=
897        ngx_module_deps=
898        ngx_module_srcs=src/http/modules/ngx_http_upstream_zone_module.c
899        ngx_module_libs=
900        ngx_module_link=$HTTP_UPSTREAM_ZONE
901
902        . auto/module
903    fi
904
905    if [ $HTTP_STUB_STATUS = YES ]; then
906        have=NGX_STAT_STUB . auto/have
907
908        ngx_module_name=ngx_http_stub_status_module
909        ngx_module_incs=
910        ngx_module_deps=
911        ngx_module_srcs=src/http/modules/ngx_http_stub_status_module.c
912        ngx_module_libs=
913        ngx_module_link=$HTTP_STUB_STATUS
914
915        . auto/module
916    fi
917fi
918
919
920if [ $MAIL != NO ]; then
921    MAIL_MODULES=
922    MAIL_DEPS=
923    MAIL_INCS=
924
925    ngx_module_type=MAIL
926    ngx_module_libs=
927    ngx_module_link=YES
928
929    ngx_module_order=
930
931    ngx_module_name="ngx_mail_module ngx_mail_core_module"
932    ngx_module_incs="src/mail"
933    ngx_module_deps="src/mail/ngx_mail.h"
934    ngx_module_srcs="src/mail/ngx_mail.c \
935                     src/mail/ngx_mail_core_module.c \
936                     src/mail/ngx_mail_handler.c \
937                     src/mail/ngx_mail_parse.c"
938
939    . auto/module
940
941    ngx_module_incs=
942
943    if [ $MAIL_SSL = YES ]; then
944        USE_OPENSSL=YES
945        have=NGX_MAIL_SSL . auto/have
946
947        ngx_module_name=ngx_mail_ssl_module
948        ngx_module_deps=src/mail/ngx_mail_ssl_module.h
949        ngx_module_srcs=src/mail/ngx_mail_ssl_module.c
950
951        . auto/module
952    fi
953
954    if [ $MAIL_POP3 = YES ]; then
955        ngx_module_name=ngx_mail_pop3_module
956        ngx_module_deps=src/mail/ngx_mail_pop3_module.h
957        ngx_module_srcs="src/mail/ngx_mail_pop3_module.c \
958                         src/mail/ngx_mail_pop3_handler.c"
959
960        . auto/module
961    fi
962
963    if [ $MAIL_IMAP = YES ]; then
964        ngx_module_name=ngx_mail_imap_module
965        ngx_module_deps=src/mail/ngx_mail_imap_module.h
966        ngx_module_srcs="src/mail/ngx_mail_imap_module.c \
967                         src/mail/ngx_mail_imap_handler.c"
968
969        . auto/module
970    fi
971
972    if [ $MAIL_SMTP = YES ]; then
973        ngx_module_name=ngx_mail_smtp_module
974        ngx_module_deps=src/mail/ngx_mail_smtp_module.h
975        ngx_module_srcs="src/mail/ngx_mail_smtp_module.c \
976                         src/mail/ngx_mail_smtp_handler.c"
977
978        . auto/module
979    fi
980
981    ngx_module_name=ngx_mail_auth_http_module
982    ngx_module_deps=
983    ngx_module_srcs=src/mail/ngx_mail_auth_http_module.c
984
985    . auto/module
986
987    ngx_module_name=ngx_mail_proxy_module
988    ngx_module_deps=
989    ngx_module_srcs=src/mail/ngx_mail_proxy_module.c
990
991    . auto/module
992fi
993
994
995if [ $STREAM != NO ]; then
996    STREAM_MODULES=
997    STREAM_DEPS=
998    STREAM_INCS=
999
1000    ngx_module_type=STREAM
1001    ngx_module_libs=
1002    ngx_module_link=YES
1003
1004    ngx_module_order=
1005
1006    ngx_module_name="ngx_stream_module \
1007                     ngx_stream_core_module \
1008                     ngx_stream_log_module \
1009                     ngx_stream_proxy_module \
1010                     ngx_stream_upstream_module \
1011                     ngx_stream_write_filter_module"
1012    ngx_module_incs="src/stream"
1013    ngx_module_deps="src/stream/ngx_stream.h \
1014                     src/stream/ngx_stream_variables.h \
1015                     src/stream/ngx_stream_script.h \
1016                     src/stream/ngx_stream_upstream.h \
1017                     src/stream/ngx_stream_upstream_round_robin.h"
1018    ngx_module_srcs="src/stream/ngx_stream.c \
1019                     src/stream/ngx_stream_variables.c \
1020                     src/stream/ngx_stream_script.c \
1021                     src/stream/ngx_stream_handler.c \
1022                     src/stream/ngx_stream_core_module.c \
1023                     src/stream/ngx_stream_log_module.c \
1024                     src/stream/ngx_stream_proxy_module.c \
1025                     src/stream/ngx_stream_upstream.c \
1026                     src/stream/ngx_stream_upstream_round_robin.c \
1027                     src/stream/ngx_stream_write_filter_module.c"
1028
1029    . auto/module
1030
1031    ngx_module_incs=
1032
1033    if [ $STREAM_SSL = YES ]; then
1034        USE_OPENSSL=YES
1035        have=NGX_STREAM_SSL . auto/have
1036
1037        ngx_module_name=ngx_stream_ssl_module
1038        ngx_module_deps=src/stream/ngx_stream_ssl_module.h
1039        ngx_module_srcs=src/stream/ngx_stream_ssl_module.c
1040        ngx_module_libs=
1041        ngx_module_link=$STREAM_SSL
1042
1043        . auto/module
1044    fi
1045
1046    if [ $STREAM_REALIP = YES ]; then
1047        ngx_module_name=ngx_stream_realip_module
1048        ngx_module_deps=
1049        ngx_module_srcs=src/stream/ngx_stream_realip_module.c
1050        ngx_module_libs=
1051        ngx_module_link=$STREAM_REALIP
1052
1053        . auto/module
1054    fi
1055
1056    if [ $STREAM_LIMIT_CONN = YES ]; then
1057        ngx_module_name=ngx_stream_limit_conn_module
1058        ngx_module_deps=
1059        ngx_module_srcs=src/stream/ngx_stream_limit_conn_module.c
1060        ngx_module_libs=
1061        ngx_module_link=$STREAM_LIMIT_CONN
1062
1063        . auto/module
1064    fi
1065
1066    if [ $STREAM_ACCESS = YES ]; then
1067        ngx_module_name=ngx_stream_access_module
1068        ngx_module_deps=
1069        ngx_module_srcs=src/stream/ngx_stream_access_module.c
1070        ngx_module_libs=
1071        ngx_module_link=$STREAM_ACCESS
1072
1073        . auto/module
1074    fi
1075
1076    if [ $STREAM_GEO = YES ]; then
1077        ngx_module_name=ngx_stream_geo_module
1078        ngx_module_deps=
1079        ngx_module_srcs=src/stream/ngx_stream_geo_module.c
1080        ngx_module_libs=
1081        ngx_module_link=$STREAM_GEO
1082
1083        . auto/module
1084    fi
1085
1086    if [ $STREAM_GEOIP != NO ]; then
1087        ngx_module_name=ngx_stream_geoip_module
1088        ngx_module_deps=
1089        ngx_module_srcs=src/stream/ngx_stream_geoip_module.c
1090        ngx_module_libs=GEOIP
1091        ngx_module_link=$STREAM_GEOIP
1092
1093        . auto/module
1094    fi
1095
1096    if [ $STREAM_MAP = YES ]; then
1097        ngx_module_name=ngx_stream_map_module
1098        ngx_module_deps=
1099        ngx_module_srcs=src/stream/ngx_stream_map_module.c
1100        ngx_module_libs=
1101        ngx_module_link=$STREAM_MAP
1102
1103        . auto/module
1104    fi
1105
1106    if [ $STREAM_SPLIT_CLIENTS = YES ]; then
1107        ngx_module_name=ngx_stream_split_clients_module
1108        ngx_module_deps=
1109        ngx_module_srcs=src/stream/ngx_stream_split_clients_module.c
1110        ngx_module_libs=
1111        ngx_module_link=$STREAM_SPLIT_CLIENTS
1112
1113        . auto/module
1114    fi
1115
1116    if [ $STREAM_RETURN = YES ]; then
1117        ngx_module_name=ngx_stream_return_module
1118        ngx_module_deps=
1119        ngx_module_srcs=src/stream/ngx_stream_return_module.c
1120        ngx_module_libs=
1121        ngx_module_link=$STREAM_RETURN
1122
1123        . auto/module
1124    fi
1125
1126    if [ $STREAM_UPSTREAM_HASH = YES ]; then
1127        ngx_module_name=ngx_stream_upstream_hash_module
1128        ngx_module_deps=
1129        ngx_module_srcs=src/stream/ngx_stream_upstream_hash_module.c
1130        ngx_module_libs=
1131        ngx_module_link=$STREAM_UPSTREAM_HASH
1132
1133        . auto/module
1134    fi
1135
1136    if [ $STREAM_UPSTREAM_LEAST_CONN = YES ]; then
1137        ngx_module_name=ngx_stream_upstream_least_conn_module
1138        ngx_module_deps=
1139        ngx_module_srcs=src/stream/ngx_stream_upstream_least_conn_module.c
1140        ngx_module_libs=
1141        ngx_module_link=$STREAM_UPSTREAM_LEAST_CONN
1142
1143        . auto/module
1144    fi
1145
1146    if [ $STREAM_UPSTREAM_ZONE = YES ]; then
1147        have=NGX_STREAM_UPSTREAM_ZONE . auto/have
1148
1149        ngx_module_name=ngx_stream_upstream_zone_module
1150        ngx_module_deps=
1151        ngx_module_srcs=src/stream/ngx_stream_upstream_zone_module.c
1152        ngx_module_libs=
1153        ngx_module_link=$STREAM_UPSTREAM_ZONE
1154
1155        . auto/module
1156    fi
1157
1158    if [ $STREAM_SSL_PREREAD = YES ]; then
1159        ngx_module_name=ngx_stream_ssl_preread_module
1160        ngx_module_deps=
1161        ngx_module_srcs=src/stream/ngx_stream_ssl_preread_module.c
1162        ngx_module_libs=
1163        ngx_module_link=$STREAM_SSL_PREREAD
1164
1165        . auto/module
1166    fi
1167fi
1168
1169
1170#if [ -r $NGX_OBJS/auto ]; then
1171#    . $NGX_OBJS/auto
1172#fi
1173
1174
1175if test -n "$NGX_ADDONS"; then
1176
1177    echo configuring additional modules
1178
1179    for ngx_addon_dir in $NGX_ADDONS
1180    do
1181        echo "adding module in $ngx_addon_dir"
1182
1183        ngx_module_type=
1184        ngx_module_name=
1185        ngx_module_incs=
1186        ngx_module_deps=
1187        ngx_module_srcs=
1188        ngx_module_libs=
1189        ngx_module_order=
1190        ngx_module_link=ADDON
1191
1192        if test -f $ngx_addon_dir/config; then
1193            . $ngx_addon_dir/config
1194
1195            echo " + $ngx_addon_name was configured"
1196
1197        else
1198            echo "$0: error: no $ngx_addon_dir/config was found"
1199            exit 1
1200        fi
1201    done
1202fi
1203
1204
1205if test -n "$DYNAMIC_ADDONS"; then
1206
1207    echo configuring additional dynamic modules
1208
1209    for ngx_addon_dir in $DYNAMIC_ADDONS
1210    do
1211        echo "adding module in $ngx_addon_dir"
1212
1213        ngx_module_type=
1214        ngx_module_name=
1215        ngx_module_incs=
1216        ngx_module_deps=
1217        ngx_module_srcs=
1218        ngx_module_libs=
1219        ngx_module_order=
1220        ngx_module_link=DYNAMIC
1221
1222        if test -f $ngx_addon_dir/config; then
1223            . $ngx_addon_dir/config
1224
1225            echo " + $ngx_addon_name was configured"
1226
1227        else
1228            echo "$0: error: no $ngx_addon_dir/config was found"
1229            exit 1
1230        fi
1231    done
1232fi
1233
1234
1235if [ $USE_OPENSSL = YES ]; then
1236    ngx_module_type=CORE
1237    ngx_module_name=ngx_openssl_module
1238    ngx_module_incs=
1239    ngx_module_deps=src/event/ngx_event_openssl.h
1240    ngx_module_srcs="src/event/ngx_event_openssl.c
1241                     src/event/ngx_event_openssl_stapling.c"
1242    ngx_module_libs=
1243    ngx_module_link=YES
1244    ngx_module_order=
1245
1246    . auto/module
1247fi
1248
1249
1250if [ $USE_PCRE = YES ]; then
1251    ngx_module_type=CORE
1252    ngx_module_name=ngx_regex_module
1253    ngx_module_incs=
1254    ngx_module_deps=src/core/ngx_regex.h
1255    ngx_module_srcs=src/core/ngx_regex.c
1256    ngx_module_libs=
1257    ngx_module_link=YES
1258    ngx_module_order=
1259
1260    . auto/module
1261fi
1262
1263
1264modules="$CORE_MODULES $EVENT_MODULES"
1265
1266
1267# thread pool module should be initialized after events
1268if [ $USE_THREADS = YES ]; then
1269    modules="$modules $THREAD_POOL_MODULE"
1270fi
1271
1272
1273if [ $HTTP = YES ]; then
1274    modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
1275             $HTTP_AUX_FILTER_MODULES $HTTP_INIT_FILTER_MODULES"
1276
1277    NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(HTTP_DEPS)"
1278fi
1279
1280
1281if [ $MAIL != NO ]; then
1282
1283    if [ $MAIL = YES ]; then
1284        modules="$modules $MAIL_MODULES"
1285
1286    elif [ $MAIL = DYNAMIC ]; then
1287        ngx_module_name=$MAIL_MODULES
1288        ngx_module_incs=
1289        ngx_module_deps=
1290        ngx_module_srcs=$MAIL_SRCS
1291        ngx_module_libs=
1292        ngx_module_link=DYNAMIC
1293
1294        . auto/module
1295    fi
1296
1297    NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(MAIL_DEPS)"
1298fi
1299
1300
1301if [ $STREAM != NO ]; then
1302
1303    if [ $STREAM = YES ]; then
1304        modules="$modules $STREAM_MODULES"
1305
1306    elif [ $STREAM = DYNAMIC ]; then
1307        ngx_module_name=$STREAM_MODULES
1308        ngx_module_incs=
1309        ngx_module_deps=
1310        ngx_module_srcs=$STREAM_SRCS
1311        ngx_module_libs=
1312        ngx_module_link=DYNAMIC
1313
1314        . auto/module
1315    fi
1316
1317    NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(STREAM_DEPS)"
1318fi
1319
1320
1321ngx_module_type=MISC
1322MISC_MODULES=
1323
1324if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then
1325    ngx_module_name=ngx_google_perftools_module
1326    ngx_module_incs=
1327    ngx_module_deps=
1328    ngx_module_srcs=src/misc/ngx_google_perftools_module.c
1329    ngx_module_libs=
1330    ngx_module_link=$NGX_GOOGLE_PERFTOOLS
1331
1332    . auto/module
1333fi
1334
1335if [ $NGX_CPP_TEST = YES ]; then
1336    ngx_module_name=
1337    ngx_module_incs=
1338    ngx_module_deps=
1339    ngx_module_srcs=src/misc/ngx_cpp_test_module.cpp
1340    ngx_module_libs=-lstdc++
1341    ngx_module_link=$NGX_CPP_TEST
1342
1343    . auto/module
1344fi
1345
1346modules="$modules $MISC_MODULES"
1347
1348
1349if [ $NGX_COMPAT = YES ]; then
1350    have=NGX_COMPAT . auto/have
1351    have=NGX_HTTP_GZIP . auto/have
1352    have=NGX_HTTP_DAV . auto/have
1353    have=NGX_HTTP_REALIP . auto/have
1354    have=NGX_HTTP_X_FORWARDED_FOR . auto/have
1355    have=NGX_HTTP_HEADERS . auto/have
1356    have=NGX_HTTP_UPSTREAM_ZONE . auto/have
1357    have=NGX_STREAM_UPSTREAM_ZONE . auto/have
1358fi
1359
1360
1361cat << END                                    > $NGX_MODULES_C
1362
1363#include <ngx_config.h>
1364#include <ngx_core.h>
1365
1366$NGX_PRAGMA
1367
1368END
1369
1370for mod in $modules
1371do
1372    echo "extern ngx_module_t  $mod;"         >> $NGX_MODULES_C
1373done
1374
1375echo                                          >> $NGX_MODULES_C
1376echo 'ngx_module_t *ngx_modules[] = {'        >> $NGX_MODULES_C
1377
1378for mod in $modules
1379do
1380    echo "    &$mod,"                         >> $NGX_MODULES_C
1381done
1382
1383cat << END                                    >> $NGX_MODULES_C
1384    NULL
1385};
1386
1387END
1388
1389echo 'char *ngx_module_names[] = {'           >> $NGX_MODULES_C
1390
1391for mod in $modules
1392do
1393    echo "    \"$mod\","                      >> $NGX_MODULES_C
1394done
1395
1396cat << END                                    >> $NGX_MODULES_C
1397    NULL
1398};
1399
1400END
1401