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