upstream nginx-0.7.43
[nginx.git] / nginx / auto / options
1
2 # Copyright (C) Igor Sysoev
3
4
5 help=no
6
7 NGX_PREFIX=
8 NGX_SBIN_PATH=
9 NGX_CONF_PREFIX=
10 NGX_CONF_PATH=
11 NGX_ERROR_LOG_PATH=
12 NGX_PID_PATH=
13 NGX_LOCK_PATH=
14 NGX_USER=
15 NGX_GROUP=
16
17 CC=${CC:-gcc}
18 CPP=
19 NGX_OBJS=objs
20
21 NGX_DEBUG=NO
22 NGX_CC_OPT=
23 NGX_LD_OPT=
24 CPU=NO
25
26 NGX_RPATH=NO
27
28 NGX_TEST_BUILD_DEVPOLL=NO
29 NGX_TEST_BUILD_EVENTPORT=NO
30 NGX_TEST_BUILD_EPOLL=NO
31 NGX_TEST_BUILD_RTSIG=NO
32 NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO
33
34 NGX_PLATFORM=
35 NGX_WINE=
36
37 EVENT_FOUND=NO
38
39 EVENT_RTSIG=NO
40 EVENT_SELECT=NO
41 EVENT_POLL=NO
42 EVENT_AIO=NO
43
44 USE_THREADS=NO
45
46 NGX_IPV6=NO
47
48 HTTP=YES
49
50 NGX_HTTP_LOG_PATH=
51 NGX_HTTP_CLIENT_TEMP_PATH=
52 NGX_HTTP_PROXY_TEMP_PATH=
53 NGX_HTTP_FASTCGI_TEMP_PATH=
54
55 HTTP_CHARSET=YES
56 HTTP_GZIP=YES
57 HTTP_SSL=NO
58 HTTP_SSI=YES
59 HTTP_POSTPONE=NO
60 HTTP_REALIP=NO
61 HTTP_XSLT=NO
62 HTTP_SUB=NO
63 HTTP_ADDITION=NO
64 HTTP_DAV=NO
65 HTTP_ACCESS=YES
66 HTTP_AUTH_BASIC=YES
67 HTTP_USERID=YES
68 HTTP_AUTOINDEX=YES
69 HTTP_RANDOM_INDEX=NO
70 HTTP_STATUS=NO
71 HTTP_GEO=YES
72 HTTP_MAP=YES
73 HTTP_REFERER=YES
74 HTTP_REWRITE=YES
75 HTTP_PROXY=YES
76 HTTP_FASTCGI=YES
77 HTTP_PERL=NO
78 HTTP_MEMCACHED=YES
79 HTTP_LIMIT_ZONE=YES
80 HTTP_LIMIT_REQ=YES
81 HTTP_EMPTY_GIF=YES
82 HTTP_BROWSER=YES
83 HTTP_SECURE_LINK=NO
84 HTTP_FLV=NO
85 HTTP_GZIP_STATIC=NO
86 HTTP_UPSTREAM_IP_HASH=YES
87
88 # STUB
89 HTTP_STUB_STATUS=NO
90
91 MAIL=NO
92 MAIL_SSL=NO
93 MAIL_POP3=YES
94 MAIL_IMAP=YES
95 MAIL_SMTP=YES
96
97 NGX_ADDONS=
98
99 USE_PCRE=NO
100 PCRE=NONE
101 PCRE_OPT=
102
103 USE_OPENSSL=NO
104 OPENSSL=NONE
105
106 USE_MD5=NO
107 MD5=NONE
108 MD5_OPT=
109 MD5_ASM=NO
110
111 USE_SHA1=NO
112 SHA1=NONE
113 SHA1_OPT=
114 SHA1_ASM=NO
115
116 USE_ZLIB=NO
117 ZLIB=NONE
118 ZLIB_OPT=
119 ZLIB_ASM=NO
120
121 USE_PERL=NO
122 NGX_PERL=perl
123
124 USE_LIBXSLT=NO
125
126 NGX_GOOGLE_PERFTOOLS=NO
127 NGX_CPP_TEST=NO
128
129 NGX_CPU_CACHE_LINE=
130
131
132 for option
133 do
134     case "$option" in
135         -*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
136            *) value="" ;;
137     esac
138
139     case "$option" in
140         --help)                          help=yes                   ;;
141
142         --prefix=*)                      NGX_PREFIX="$value"        ;;
143         --sbin-path=*)                   NGX_SBIN_PATH="$value"     ;;
144         --conf-path=*)                   NGX_CONF_PATH="$value"     ;;
145         --error-log-path=*)              NGX_ERROR_LOG_PATH="$value";;
146         --pid-path=*)                    NGX_PID_PATH="$value"      ;;
147         --lock-path=*)                   NGX_LOCK_PATH="$value"     ;;
148         --user=*)                        NGX_USER="$value"          ;;
149         --group=*)                       NGX_GROUP="$value"         ;;
150
151         --crossbuild=*)                  NGX_PLATFORM="$value"      ;;
152
153         --builddir=*)                    NGX_OBJS="$value"          ;;
154
155         --with-rtsig_module)             EVENT_RTSIG=YES            ;;
156         --with-select_module)            EVENT_SELECT=YES           ;;
157         --without-select_module)         EVENT_SELECT=NONE          ;;
158         --with-poll_module)              EVENT_POLL=YES             ;;
159         --without-poll_module)           EVENT_POLL=NONE            ;;
160         --with-aio_module)               EVENT_AIO=YES              ;;
161
162         #--with-threads=*)                USE_THREADS="$value"       ;;
163         #--with-threads)                  USE_THREADS="pthreads"     ;;
164
165         --with-ipv6)                     NGX_IPV6=YES               ;;
166
167         --without-http)                  HTTP=NO                    ;;
168         --http-log-path=*)               NGX_HTTP_LOG_PATH="$value" ;;
169         --http-client-body-temp-path=*)  NGX_HTTP_CLIENT_TEMP_PATH="$value" ;;
170         --http-proxy-temp-path=*)        NGX_HTTP_PROXY_TEMP_PATH="$value" ;;
171         --http-fastcgi-temp-path=*)      NGX_HTTP_FASTCGI_TEMP_PATH="$value" ;;
172
173         --with-http_ssl_module)          HTTP_SSL=YES               ;;
174         --with-http_realip_module)       HTTP_REALIP=YES            ;;
175         --with-http_addition_module)     HTTP_ADDITION=YES          ;;
176         --with-http_xslt_module)         HTTP_XSLT=YES              ;;
177         --with-http_sub_module)          HTTP_SUB=YES               ;;
178         --with-http_dav_module)          HTTP_DAV=YES               ;;
179         --with-http_flv_module)          HTTP_FLV=YES               ;;
180         --with-http_gzip_static_module)  HTTP_GZIP_STATIC=YES       ;;
181         --with-http_random_index_module) HTTP_RANDOM_INDEX=YES      ;;
182         --with-http_secure_link_module)  HTTP_SECURE_LINK=YES       ;;
183
184         --without-http_charset_module)   HTTP_CHARSET=NO            ;;
185         --without-http_gzip_module)      HTTP_GZIP=NO               ;;
186         --without-http_ssi_module)       HTTP_SSI=NO                ;;
187         --without-http_userid_module)    HTTP_USERID=NO             ;;
188         --without-http_access_module)    HTTP_ACCESS=NO             ;;
189         --without-http_auth_basic_module) HTTP_AUTH_BASIC=NO        ;;
190         --without-http_autoindex_module) HTTP_AUTOINDEX=NO          ;;
191         --without-http_status_module)    HTTP_STATUS=NO             ;;
192         --without-http_geo_module)       HTTP_GEO=NO                ;;
193         --without-http_map_module)       HTTP_MAP=NO                ;;
194         --without-http_referer_module)   HTTP_REFERER=NO            ;;
195         --without-http_rewrite_module)   HTTP_REWRITE=NO            ;;
196         --without-http_proxy_module)     HTTP_PROXY=NO              ;;
197         --without-http_fastcgi_module)   HTTP_FASTCGI=NO            ;;
198         --without-http_memcached_module) HTTP_MEMCACHED=NO          ;;
199         --without-http_limit_zone_module) HTTP_LIMIT_ZONE=NO        ;;
200         --without-http_limit_req_module) HTTP_LIMIT_REQ=NO         ;;
201         --without-http_empty_gif_module) HTTP_EMPTY_GIF=NO          ;;
202         --without-http_browser_module)   HTTP_BROWSER=NO            ;;
203         --without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
204
205         --with-http_perl_module)         HTTP_PERL=YES              ;;
206         --with-perl_modules_path=*)      NGX_PERL_MODULES="$value"  ;;
207         --with-perl=*)                   NGX_PERL="$value"          ;;
208
209         # STUB
210         --with-http_stub_status_module)  HTTP_STUB_STATUS=YES       ;;
211
212         --with-mail)                     MAIL=YES                   ;;
213         --with-mail_ssl_module)          MAIL_SSL=YES               ;;
214         # STUB
215         --with-imap)                     MAIL=YES                   ;;
216         --with-imap_ssl_module)          MAIL_SSL=YES               ;;
217         --without-mail_pop3_module)      MAIL_POP3=NO               ;;
218         --without-mail_imap_module)      MAIL_IMAP=NO               ;;
219         --without-mail_smtp_module)      MAIL_SMTP=NO               ;;
220
221         --with-google_perftools_module)  NGX_GOOGLE_PERFTOOLS=YES   ;;
222         --with-cpp_test_module)          NGX_CPP_TEST=YES           ;;
223
224         --add-module=*)                  NGX_ADDONS="$NGX_ADDONS $value" ;;
225
226         --with-cc=*)                     CC="$value"                ;;
227         --with-cpp=*)                    CPP="$value"               ;;
228         --with-cc-opt=*)                 NGX_CC_OPT="$value"        ;;
229         --with-ld-opt=*)                 NGX_LD_OPT="$value"        ;;
230         --with-cpu-opt=*)                CPU="$value"               ;;
231         --with-debug)                    NGX_DEBUG=YES              ;;
232
233         --without-pcre)                  USE_PCRE=DISABLED          ;;
234         --with-pcre=*)                   PCRE="$value"              ;;
235         --with-pcre-opt=*)               PCRE_OPT="$value"          ;;
236
237         --with-openssl=*)                OPENSSL="$value"           ;;
238         --with-openssl-opt=*)            OPENSSL_OPT="$value"       ;;
239
240         --with-md5=*)                    MD5="$value"               ;;
241         --with-md5-opt=*)                MD5_OPT="$value"           ;;
242         --with-md5-asm)                  MD5_ASM=YES                ;;
243
244         --with-sha1=*)                   SHA1="$value"              ;;
245         --with-sha1-opt=*)               SHA1_OPT="$value"          ;;
246         --with-sha1-asm)                 SHA1_ASM=YES               ;;
247
248         --with-zlib=*)                   ZLIB="$value"              ;;
249         --with-zlib-opt=*)               ZLIB_OPT="$value"          ;;
250         --with-zlib-asm=*)               ZLIB_ASM="$value"          ;;
251
252         --test-build-devpoll)            NGX_TEST_BUILD_DEVPOLL=YES ;;
253         --test-build-eventport)          NGX_TEST_BUILD_EVENTPORT=YES ;;
254         --test-build-epoll)              NGX_TEST_BUILD_EPOLL=YES   ;;
255         --test-build-rtsig)              NGX_TEST_BUILD_RTSIG=YES   ;;
256         --test-build-solaris-sendfilev)  NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
257
258         *)
259             echo "$0: error: invalid option \"$option\""
260             exit 1
261         ;;
262     esac
263 done
264
265
266 if [ $help = yes ]; then
267
268 cat << END
269
270   --help                             this message
271
272   --prefix=PATH                      set the installation prefix
273   --sbin-path=PATH                   set path to the nginx binary file
274   --conf-path=PATH                   set path to the nginx.conf file
275   --error-log-path=PATH              set path to the error log
276   --pid-path=PATH                    set path to nginx.pid file
277   --lock-path=PATH                   set path to nginx.lock file
278
279   --user=USER                        set non-privilege user
280                                      for the worker processes
281   --group=GROUP                      set non-privilege group
282                                      for the worker processes
283
284   --builddir=DIR                     set the build directory
285
286   --with-rtsig_module                enable rtsig module
287   --with-select_module               enable select module
288   --without-select_module            disable select module
289   --with-poll_module                 enable poll module
290   --without-poll_module              disable poll module
291
292   --with-ipv6                        enable ipv6 support
293
294   --with-http_ssl_module             enable ngx_http_ssl_module
295   --with-http_realip_module          enable ngx_http_realip_module
296   --with-http_addition_module        enable ngx_http_addition_module
297   --with-http_xslt_module            enable ngx_http_xslt_module
298   --with-http_sub_module             enable ngx_http_sub_module
299   --with-http_dav_module             enable ngx_http_dav_module
300   --with-http_flv_module             enable ngx_http_flv_module
301   --with-http_gzip_static_module     enable ngx_http_gzip_static_module
302   --with-http_random_index_module    enable ngx_http_random_index_module
303   --with-http_secure_link_module     enable ngx_http_secure_link_module
304   --with-http_stub_status_module     enable ngx_http_stub_status_module
305
306   --without-http_charset_module      disable ngx_http_charset_module
307   --without-http_gzip_module         disable ngx_http_gzip_module
308   --without-http_ssi_module          disable ngx_http_ssi_module
309   --without-http_userid_module       disable ngx_http_userid_module
310   --without-http_access_module       disable ngx_http_access_module
311   --without-http_auth_basic_module   disable ngx_http_auth_basic_module
312   --without-http_autoindex_module    disable ngx_http_autoindex_module
313   --without-http_geo_module          disable ngx_http_geo_module
314   --without-http_map_module          disable ngx_http_map_module
315   --without-http_referer_module      disable ngx_http_referer_module
316   --without-http_rewrite_module      disable ngx_http_rewrite_module
317   --without-http_proxy_module        disable ngx_http_proxy_module
318   --without-http_fastcgi_module      disable ngx_http_fastcgi_module
319   --without-http_memcached_module    disable ngx_http_memcached_module
320   --without-http_limit_zone_module   disable ngx_http_limit_zone_module
321   --without-http_limit_req_module    disable ngx_http_limit_req_module
322   --without-http_empty_gif_module    disable ngx_http_empty_gif_module
323   --without-http_browser_module      disable ngx_http_browser_module
324   --without-http_upstream_ip_hash_module
325                                      disable ngx_http_upstream_ip_hash_module
326
327   --with-http_perl_module            enable ngx_http_perl_module
328   --with-perl_modules_path=PATH      set path to the perl modules
329   --with-perl=PATH                   set path to the perl binary
330
331   --http-log-path=PATH               set path to the http access log
332   --http-client-body-temp-path=PATH  set path to the http client request body
333                                      temporary files
334   --http-proxy-temp-path=PATH        set path to the http proxy temporary files
335   --http-fastcgi-temp-path=PATH      set path to the http fastcgi temporary
336                                      files
337
338   --without-http                     disable HTTP server
339
340   --with-mail                        enable POP3/IMAP4/SMTP proxy module
341   --with-mail_ssl_module             enable ngx_mail_ssl_module
342   --without-mail_pop3_module         disable ngx_mail_pop3_module
343   --without-mail_imap_module         disable ngx_mail_imap_module
344   --without-mail_smtp_module         disable ngx_mail_smtp_module
345
346   --with-google_perftools_module     enable ngx_google_perftools_module
347   --with-cpp_test_module             enable ngx_cpp_test_module
348
349   --add-module=PATH                  enable an external module
350
351   --with-cc=PATH                     set path to C compiler
352   --with-cpp=PATH                    set path to C preprocessor
353   --with-cc-opt=OPTIONS              set additional options for C compiler
354   --with-ld-opt=OPTIONS              set additional options for linker
355   --with-cpu-opt=CPU                 build for specified CPU, the valid values:
356                                      pentium, pentiumpro, pentium3, pentium4,
357                                      athlon, opteron, sparc32, sparc64, ppc64
358
359   --without-pcre                     disable PCRE libarary usage
360   --with-pcre=DIR                    set path to PCRE library sources
361   --with-pcre-opt=OPTIONS            set additional options for PCRE building
362
363   --with-md5=DIR                     set path to md5 library sources
364   --with-md5-opt=OPTIONS             set additional options for md5 building
365   --with-md5-asm                     use md5 assembler sources
366
367   --with-sha1=DIR                    set path to sha1 library sources
368   --with-sha1-opt=OPTIONS            set additional options for sha1 building
369   --with-sha1-asm                    use sha1 assembler sources
370
371   --with-zlib=DIR                    set path to zlib library sources
372   --with-zlib-opt=OPTIONS            set additional options for zlib building
373   --with-zlib-asm=CPU                use zlib assembler sources optimized
374                                      for specified CPU, the valid values:
375                                      pentium, pentiumpro
376
377   --with-openssl=DIR                 set path to OpenSSL library sources
378   --with-openssl-opt=OPTIONS         set additional options for OpenSSL building
379
380   --with-debug                       enable the debugging logging
381
382 END
383
384     exit 1
385 fi
386
387
388 if [ $HTTP = NO ]; then
389     HTTP_CHARSET=NO
390     HTTP_GZIP=NO
391     HTTP_SSI=NO
392     HTTP_USERID=NO
393     HTTP_ACCESS=NO
394     HTTP_STATUS=NO
395     HTTP_REWRITE=NO
396     HTTP_PROXY=NO
397     HTTP_FASTCGI=NO
398 fi
399
400
401 if [ ".$NGX_PLATFORM" = ".win32" ]; then
402     NGX_WINE=$WINE
403 fi
404
405
406 NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
407
408
409 case ".$NGX_SBIN_PATH" in
410     ./*)
411     ;;
412
413     .)
414         NGX_SBIN_PATH=$NGX_PREFIX/sbin/nginx
415     ;;
416
417     *)
418         NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH
419     ;;
420 esac
421
422
423 case ".$NGX_CONF_PATH" in
424     ./*)
425     ;;
426
427     .)
428         NGX_CONF_PATH=$NGX_PREFIX/conf/nginx.conf
429     ;;
430
431     *)
432         NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH
433     ;;
434 esac
435
436
437 NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
438
439
440 case ".$NGX_PID_PATH" in
441     ./*)
442     ;;
443
444     .)
445         NGX_PID_PATH=$NGX_PREFIX/logs/nginx.pid
446     ;;
447
448     *)
449         NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH
450     ;;
451 esac
452
453
454 case ".$NGX_LOCK_PATH" in
455     ./*)
456     ;;
457
458     .)
459         NGX_LOCK_PATH=$NGX_PREFIX/logs/nginx.lock
460     ;;
461
462     *)
463         NGX_LOCK_PATH=$NGX_PREFIX/$NGX_LOCK_PATH
464     ;;
465 esac
466
467
468 case ".$NGX_ERROR_LOG_PATH" in
469     ./*)
470     ;;
471
472     .)
473         NGX_ERROR_LOG_PATH=$NGX_PREFIX/logs/error.log
474     ;;
475
476     .stderr)
477         NGX_ERROR_LOG_PATH=
478     ;;
479
480     *)
481         NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH
482     ;;
483 esac
484
485
486 case ".$NGX_HTTP_LOG_PATH" in
487     ./*)
488     ;;
489
490     .)
491         NGX_HTTP_LOG_PATH=$NGX_PREFIX/logs/access.log
492     ;;
493
494     *)
495         NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH
496     ;;
497 esac
498
499
500 case ".$NGX_HTTP_CLIENT_TEMP_PATH" in
501     ./*)
502     ;;
503
504     .)
505         NGX_HTTP_CLIENT_TEMP_PATH=$NGX_PREFIX/client_body_temp
506     ;;
507
508     *)
509         NGX_HTTP_CLIENT_TEMP_PATH=$NGX_PREFIX/$NGX_HTTP_CLIENT_TEMP_PATH
510     ;;
511 esac
512
513
514 case ".$NGX_HTTP_PROXY_TEMP_PATH" in
515     ./*)
516     ;;
517
518     .)
519         NGX_HTTP_PROXY_TEMP_PATH=$NGX_PREFIX/proxy_temp
520     ;;
521
522     *)
523         NGX_HTTP_PROXY_TEMP_PATH=$NGX_PREFIX/$NGX_HTTP_PROXY_TEMP_PATH
524     ;;
525 esac
526
527
528 case ".$NGX_HTTP_FASTCGI_TEMP_PATH" in
529     ./*)
530     ;;
531
532     .)
533         NGX_HTTP_FASTCGI_TEMP_PATH=$NGX_PREFIX/fastcgi_temp
534     ;;
535
536     *)
537         NGX_HTTP_FASTCGI_TEMP_PATH=$NGX_PREFIX/$NGX_HTTP_FASTCGI_TEMP_PATH
538     ;;
539 esac
540
541
542 case ".$NGX_PERL_MODULES" in
543     ./*)
544     ;;
545
546     .)
547     ;;
548
549     *)
550         NGX_PERL_MODULES=$NGX_PREFIX/$NGX_PERL_MODULES
551     ;;
552 esac