Compare commits

..

173 Commits

Author SHA1 Message Date
Igor Sysoev ff8cfc0b45 release-0.5.38 tag 2009-09-14 13:17:17 +00:00
Igor Sysoev b55c3bd75f nginx-0.5.38-RELEASE 2009-09-14 13:17:16 +00:00
Igor Sysoev 60f79b0cfd merge r3092:
handle "/../" case more reliably
2009-09-07 12:03:14 +00:00
Igor Sysoev 4edf193b41 merge r3076, r3080:
fix segfault when a header starts with "\rX"
and logging is set to info or debug level
2009-09-07 12:02:37 +00:00
Igor Sysoev b6c2d1a5d6 bump version 2009-09-07 12:00:25 +00:00
Igor Sysoev e7af3c349d release-0.5.37 tag 2008-07-07 12:09:03 +00:00
Igor Sysoev c32036746d nginx-0.5.37-RELEASE 2008-07-07 12:09:02 +00:00
Igor Sysoev 29e7a067b3 r2080 merge:
fix error when response parsed by sub filter, then by SSI filter
and some response parts are output as file buffers
2008-07-07 12:01:35 +00:00
Igor Sysoev 340f9a268b r2067 merge:
fix bug when inactive subrequest is truncated,
if output_buffers are less than subrequest size
2008-07-07 11:59:59 +00:00
Igor Sysoev 321d1a2cfb r1901, r1902, r2032 merge:
bugfixes in channel:

*) avoid endless loop if epoll is used
*) use CMSG_LEN(), this fixes an alert
   "sendmsg() failed (9: Bad file descriptor)" on some 64-bit platforms
*) read channel until EAGAIN
2008-07-07 11:58:55 +00:00
Igor Sysoev 8ad79171b9 r2019 merge:
fix building on modern Fedora 9 caused by IOV_MAX
2008-07-07 11:50:42 +00:00
Igor Sysoev 05e3ebfd2a r2015 merge:
avoid recursive loop
2008-07-07 11:50:21 +00:00
Igor Sysoev 55ff3d4e84 bump version 2008-07-07 11:49:18 +00:00
Igor Sysoev 69b5d6657d release-0.5.36 tag 2008-05-04 11:17:14 +00:00
Igor Sysoev 583ddf1405 nginx-0.5.36-RELEASE 2008-05-04 11:17:13 +00:00
Igor Sysoev 5fa7846941 r1979 merge:
reset looked at match
2008-05-04 10:11:23 +00:00
Igor Sysoev 7560165df1 r1969 merge:
fix segfault
2008-05-04 10:08:36 +00:00
Igor Sysoev e9e15f8a13 r1894 merge:
fix segfault if empty stub block is used second time
2008-05-04 10:05:29 +00:00
Igor Sysoev b80397bd24 r1886 merge:
test response length in proxy/fastcgi_store
2008-05-04 10:04:21 +00:00
Igor Sysoev b811a5c388 r1862, r1866, r1869, r1874 merge:
*) revert SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER, removed in r1852
*) fix bogus crit log message "SSL_shutdown() failed" introduced in r1852
*) pull all errors
2008-05-04 09:47:59 +00:00
Igor Sysoev 73d987a411 r1699, r1700, r1701, r1702, r1707 merge:
upstream parse_header fix and optimization,
fix fastcgi_catch_stderr segfault merged in r1524:

*) return NGX_HTTP_UPSTREAM_INVALID_HEADER for invalid status
*) return NGX_ERROR instead of NGX_HTTP_INTERNAL_SERVER_ERROR
   in u->parse_header()
*) return NGX_HTTP_UPSTREAM_INVALID_HEADER instead of NGX_HTTP_BAD_GATEWAY
   to go to a next upstream on invalid_header condition
*) now ngx_conf_set_str_array_slot() tests NGX_CONF_UNSET_PTR
   this fixes fastcgi_catch_stderr segfault
*) ngx_http_upstream_hide_headers_hash()
*) proxy/fastcgi pass_header/hide_header use
   ngx_http_upstream_hide_headers_hash()
2008-05-04 09:29:43 +00:00
Igor Sysoev c8795dae87 r1871, r1940 merge:
fix building --test-build-rtsig and --test-build-eventport on FreeBSD 7
2008-05-04 09:20:53 +00:00
Igor Sysoev 64763c5e44 bump version 2008-01-08 17:50:03 +00:00
Igor Sysoev 80da2c2708 release-0.5.35 tag 2008-01-08 17:42:11 +00:00
Igor Sysoev 7c957e784c nginx-0.5.35-RELEASE 2008-01-08 17:42:10 +00:00
Igor Sysoev 3b28854a2b r1755, r1756, r1757 merge:
*) SSL_shutdown() never returns -1, on error it returns 0.
   This fixes incidental "bad write retry" errors.
*) cleaning stale global SSL error
*) remove SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER, we never need it
2008-01-08 17:30:39 +00:00
Igor Sysoev e96e6e5271 r1763 merge:
fix STARTTLS prompt in SMTP
2008-01-08 17:24:36 +00:00
Igor Sysoev 0afa1ec458 r1739 merge:
fix merge_slashes
2008-01-08 17:23:25 +00:00
Igor Sysoev f111133e2e r1709 merge:
large_client_header_buffers did not free()ed before keep-alive
2008-01-08 17:22:10 +00:00
Igor Sysoev 3e6bbafb66 r1658 merge:
improve throughput with large limit_rate
2008-01-08 17:13:54 +00:00
Igor Sysoev 26181301e9 r1652 merge:
use usec and pid as start value
2008-01-08 17:09:49 +00:00
Igor Sysoev c4773f2a3c r1646 merge:
the simple expression has the same precision without overflow
2008-01-08 17:09:08 +00:00
Igor Sysoev 0f965a8cd0 r1632 merge:
omit unnecessary test, because NGX_ERROR == -1,
but r->headers_out.last_modified_time != -1 at this point
2008-01-08 16:56:14 +00:00
Igor Sysoev 70f3ec2922 r1631 merge:
If-Range support
2008-01-08 16:55:05 +00:00
Igor Sysoev 966315a1e9 r1617 merge:
set status in correct place
2008-01-08 16:52:00 +00:00
Igor Sysoev bf139b1f7f r1606 merge:
use uname(2) instead of /proc/, this allows to run nginx in chroot
2008-01-08 16:47:55 +00:00
Igor Sysoev f6bfdaf2f4 r1605, r1673 merge:
divide special response handling into several functions
fix "?" escaping introduced in r1526
2008-01-08 16:42:02 +00:00
Igor Sysoev 7906a3e0e7 2008 year 2008-01-08 13:07:37 +00:00
Igor Sysoev b6aa9ee289 bump version 2007-12-13 10:55:18 +00:00
Igor Sysoev 81fd596e29 release-0.5.34 tag 2007-12-13 10:49:27 +00:00
Igor Sysoev fa10dd869a nginx-0.5.34-RELEASE 2007-12-13 10:49:26 +00:00
Igor Sysoev cb5f545b0d r1678, r1679 merge:
*) copy protocol value when large request line is copied,
   this fixes error "fastcgi: the request record is too big"
*) log how big fastcgi record
2007-12-12 21:11:21 +00:00
Igor Sysoev 2514b3962a r1677 merge:
do not allow plain 0.9 request to HTTPS
2007-12-12 21:09:17 +00:00
Igor Sysoev 82e19b3fa9 r1667 merge:
delete unneeded declaration
2007-12-12 21:08:20 +00:00
Igor Sysoev 8ae336f5ad r1657 merge:
log entire request line instead of URI only
2007-12-12 21:05:17 +00:00
Igor Sysoev 142d14d203 r1630 merge:
do not encode already encoded characters in msie_refresh
2007-12-12 21:03:01 +00:00
Igor Sysoev 97cc2c55fe r1627 merge:
fix gzip and SSL
2007-12-12 21:01:43 +00:00
Igor Sysoev dc291bf4f6 r1626 merge:
fix segfaults
2007-12-12 20:59:58 +00:00
Igor Sysoev e301eca9b5 r1604 merge:
compatibility with mget: space after HTTP/1.1
2007-12-12 20:58:34 +00:00
Igor Sysoev 14c25da2eb r1594 merge:
unescape SSI include
2007-12-12 20:56:13 +00:00
Igor Sysoev e448698e1a r1593, r1595 merge:
server_tokens
2007-12-12 20:53:06 +00:00
Igor Sysoev 763e61004a r1591 merge:
fix segfault
2007-12-12 20:50:46 +00:00
Igor Sysoev 721df7ef24 r1587, r1588, r1589, r1590, r1592, r1599, r1629, r1636, r1674, r1681,
r1682, r1683 merge:

typo and style fixes
2007-12-12 20:49:45 +00:00
Igor Sysoev 7c99942b42 merge_slashes 2007-12-12 20:43:39 +00:00
Igor Sysoev ab2aecb398 r1585 merge:
allow full URL without URI part: "GET http://host HTTP/1.0"
2007-12-12 20:42:47 +00:00
Igor Sysoev a8545c11c4 r1584 merge:
gzip_vary
2007-12-12 20:41:22 +00:00
Igor Sysoev d6e4741aa8 r1577, r1582 merge:
Cygwin support
2007-12-12 20:38:44 +00:00
Igor Sysoev 2e98f272c7 r1576, r1578, r1579 merge:
avoid segfault if poll is used and endless loop if select is used
2007-12-12 20:35:32 +00:00
Igor Sysoev ee84366663 r1573, r1574, r1575 merge:
ngx_md5.h and ngx_sha1.h
2007-12-12 17:09:50 +00:00
Igor Sysoev c86eef6299 r1568 merge:
memcached did not set $upstream_response_time
2007-12-12 16:58:44 +00:00
Igor Sysoev 6d347fa2c3 r1567 merge:
fix segfault when $date_local or $date_gmt are used outside ssi module
2007-12-12 16:58:13 +00:00
Igor Sysoev 281a70c61c r1566 merge:
fix English grammar
2007-12-12 16:57:36 +00:00
Igor Sysoev 872ff5410e r1564 merge:
style fix: remove double semicolons
2007-12-12 16:54:53 +00:00
Igor Sysoev 8552e3741f r1563 merge:
allow access_log inside limit_except
2007-12-12 16:54:25 +00:00
Igor Sysoev 984293b7a7 r1562 merge:
%v fix lost in r1407
2007-12-12 16:53:16 +00:00
Igor Sysoev 2684d952f8 r1560 merge:
use pool instead of ngx_conf_t
2007-12-12 16:51:43 +00:00
Igor Sysoev 919798169d r1559, r1565 merge:
optimizations
2007-12-12 16:49:38 +00:00
Igor Sysoev 9a95869ac4 bump version 2007-11-07 14:38:41 +00:00
Igor Sysoev 76fe404739 release-0.5.33 tag 2007-11-07 14:31:57 +00:00
Igor Sysoev 9d5ff02c8b nginx-0.5.33-RELEASE 2007-11-07 14:31:56 +00:00
Igor Sysoev a1876613aa r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
r1487, r1488, r1494, r1495, r1499 merge:

*) ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
*) smtp_client_buffer and smtp_greeting_delay
2007-11-07 14:24:55 +00:00
Igor Sysoev 2163a4a058 r1556, r1558 merge:
sub_filter fixes:

*) fix empty string replacement in sub_filter
*) add sub_filter parser fix similar to r1261 in SSI parser
*) fix case when pattern is split between two buffers:
   it had been fixed in SSI parser long ago
2007-11-07 13:59:32 +00:00
Igor Sysoev b2f5beaa06 r1355, r1471, r1600 merge:
make 64-bit ngx_int_t on 64-bit platforms
2007-11-07 13:54:40 +00:00
Igor Sysoev 7586d58399 r1386, r1388, r1389, r1580, r1581 merge:
regex in server_name and valid_referers
2007-11-07 13:46:29 +00:00
Igor Sysoev 09ba4853d2 r1254, r1416, r1493 merge:
the "www.example.*" wildcard hash support
2007-11-07 13:39:53 +00:00
Igor Sysoev 1687d189d6 r1553, r1554 merge:
ngx_strnstr()
2007-10-29 15:10:31 +00:00
Igor Sysoev ca7705fc99 r1548 merge:
add time and length to a HEAD request
2007-10-29 15:08:43 +00:00
Igor Sysoev 92f28e3d31 r1547 merge:
omit trailing zero in directory name
2007-10-29 15:08:01 +00:00
Igor Sysoev 7ad9f14c74 r1545, r1546 merge:
ngx_escape_html(), SSI echo encoding
2007-10-29 15:03:04 +00:00
Igor Sysoev e0f4baa71a r1542, r1543, r1544, r1549, r1550, r1551, r1555 merge:
*) ngx_strstrn() and ngx_strcasestrn()
*) fix memcached END test
2007-10-29 14:52:51 +00:00
Igor Sysoev d8f7a2530d r1492 merge:
log starttls
2007-10-29 14:35:37 +00:00
Igor Sysoev 8c08a6115f r1491 merge:
add rpath for Solaris
2007-10-29 14:32:18 +00:00
Igor Sysoev 814b1095e2 bump version 2007-09-24 04:19:28 +00:00
Igor Sysoev 94a30a8ea7 release-0.5.32 tag 2007-09-24 04:11:21 +00:00
Igor Sysoev 17a957c6f6 nginx-0.5.32-RELEASE 2007-09-24 04:11:20 +00:00
Igor Sysoev 67abd13c05 r1500 merge:
fix file leak for HEAD requests
2007-09-23 19:30:51 +00:00
Igor Sysoev cd46141e2b r1490 merge:
u_char* is enough to keep file name
2007-09-23 19:29:22 +00:00
Igor Sysoev 8e79f6fbf8 r1489 merge:
the "proxy_hide_header" and "fastcgi_hide_header" directives did not
hide response header lines whose name was longer than 32 characters
2007-09-23 19:28:29 +00:00
Igor Sysoev 93b7540ff5 r1445 merge:
allow to append charset to the "Content-Type" header
2007-09-23 19:26:53 +00:00
Igor Sysoev 1bb036cd84 r1473 merge:
decrement active connection counter in mail proxy
2007-09-23 19:25:28 +00:00
Igor Sysoev a142ff6a3a r1472 merge:
response to the HEAD request should be a header only
2007-09-23 19:24:13 +00:00
Igor Sysoev a69878f1fc r1470 merge:
connection error should be logged with "connecting to upstream" action,
the bug was introduced in r1154
2007-09-23 19:23:30 +00:00
Igor Sysoev f5ef42b0d3 r1469 merge:
read EOF of header only responses in non-buffered proxying
2007-09-23 19:21:45 +00:00
Igor Sysoev ed6903a15d r1468 merge:
there may be several "Connection" header lines and each may have several tokens
2007-09-23 19:20:45 +00:00
Igor Sysoev ff31837caf r1467 merge:
escape internal request URI in proxy_pass
2007-09-23 19:19:14 +00:00
Igor Sysoev bed8eaacf4 r1465 merge:
style fix
2007-09-23 19:18:22 +00:00
Igor Sysoev 4f2f70c7cd r1453 merge:
change ngx_conf_merge_ptr_value() and update fastcgi_catch_stderr
2007-09-23 19:15:42 +00:00
Igor Sysoev 223a42cbec r1442, r1443, r1446, r1451 merge:
update comments and style fixes
2007-09-23 19:10:46 +00:00
Igor Sysoev 93666c389e r1441 merge:
use ev->log, because ev->data may be connection stub only
2007-09-23 19:03:57 +00:00
Igor Sysoev cffa71db74 r1438 merge:
destroy ngx_cycle->pool on exit
2007-09-23 19:01:48 +00:00
Igor Sysoev 731f992260 r1436 merge:
win32 ngx_is_exec() stub
2007-09-23 19:00:07 +00:00
Igor Sysoev ce69390c00 r1436 merge:
log socket number
2007-09-23 18:59:07 +00:00
Igor Sysoev f2319c1b65 r1435 merge:
If-Modified-Since should be unique header line
2007-09-23 18:58:17 +00:00
Igor Sysoev 92a7aff502 r1432, r1433, r1434 merge:
/dev/poll segfault fix and guard code
2007-09-23 18:57:26 +00:00
Igor Sysoev e355d9c3af r1428 merge:
return 400 response
2007-09-22 19:34:16 +00:00
Igor Sysoev fee8fa15f5 r1409, r1413 merge:
set delay only when almost whole sendfile_max_chunk was transferred
2007-09-22 19:23:34 +00:00
Igor Sysoev d0505ea2bb r1407 merge:
use %v for ngx_variable_value_t in ngx_sprintf(),
this fixes nginx on FreeBSD/sparc64
2007-09-22 19:18:36 +00:00
Igor Sysoev 2ee2bc5fc6 r1406 merge:
escape " ", "%", and %00-%1F in login and password
2007-09-22 19:15:01 +00:00
Igor Sysoev 90964473e4 r1405 merge:
set worker_priority, worker_rlimit_nofile, worker_rlimit_core, and
worker_rlimit_sigpending without super-user privileges testing
2007-09-22 19:12:53 +00:00
Igor Sysoev 6e6b63ad8e r1404 merge:
auto redirect lost arguments
2007-09-22 19:10:53 +00:00
Igor Sysoev 03465b9370 r1398 merge:
upstream sendfile bit was overridden by r->connection->sendfile
2007-09-22 19:08:42 +00:00
Igor Sysoev 0e37b1c1e3 r1394 merge:
rename upgrade to upgrade1
use -QUIT instead of -WINCH
2007-09-22 19:06:46 +00:00
Igor Sysoev 0d3b197fcb r1381 merge:
ignore meaningless bits in CIDR and warn about them
2007-09-22 19:02:39 +00:00
Igor Sysoev 5808a898f5 r1378 merge:
set default listen() backlog to 511 on all platforms except FreeBSD
2007-09-22 18:59:05 +00:00
Igor Sysoev 53da077a78 r1364, r1365, r1366, r1367 merge:
add_header changes:
"Last-Modified", "Cache-Control" and "Expires" headers use specific handlers
2007-09-22 18:54:28 +00:00
Igor Sysoev f0237bfba3 r1340, r1341 merge:
fix case when two directives
    proxy_pass   http://backend;
    proxy_pass   https://backend;
both use one port - 80 or 443, that was defined first.
2007-09-22 18:44:30 +00:00
Igor Sysoev d8ea8ca5f8 r1391, r1392, r1393 merge:
auth_http related changes:
*) stop configuration on error
*) allow "http://" in auth_http URL
*) test http_auth absence
2007-09-22 18:41:35 +00:00
Igor Sysoev 8e2c9a3126 r1324 merge:
IMAP AUTHENTICATE
patch by Maxim Dounin
2007-09-22 18:36:23 +00:00
Igor Sysoev d8d4d64a75 r1323 merge:
SMTP STARTTLS
patch by Maxim Dounin
2007-09-22 18:35:18 +00:00
Igor Sysoev 8b655ab2dd r1284 merge:
proxy_ignore_client_abort, fastcgi_ignore_client_abort, and so on were
broken by r1111
2007-09-22 18:31:26 +00:00
Igor Sysoev b132258d73 r1444 merge:
style fix
2007-09-01 09:55:41 +00:00
Igor Sysoev 8f5466261d r1440 merge:
style fix
2007-09-01 09:55:04 +00:00
Igor Sysoev a54eea5a08 r1439 merge:
fix typo
2007-09-01 09:53:10 +00:00
Igor Sysoev 6ba2e6522f r1272 merge:
add comment
2007-09-01 09:51:57 +00:00
Igor Sysoev a6d70e05ef r1414 merge:
add svg mime type
2007-08-26 13:42:04 +00:00
Igor Sysoev 63387a60e5 bump version 2007-08-21 19:46:20 +00:00
Igor Sysoev 288c7f86fd release-0.5.31 tag 2007-08-15 12:47:27 +00:00
Igor Sysoev 96dcd68f7a nginx-0.5.31-RELEASE 2007-08-15 12:47:26 +00:00
Igor Sysoev 773b0ae920 r1387 merge:
fix building by bcc without PCRE
2007-08-14 20:03:00 +00:00
Igor Sysoev fc18feef28 r1354 merge:
named location
2007-08-14 20:02:09 +00:00
Igor Sysoev 4b8574c891 bump version 2007-08-11 10:17:02 +00:00
Igor Sysoev 64c07187a0 r1376 merge:
add debug info for Sun Studio
2007-08-11 10:13:37 +00:00
Igor Sysoev 19994e9acc r1297 merge:
dav_access uses ngx_conf_set_access_slot()
2007-08-11 10:12:22 +00:00
Igor Sysoev 5dc1930cce r1292, r1296 merge:
proxy_store and fastcgi_store, proxy_store_access and fastcgi_store_access
2007-08-11 10:11:33 +00:00
Igor Sysoev cc5999a68c release-0.5.30 tag 2007-07-30 09:14:35 +00:00
Igor Sysoev b473bf5b46 nginx-0.5.30-RELEASE 2007-07-30 09:14:34 +00:00
Igor Sysoev cf18290f42 r1352 merge:
$is_args
2007-07-29 18:55:59 +00:00
Igor Sysoev 8bb450b5e4 r1351 merge:
allow to set $args
2007-07-29 18:55:24 +00:00
Igor Sysoev b66b8c0906 r1258, r1259 merge:
set worker's perl $$
2007-07-29 17:31:00 +00:00
Igor Sysoev 42c91afe85 r1343 merge:
fix case when client has closed connection but upstream buffer is not empty
2007-07-29 17:29:06 +00:00
Igor Sysoev 988bede80f r1333, r1334 merge:
omit unnecessary code,
escape space, etc in $memcached_key
2007-07-29 17:27:10 +00:00
Igor Sysoev f488e98593 r1285 merge:
fix segfault when session was freed twice
2007-07-29 17:25:06 +00:00
Igor Sysoev aaa44dd224 r1344 merge:
fix building on amd64 by Sun Studio 11 and more early versions
2007-07-29 17:22:59 +00:00
Igor Sysoev 2ac6766577 bump version 2007-07-24 14:36:21 +00:00
Igor Sysoev aef26c77db release-0.5.29 tag 2007-07-23 07:59:00 +00:00
Igor Sysoev 969f51c3c8 nginx-0.5.29-RELEASE 2007-07-23 07:58:59 +00:00
Igor Sysoev d1d9811cf3 r1330, r1331 merge:
$nginx_version
2007-07-22 13:17:41 +00:00
Igor Sysoev 7b0af7b8b3 r1277 merge:
fix headers split in FastCGI records
2007-07-22 09:05:43 +00:00
Igor Sysoev 10f0b17058 r1306, r1307, r1308, r1309, r1310, r1311, r1322, r1325 merge:
Sun Studio related fixes
2007-07-22 08:47:45 +00:00
Igor Sysoev 03e366afc3 r1318, r1319, r1320, r1321 merge:
fix various bugs found by Coverity's Scan
2007-07-22 08:40:39 +00:00
Igor Sysoev 3e6256935f bump version 2007-07-22 08:35:56 +00:00
Igor Sysoev 0a647dc34d release-0.5.28 tag 2007-07-17 10:01:18 +00:00
Igor Sysoev 01d30b7b65 nginx-0.5.28-RELEASE 2007-07-17 10:01:17 +00:00
Igor Sysoev 32ad363a2c r1299 merge:
msie_refresh should escape at least '"' to prevent XSS
2007-07-17 09:34:23 +00:00
Igor Sysoev 149fdb18d8 r1298 merge:
"?" should not be escaped
2007-07-13 10:48:48 +00:00
Igor Sysoev 0e254f6bbb r1290, r1291 merge:
style fixes
2007-07-13 10:47:26 +00:00
Igor Sysoev ec6ef43624 r1289 merge:
reset errno
2007-07-13 10:46:16 +00:00
Igor Sysoev 96e7062852 r1288 merge:
fix segfault when event port returns POLLERR without POLLIN or POLLOUT
2007-07-13 10:45:33 +00:00
Igor Sysoev 129dd82d2a r1287 merge:
fix segfault when CRAM-MD5 is not enabled but client tries it
2007-07-13 10:44:36 +00:00
Igor Sysoev 11ade0fb6a r1286 merge:
fix memory allocation for auth_http_header
2007-07-13 10:43:35 +00:00
Igor Sysoev ea7cf4cf90 bump version 2007-07-09 10:34:14 +00:00
Igor Sysoev 20f18b4d2e release-0.5.27 tag 2007-07-09 06:53:55 +00:00
Igor Sysoev 152003567d nginx-0.5.27-RELEASE 2007-07-09 06:53:54 +00:00
Igor Sysoev 08f9992a63 r1275 merge:
omit unnecessary conditions
2007-07-09 06:06:15 +00:00
Igor Sysoev 4a7cc46f8c r1273 merge:
when the FastCGI header was split in records,
nginx passed garbage in the header to a client
2007-07-08 09:18:06 +00:00
Igor Sysoev 890a7407c7 r1260 merge:
if subrequest response was buffered in file, then subrequest was finalized
with 0 code, ngx_http_writer() was not set, and response part in file was lost
2007-07-05 11:42:11 +00:00
Igor Sysoev 61092efcfa r1262 merge:
if a subrequest was finished and SSI was in middle of SSI command parsing
and the command was a fast subrequest then the second subrequest output
was just after first subrequest output and response part of main request
between the subrequests went after the second subrequest.
2007-07-05 11:36:16 +00:00
Igor Sysoev f14fcc5d23 bump version 2007-06-17 19:27:11 +00:00
Igor Sysoev 5f819d85df release-0.5.26 tag 2007-06-17 19:07:56 +00:00
Igor Sysoev f989298c90 nginx-0.5.26-RELEASE 2007-06-17 19:07:55 +00:00
Igor Sysoev 3702756e0d r1261 merge:
if "<!--" was on edge of buf, then ssi_sharp_state was saved in ctx->saved
and if it was not reset, then any '#' was treated as SSI command start
2007-06-17 18:52:06 +00:00
Igor Sysoev 7474f1ea93 bump version 2007-06-11 19:31:55 +00:00
Igor Sysoev 93e8ad64c7 stable 0.5 branch 2007-06-11 19:25:52 +00:00
547 changed files with 31535 additions and 195127 deletions

389
README
View File

@ -1,389 +0,0 @@
Experimental QUIC support for nginx
-----------------------------------
1. Introduction
2. Building from sources
3. Configuration
4. Directives
5. Clients
6. Troubleshooting
7. Contributing
8. Links
1. Introduction
This is an experimental QUIC [1] / HTTP/3 [2] support for nginx.
The code is developed in a separate "quic" branch available
at https://hg.nginx.org/nginx-quic. Currently it is based
on nginx mainline 1.23.x. We merge new nginx releases into
this branch regularly.
The project code base is under the same BSD license as nginx.
The code is currently at a beta level of quality, however
there are several production deployments with it.
NGINX Development Team is working on improving HTTP/3 support to
integrate it into the main NGINX codebase. Thus, expect further
updates of this code, including features, changes in behaviour,
bug fixes, and refactoring. NGINX Development team will be
grateful for any feedback and code submissions.
Please contact NGINX Development Team via nginx-devel mailing list [3].
What works now:
IETF QUIC version 1 is supported. Internet drafts are no longer supported.
nginx should be able to respond to HTTP/3 requests over QUIC and
it should be possible to upload and download big files without errors.
+ The handshake completes successfully
+ One endpoint can update keys and its peer responds correctly
+ 0-RTT data is being received and acted on
+ Connection is established using TLS Resume Ticket
+ A handshake that includes a Retry packet completes successfully
+ Stream data is being exchanged and ACK'ed
+ An H3 transaction succeeded
+ One or both endpoints insert entries into dynamic table and
subsequently reference them from header blocks
+ Version Negotiation packet is sent to client with unknown version
+ Lost packets are detected and retransmitted properly
+ Clients may migrate to new address
2. Building from sources
The build is configured using the configure command.
Refer to http://nginx.org/en/docs/configure.html for details.
When configuring nginx, it's possible to enable QUIC and HTTP/3
using the following new configuration options:
--with-http_v3_module - enable QUIC and HTTP/3
--with-stream_quic_module - enable QUIC in Stream
A library that provides QUIC support is recommended to build nginx, there
are several of those available on the market:
+ BoringSSL [4]
+ LibreSSL [5]
+ QuicTLS [6]
Alternatively, nginx can be configured with OpenSSL compatibility
layer, which emulates BoringSSL QUIC API for OpenSSL. This mode is
enabled by default if native QUIC support is not detected.
0-RTT is not supported in OpenSSL compatibility mode.
Clone the NGINX QUIC repository
$ hg clone -b quic https://hg.nginx.org/nginx-quic
$ cd nginx-quic
Use the following command to configure nginx with BoringSSL [4]
$ ./auto/configure --with-debug --with-http_v3_module \
--with-cc-opt="-I../boringssl/include" \
--with-ld-opt="-L../boringssl/build/ssl \
-L../boringssl/build/crypto"
$ make
Alternatively, nginx can be configured with QuicTLS [6]
$ ./auto/configure --with-debug --with-http_v3_module \
--with-cc-opt="-I../quictls/build/include" \
--with-ld-opt="-L../quictls/build/lib"
Alternatively, nginx can be configured with a modern version
of LibreSSL [7]
$ ./auto/configure --with-debug --with-http_v3_module \
--with-cc-opt="-I../libressl/build/include" \
--with-ld-opt="-L../libressl/build/lib"
3. Configuration
The HTTP "listen" directive got a new option "quic" which enables
QUIC as client transport protocol instead of TCP.
The Stream "listen" directive got a new option "quic" which enables
QUIC as client transport protocol instead of TCP or plain UDP.
Along with "quic", it's also possible to specify "reuseport"
option [8] to make it work properly with multiple workers.
To enable address validation:
quic_retry on;
To enable 0-RTT:
ssl_early_data on;
Make sure that TLS 1.3 is configured which is required for QUIC:
ssl_protocols TLSv1.3;
To enable GSO (Generic Segmentation Offloading):
quic_gso on;
To limit maximum UDP payload size on receive path:
quic_mtu <size>;
To set host key for various tokens:
quic_host_key <filename>;
By default, GSO Linux-specific optimization [10] is disabled.
Enable it in case a corresponding network interface is configured to
support GSO.
A number of directives were added that configure HTTP/3:
http3
http3_hq
http3_stream_buffer_size
http3_max_concurrent_pushes
http3_max_concurrent_streams
http3_push
http3_push_preload
In http, an additional variable is available: $http3.
The value of $http3 is "h3" for HTTP/3 connections,
"hq" for hq connections, or an empty string otherwise.
In stream, an additional variable is available: $quic.
The value of $quic is "quic" if QUIC connection is used,
or an empty string otherwise.
Example configuration:
http {
log_format quic '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http3"';
access_log logs/access.log quic;
server {
# for better compatibility it's recommended
# to use the same port for quic and https
listen 8443 quic reuseport;
listen 8443 ssl;
ssl_certificate certs/example.com.crt;
ssl_certificate_key certs/example.com.key;
ssl_protocols TLSv1.3;
location / {
# required for browsers to direct them into quic port
add_header Alt-Svc 'h3=":8443"; ma=86400';
}
}
}
4. Directives
Syntax: quic_bpf on | off;
Default: quic_bpf off;
Context: main
Enables routing of QUIC packets using eBPF.
When enabled, this allows to support QUIC connection migration.
The directive is only supported on Linux 5.7+.
Syntax: quic_retry on | off;
Default: quic_retry off;
Context: http | stream, server
Enables the QUIC Address Validation feature. This includes:
- sending a new token in a Retry packet or a NEW_TOKEN frame
- validating a token received in the Initial packet
Syntax: quic_gso on | off;
Default: quic_gso off;
Context: http | stream, server
Enables sending in optimized batch mode using segmentation offloading.
Optimized sending is only supported on Linux featuring UDP_SEGMENT.
Syntax: quic_mtu size;
Default: quic_mtu 65527;
Context: http | stream, server
Sets the QUIC max_udp_payload_size transport parameter value.
This is the maximum UDP payload that we are willing to receive.
Syntax: quic_host_key file;
Default: -
Context: http | stream, server
Specifies a file with the secret key used to encrypt stateless reset and
address validation tokens. By default, a randomly generated key is used.
Syntax: quic_active_connection_id_limit number;
Default: quic_active_connection_id_limit 2;
Context: http | stream, server
Sets the QUIC active_connection_id_limit transport parameter value.
This is the maximum number of connection IDs we are willing to store.
Syntax: quic_timeout time;
Default: quic_timeout 60s;
Context: stream, server
Defines a timeout used to negotiate the QUIC idle timeout.
In the http module, it is taken from the keepalive_timeout directive.
Syntax: quic_stream_buffer_size size;
Default: quic_stream_buffer_size 64k;
Context: stream, server
Syntax: http3_stream_buffer_size size;
Default: http3_stream_buffer_size 64k;
Context: http, server
Sets buffer size for reading and writing of the QUIC STREAM payload.
The buffer size is used to calculate initial flow control limits
in the following QUIC transport parameters:
- initial_max_data
- initial_max_stream_data_bidi_local
- initial_max_stream_data_bidi_remote
- initial_max_stream_data_uni
Syntax: http3_max_concurrent_pushes number;
Default: http3_max_concurrent_pushes 10;
Context: http, server
Limits the maximum number of concurrent push requests in a connection.
Syntax: http3_max_concurrent_streams number;
Default: http3_max_concurrent_streams 128;
Context: http, server
Sets the maximum number of concurrent HTTP/3 streams in a connection.
Syntax: http3_push uri | off;
Default: http3_push off;
Context: http, server, location
Pre-emptively sends (pushes) a request to the specified uri along with
the response to the original request. Only relative URIs with absolute
path will be processed, for example:
http3_push /static/css/main.css;
The uri value can contain variables.
Several http3_push directives can be specified on the same configuration
level. The off parameter cancels the effect of the http3_push directives
inherited from the previous configuration level.
Syntax: http3_push_preload on | off;
Default: http3_push_preload off;
Context: http, server, location
Enables automatic conversion of preload links specified in the “Link”
response header fields into push requests.
Syntax: http3 on | off;
Default: http3 on;
Context: http, server
Enables HTTP/3 protocol negotiation.
Syntax: http3_hq on | off;
Default: http3_hq off;
Context: http, server
Enables HTTP/0.9 protocol negotiation used in QUIC interoperability tests.
5. Clients
* Browsers
Known to work: Firefox 90+ and Chrome 92+ (QUIC version 1)
Beware of strange issues: sometimes browser may decide to ignore QUIC
Cache clearing/restart might help. Always check access.log and
error.log to make sure the browser is using HTTP/3 and not TCP https.
* Console clients
Known to work: ngtcp2, firefox's neqo and chromium's console clients:
$ examples/client 127.0.0.1 8443 https://example.com:8443/index.html
$ ./neqo-client https://127.0.0.1:8443/
$ chromium-build/out/my_build/quic_client http://example.com:8443
In case everyhing is right, the access log should show something like:
127.0.0.1 - - [24/Apr/2020:11:27:29 +0300] "GET / HTTP/3" 200 805 "-"
"nghttp3/ngtcp2 client" "quic"
6. Troubleshooting
Here are some tips that may help to identify problems:
+ Ensure nginx is built with proper SSL library that supports QUIC
+ Ensure nginx is using the proper SSL library in runtime
(`nginx -V` shows what it's using)
+ Ensure a client is actually sending requests over QUIC
(see "Clients" section about browsers and cache)
We recommend to start with simple console client like ngtcp2
to ensure the server is configured properly before trying
with real browsers that may be very picky with certificates,
for example.
+ Build nginx with debug support [9] and check the debug log.
It should contain all details about connection and why it
failed. All related messages contain "quic " prefix and can
be easily filtered out.
+ For a deeper investigation, please enable additional debugging
in src/event/quic/ngx_event_quic_connection.h:
#define NGX_QUIC_DEBUG_PACKETS
#define NGX_QUIC_DEBUG_FRAMES
#define NGX_QUIC_DEBUG_ALLOC
#define NGX_QUIC_DEBUG_CRYPTO
7. Contributing
Please refer to
http://nginx.org/en/docs/contributing_changes.html
8. Links
[1] https://datatracker.ietf.org/doc/html/rfc9000
[2] https://datatracker.ietf.org/doc/html/rfc9114
[3] https://mailman.nginx.org/mailman/listinfo/nginx-devel
[4] https://boringssl.googlesource.com/boringssl/
[5] https://www.libressl.org/
[6] https://github.com/quictls/openssl
[7] https://github.com/libressl-portable/portable/releases/tag/v3.6.0
[8] https://nginx.org/en/docs/http/ngx_http_core_module.html#listen
[9] https://nginx.org/en/docs/debugging_log.html
[10] http://vger.kernel.org/lpc_net2018_talks/willemdebruijn-lpc2018-udpgso-paper-DRAFT-1.pdf

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# aCC: HP ANSI C++ B3910B A.03.55.02
@ -12,3 +11,4 @@ CC_TEST_FLAGS="-Ae"
PCRE_OPT="$PCRE_OPT -Ae"
ZLIB_OPT="$ZLIB_OPT -Ae"
MD5_OPT="$MD5_OPT -Ae"

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Borland C++ 5.5
@ -25,7 +24,7 @@ esac
# __stdcall
#CPU_OPT="$CPU_OPT -ps"
# __fastcall
#CPU_OPT="$CPU_OPT -pr"
CPU_OPT="$CPU_OPT -pr"
CFLAGS="$CFLAGS $CPU_OPT"
@ -47,7 +46,7 @@ NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm"
# Win32 GUI mode application
#LINK="\$(CC) -laa"
LINK="\$(CC) -laa"
# the resource file
@ -62,6 +61,7 @@ ngx_include_opt="-I"
ngx_objout="-o"
ngx_binout="-e"
ngx_objext="obj"
ngx_binext=".exe"
ngx_long_start='@&&|
'

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Compaq C V6.5-207

View File

@ -1,99 +0,0 @@
# Copyright (C) Nginx, Inc.
# clang
NGX_CLANG_VER=`$CC -v 2>&1 | grep 'version' 2>&1 \
| sed -n -e 's/^.*clang version \(.*\)/\1/p' \
-e 's/^.*LLVM version \(.*\)/\1/p'`
echo " + clang version: $NGX_CLANG_VER"
have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
CC_TEST_FLAGS="-pipe"
# optimizations
#NGX_CLANG_OPT="-O2"
#NGX_CLANG_OPT="-Oz"
NGX_CLANG_OPT="-O"
case $CPU in
pentium)
# optimize for Pentium
CPU_OPT="-march=pentium"
NGX_CPU_CACHE_LINE=32
;;
pentiumpro | pentium3)
# optimize for Pentium Pro, Pentium II and Pentium III
CPU_OPT="-march=pentiumpro"
NGX_CPU_CACHE_LINE=32
;;
pentium4)
# optimize for Pentium 4
CPU_OPT="-march=pentium4"
NGX_CPU_CACHE_LINE=128
;;
athlon)
# optimize for Athlon
CPU_OPT="-march=athlon"
NGX_CPU_CACHE_LINE=64
;;
opteron)
# optimize for Opteron
CPU_OPT="-march=opteron"
NGX_CPU_CACHE_LINE=64
;;
esac
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
CFLAGS="$CFLAGS -pipe $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O2 -pipe $CPU_OPT"
else
PCRE_OPT="$PCRE_OPT -pipe"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -pipe $CPU_OPT"
else
ZLIB_OPT="$ZLIB_OPT -pipe"
fi
# warnings
CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
CFLAGS="$CFLAGS -Wconditional-uninitialized"
#CFLAGS="$CFLAGS -Wmissing-prototypes"
# we have a lot of unused function arguments
CFLAGS="$CFLAGS -Wno-unused-parameter"
# deprecated system OpenSSL library on OS X
if [ "$NGX_SYSTEM" = "Darwin" ]; then
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
fi
# stop on warning
CFLAGS="$CFLAGS -Werror"
# debug
CFLAGS="$CFLAGS -g"
if [ ".$CPP" = "." ]; then
CPP="$CC -E"
fi

View File

@ -1,21 +1,15 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
LINK="\$(CC)"
MAIN_LINK=
MODULE_LINK="-shared"
ngx_include_opt="-I "
ngx_compile_opt="-c"
ngx_pic_opt="-fPIC"
ngx_objout="-o "
ngx_binout="-o "
ngx_objext="o"
ngx_binext=
ngx_modext=".so"
ngx_long_start=
ngx_long_end=
@ -48,32 +42,6 @@ if test -n "$CFLAGS"; then
ngx_include_opt="-I"
;;
sunc)
MAIN_LINK=
MODULE_LINK="-G"
case "$NGX_MACHINE" in
i86pc)
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
;;
sun4u | sun4v)
NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
;;
esac
case $CPU in
amd64)
NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
;;
esac
;;
esac
else
@ -87,12 +55,6 @@ else
. auto/cc/gcc
;;
clang)
# Clang C compiler
. auto/cc/clang
;;
icc)
# Intel C++ compiler 7.1, 8.0, 8.1
@ -117,7 +79,7 @@ else
. auto/cc/acc
;;
msvc)
msvc*)
# MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
. auto/cc/msvc
@ -142,7 +104,7 @@ else
fi
CFLAGS="$CFLAGS $NGX_CC_OPT"
NGX_TEST_LD_OPT="$NGX_LD_OPT"
if [ "$NGX_PLATFORM" != win32 ]; then
@ -163,41 +125,18 @@ if [ "$NGX_PLATFORM" != win32 ]; then
fi
fi
ngx_feature="-Wl,-E switch"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature="gcc variadic macros"
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
ngx_feature_run=yes
ngx_feature_incs="#include <stdio.h>
#define var(dummy, args...) sprintf(args)"
ngx_feature_path=
ngx_feature_libs=-Wl,-E
ngx_feature_test=
ngx_feature_libs=
ngx_feature_test="char buf[30]; buf[0] = '0';
var(0, buf, \"%d\", 1);
if (buf[0] != '1') return 1"
. auto/feature
if [ $ngx_found = yes ]; then
MAIN_LINK="-Wl,-E"
fi
if [ "$NGX_CC_NAME" = "sunc" ]; then
echo "checking for gcc builtin atomic operations ... disabled"
else
ngx_feature="gcc builtin atomic operations"
ngx_feature_name=NGX_HAVE_GCC_ATOMIC
ngx_feature_run=yes
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="long n = 0;
if (!__sync_bool_compare_and_swap(&n, 0, 1))
return 1;
if (__sync_fetch_and_add(&n, 1) != 1)
return 1;
if (n != 2)
return 1;
__sync_synchronize();"
. auto/feature
fi
if [ "$NGX_CC_NAME" = "ccc" ]; then
echo "checking for C99 variadic macros ... disabled"
@ -213,30 +152,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then
var(0, buf, \"%d\", 1);
if (buf[0] != '1') return 1"
. auto/feature
fi
ngx_feature="gcc variadic macros"
ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
ngx_feature_run=yes
ngx_feature_incs="#include <stdio.h>
#define var(dummy, args...) sprintf(args)"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[30]; buf[0] = '0';
var(0, buf, \"%d\", 1);
if (buf[0] != '1') return 1"
. auto/feature
ngx_feature="gcc builtin 64 bit byteswap"
ngx_feature_name="NGX_HAVE_GCC_BSWAP64"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="if (__builtin_bswap64(0)) return 1"
. auto/feature
fi
# ngx_feature="inline"

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
@ -52,6 +51,8 @@ esac
#NGX_GCC_OPT="-Os"
NGX_GCC_OPT="-O"
CFLAGS="$CFLAGS $NGX_GCC_OPT"
#CFLAGS="$CFLAGS -fomit-frame-pointer"
case $CPU in
@ -89,6 +90,7 @@ case $CPU in
# build 32-bit UltraSparc binary
CPU_OPT="-m32"
CORE_LINK="$CORE_LINK -m32"
CC_AUX_FLAGS="$CC_AUX_FLAGS -m32"
NGX_CPU_CACHE_LINE=64
;;
@ -96,6 +98,7 @@ case $CPU in
# build 64-bit UltraSparc binary
CPU_OPT="-m64"
CORE_LINK="$CORE_LINK -m64"
CC_AUX_FLAGS="$CC_AUX_FLAGS -m64"
NGX_CPU_CACHE_LINE=64
;;
@ -105,12 +108,12 @@ case $CPU in
CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
CORE_LINK="$CORE_LINK -m64"
CC_AUX_FLAGS="$CC_AUX_FLAGS -m64"
NGX_CPU_CACHE_LINE=128
;;
esac
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
case "$NGX_GCC_VER" in
2.7*)
@ -128,6 +131,12 @@ else
PCRE_OPT="$PCRE_OPT $PIPE"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
MD5_OPT="$MD5_OPT $PIPE"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
else
@ -143,24 +152,21 @@ CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
#CFLAGS="$CFLAGS -Wconversion"
#CFLAGS="$CFLAGS -Winline"
#CFLAGS="$CFLAGS -Wmissing-prototypes"
case "$NGX_GCC_VER" in
2.*)
3.* | 4.* )
# we have a lot of the unused function arguments
CFLAGS="$CFLAGS -Wno-unused"
CFLAGS="$CFLAGS -Wno-unused-parameter"
CFLAGS="$CFLAGS -Wno-unused-function"
CFLAGS="$CFLAGS -Wunused-variable"
CFLAGS="$CFLAGS -Wunused-value"
#CFLAGS="$CFLAGS -Wunreachable-code"
;;
*)
# we have a lot of the unused function arguments
CFLAGS="$CFLAGS -Wno-unused-parameter"
# 4.2.1 shows the warning in wrong places
#CFLAGS="$CFLAGS -Wunreachable-code"
# deprecated system OpenSSL library on OS X
if [ "$NGX_SYSTEM" = "Darwin" ]; then
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
fi
CFLAGS="$CFLAGS -Wno-unused"
;;
esac

View File

@ -1,9 +1,8 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0
NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
| sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
@ -16,7 +15,32 @@ have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
# optimizations
CFLAGS="$CFLAGS -O"
# inline the functions declared with __inline
#CFLAGS="$CFLAGS -Ob1"
# inline any function, at the compiler's discretion
CFLAGS="$CFLAGS -Ob2"
# multi-file IP optimizations
case "$NGX_ICC_VER" in
9.*)
IPO="-ipo"
;;
# 8.1.38 under FreeBSD can not link -ipo
8.1)
IPO="-ip"
;;
*)
IPO="-ipo -ipo_obj"
;;
esac
# single-file IP optimizations
#IPO="-ip"
CFLAGS="$CFLAGS $IPO"
CORE_LINK="$CORE_LINK $IPO"
CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
@ -40,11 +64,15 @@ esac
CFLAGS="$CFLAGS $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O $CPU_OPT"
PCRE_OPT="-O $IPO $CPU_OPT"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O $IPO $CPU_OPT"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O $CPU_OPT"
ZLIB_OPT="-O $IPO $CPU_OPT"
fi
@ -85,7 +113,7 @@ CFLAGS="$CFLAGS -wd1419"
case "$NGX_ICC_VER" in
9.*)
# "cc" clobber ignored, warnings for Linux's htonl()/htons()
# "cc" clobber ignored, warnings for Liunx's htonl()/htons()
CFLAGS="$CFLAGS -wd1469"
# explicit conversion of a 64-bit integral type to a smaller
# integral type
@ -99,7 +127,7 @@ case "$NGX_ICC_VER" in
;;
8.*)
# "cc" clobber ignored, warnings for Linux's htonl()/htons()
# "cc" clobber ignored, warnings for Liunx's htonl()/htons()
CFLAGS="$CFLAGS -wd1469"
# floating-point equality and inequality comparisons are unreliable,
# warning on SvTRUE()

View File

@ -1,41 +1,8 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# MSVC 6.0 SP2 cl 12.00
# MSVC Toolkit 2003 (7.1) cl 13.10
# MSVC 2005 Express Edition SP1 (8.0) cl 14.00
# MSVC 2008 Express Edition (9.0) cl 15.00
# MSVC 2010 (10.0) cl 16.00
# MSVC 2015 (14.0) cl 19.00
NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'C/C++.* [0-9][0-9]*\.[0-9]' 2>&1 \
| sed -e 's/^.* \([0-9][0-9]*\.[0-9].*\)/\1/'`
echo " + cl version: $NGX_MSVC_VER"
have=NGX_COMPILER value="\"cl $NGX_MSVC_VER\"" . auto/define
ngx_msvc_ver=`echo $NGX_MSVC_VER | sed -e 's/^\([0-9]*\).*/\1/'`
# detect x64 builds
case "$NGX_MSVC_VER" in
*x64)
NGX_MACHINE=amd64
;;
*)
NGX_MACHINE=i386
;;
esac
# MSVC 6.0 SP2, MSVC Toolkit 2003 (7.1)
# optimizations
@ -82,12 +49,12 @@ case $CPU in
;;
esac
# __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
# __cdecl, use with OpenSSL, md5 asm, and sha1 asm
#CPU_OPT="$CPU_OPT -Gd"
# __stdcall
#CPU_OPT="$CPU_OPT -Gz"
# __fastcall
#CPU_OPT="$CPU_OPT -Gr"
CPU_OPT="$CPU_OPT -Gr"
CFLAGS="$CFLAGS $CPU_OPT"
@ -103,43 +70,38 @@ CFLAGS="$CFLAGS -WX"
# disable logo
CFLAGS="$CFLAGS -nologo"
LINK="\$(CC)"
# the link flags
CORE_LINK="$CORE_LINK -link -verbose:lib"
# link with libcmt.lib, multithreaded
LIBC="-MT"
# link with msvcrt.dll
# however, MSVC Toolkit 2003 has no MSVCRT.LIB
#LIBC="-MD"
if [ $NGX_CC_NAME = msvc7 ]; then
# link with libcmt.lib, multithreaded
LIBC="-MT"
else
# link with msvcrt.dll
LIBC="-MD"
fi
CFLAGS="$CFLAGS $LIBC"
CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
# Win32 GUI mode application
#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
# debug
# msvc under Wine issues
# C1902: Program database manager mismatch; please check your installation
if [ -z "$NGX_WINE" ]; then
CFLAGS="$CFLAGS -Zi -Fd$NGX_OBJS/nginx.pdb"
CORE_LINK="$CORE_LINK -debug"
fi
# MSVC 2005 supports C99 variadic macros
if [ "$ngx_msvc_ver" -ge 14 ]; then
have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
fi
CFLAGS="$CFLAGS -Yd"
CORE_LINK="$CORE_LINK -debug -debugtype:coff"
# precompiled headers
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
CORE_LINK="$CORE_LINK $NGX_OBJS/ngx_pch.obj"
NGX_PCH="$NGX_OBJS/ngx_config.pch"
NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
if [ $NGX_CC_NAME != msvc7 ]; then
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
NGX_PCH="$NGX_OBJS/ngx_config.pch"
NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
fi
# the resource file
@ -148,24 +110,30 @@ NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
CORE_LINK="$NGX_RES $CORE_LINK"
# dynamic modules
#MAIN_LINK="-link -def:$NGX_OBJS/nginx.def"
#MODULE_LINK="-LD $NGX_OBJS/nginx.lib"
ngx_pic_opt=
ngx_objout="-Fo"
ngx_binout="-Fe"
ngx_objext="obj"
ngx_binext=".exe"
ngx_long_start='@<<
if [ "$BMAKE" = nmake ]; then
# MS nmake
ngx_long_start='@<<
'
ngx_long_end='<<'
ngx_long_regex_cont=' \
'
ngx_long_end='<<'
ngx_long_regex_cont=' \
'
ngx_long_cont='
ngx_long_cont='
'
else
# Borland make
ngx_long_start='@&&|
'
ngx_long_end='|'
fi
# MSVC understand / in path
#ngx_regex_dirsep='\\'
#ngx_dirsep="\\"

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ "$NGX_PLATFORM" != win32 ]; then
@ -25,46 +24,61 @@ fi
if [ "$CC" = cl ]; then
NGX_CC_NAME=msvc
echo " + using Microsoft Visual C++ compiler"
if `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
>/dev/null 2>&1`; then
elif [ "$CC" = wcl386 ]; then
NGX_CC_NAME=msvc7
echo " + using Microsoft Visual C++ 7 compiler"
else
NGX_CC_NAME=msvc
echo " + using Microsoft Visual C++ compiler"
fi
else
if [ "$CC" = wcl386 ]; then
NGX_CC_NAME=owc
echo " + using Open Watcom C compiler"
elif [ "$CC" = bcc32 ]; then
else
if [ "$CC" = bcc32 ]; then
NGX_CC_NAME=bcc
echo " + using Borland C++ compiler"
elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
NGX_CC_NAME=icc
echo " + using Intel C++ compiler"
elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
else
if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
NGX_CC_NAME=gcc
echo " + using GNU C compiler"
elif `$CC -v 2>&1 | grep 'clang version' >/dev/null 2>&1`; then
NGX_CC_NAME=clang
echo " + using Clang C compiler"
else
if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
NGX_CC_NAME=icc
echo " + using Intel C++ compiler"
elif `$CC -v 2>&1 | grep 'LLVM version' >/dev/null 2>&1`; then
NGX_CC_NAME=clang
echo " + using Clang C compiler"
elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
else
if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
NGX_CC_NAME=sunc
echo " + using Sun C compiler"
elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
else
if `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
NGX_CC_NAME=ccc
echo " + using Compaq C compiler"
elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
else
if `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
NGX_CC_NAME=acc
echo " + using HP aC++ compiler"
else
NGX_CC_NAME=unknown
fi
fi # acc
fi # ccc
fi # sunc
fi # icc
fi # gcc
fi # bcc
fi # owc
fi # msvc

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Open Watcom C 1.0, 1.2, 1.3
@ -65,14 +64,14 @@ have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
# the precompiled headers
#CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
#NGX_PCH="$NGX_OBJS/ngx_config.pch"
#NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
#NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
NGX_PCH="$NGX_OBJS/ngx_config.pch"
NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
# the link flags, built target is NT GUI mode application
#CORE_LINK="$CORE_LINK -l=nt_win"
CORE_LINK="$CORE_LINK -l=nt_win"
# the resource file
@ -84,20 +83,7 @@ ngx_include_opt="-i="
ngx_objout="-fo"
ngx_binout="-fe="
ngx_objext="obj"
ngx_binext=".exe"
ngx_regex_dirsep='\\'
ngx_dirsep="\\"
ngx_long_start=' '
ngx_long_end=' '
ngx_long_regex_cont=' \&\
'
ngx_long_cont=' &
'
ngx_regex_cont=' \&\
'
ngx_cont=' &
'
ngx_tab=' &
'

View File

@ -1,17 +1,11 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
# Sun C 5.8 2005/10/13 Sun Studio 11
# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
# Sun C 5.9 SunOS_sparc 2007/05/03
# Sun C 5.10 SunOS_i386 2009/06/03 Sun Studio 12.1
# Sun C 5.11 SunOS_i386 2010/08/13 Oracle Solaris Studio 12.2
# Sun C 5.12 SunOS_i386 2011/11/16 Oracle Solaris Studio 12.3
# Sun C 5.13 SunOS_i386 2014/10/20 Oracle Solaris Studio 12.4
# Sun C 5.14 SunOS_i386 2016/05/31 Oracle Developer Studio 12.5
NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
| sed -e 's/^.* Sun C \(.*\)/\1/'`
@ -23,10 +17,7 @@ have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
cat << END > $NGX_AUTOTEST.c
int main(void) {
printf("%d", __SUNPRO_C);
return 0;
}
int main() { printf("%d", __SUNPRO_C); }
END
@ -36,7 +27,7 @@ if [ -x $NGX_AUTOTEST ]; then
ngx_sunc_ver=`$NGX_AUTOTEST`
fi
rm -rf $NGX_AUTOTEST*
rm $NGX_AUTOTEST*
# 1424 == 0x590, Sun Studio 12
@ -54,6 +45,21 @@ fi
case "$NGX_MACHINE" in
i86pc)
ngx_feature="PAUSE hardware capability bug"
ngx_feature_name=
ngx_feature_run=bug
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='__asm ("pause")'
. auto/feature
if [ $ngx_found = yes ]; then
# disable [ PAUSE ] hwcap for Sun Studio 11
CORE_LINK="$CORE_LINK -Msrc/os/unix/ngx_sunpro_x86.map"
fi
NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
;;
@ -63,25 +69,12 @@ case "$NGX_MACHINE" in
esac
MAIN_LINK=
MODULE_LINK="-G"
# optimizations
# 20736 == 0x5100, Sun Studio 12.1
if [ "$ngx_sunc_ver" -ge 20736 ]; then
ngx_fast="-fast"
else
# older versions had problems with bit-fields
ngx_fast="-fast -xalias_level=any"
fi
IPO=-xipo
CFLAGS="$CFLAGS $ngx_fast $IPO"
CORE_LINK="$CORE_LINK $ngx_fast $IPO"
CFLAGS="$CFLAGS -fast $IPO"
CORE_LINK="$CORE_LINK -fast $IPO"
case $CPU in
@ -148,11 +141,15 @@ CFLAGS="$CFLAGS $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="$ngx_fast $IPO $CPU_OPT"
PCRE_OPT="-fast $IPO $CPU_OPT"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-fast $IPO $CPU_OPT"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="$ngx_fast $IPO $CPU_OPT"
ZLIB_OPT="-fast $IPO $CPU_OPT"
fi

63
auto/configure vendored
View File

@ -1,17 +1,15 @@
#!/bin/sh
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
LC_ALL=C
export LC_ALL
NGX_CONFIGURE=`echo $@ | sed 's/"/\\\\"/g'`
. auto/options
. auto/init
. auto/sources
test -d $NGX_OBJS || mkdir -p $NGX_OBJS
test -d $NGX_OBJS || mkdir $NGX_OBJS
echo > $NGX_AUTO_HEADERS_H
echo > $NGX_AUTOCONF_ERR
@ -35,16 +33,9 @@ if test -z "$NGX_PLATFORM"; then
NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE";
case "$NGX_SYSTEM" in
MINGW32_* | MINGW64_* | MSYS_*)
NGX_PLATFORM=win32
;;
esac
else
echo "building for $NGX_PLATFORM"
NGX_SYSTEM=$NGX_PLATFORM
NGX_MACHINE=i386
fi
. auto/cc/conf
@ -56,40 +47,31 @@ fi
. auto/os/conf
if [ "$NGX_PLATFORM" != win32 ]; then
. auto/unix
. auto/os/features
. auto/threads
fi
. auto/threads
. auto/modules
. auto/lib/conf
case ".$NGX_PREFIX" in
.)
NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
;;
. auto/make
. auto/lib/make
. auto/install
.!)
NGX_PREFIX=
;;
*)
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
;;
esac
if [ ".$NGX_CONF_PREFIX" != "." ]; then
have=NGX_CONF_PREFIX value="\"$NGX_CONF_PREFIX/\"" . auto/define
if [ "$NGX_PLATFORM" != win32 ]; then
. auto/unix
fi
# STUB
. auto/stubs
have=NGX_PREFIX value="\"$NGX_PREFIX/\"" . auto/define
have=NGX_SBIN_PATH value="\"$NGX_SBIN_PATH\"" . auto/define
have=NGX_CONF_PATH value="\"$NGX_CONF_PATH\"" . auto/define
have=NGX_PID_PATH value="\"$NGX_PID_PATH\"" . auto/define
have=NGX_LOCK_PATH value="\"$NGX_LOCK_PATH\"" . auto/define
have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define
if [ ".$NGX_ERROR_LOG_PATH" = "." ]; then
have=NGX_ERROR_LOG_STDERR . auto/have
if test -n "$NGX_ERROR_LOG_PATH"; then
have=NGX_ERROR_LOG_PATH value="\"$NGX_ERROR_LOG_PATH\"" . auto/define
fi
have=NGX_HTTP_LOG_PATH value="\"$NGX_HTTP_LOG_PATH\"" . auto/define
@ -99,23 +81,8 @@ have=NGX_HTTP_PROXY_TEMP_PATH value="\"$NGX_HTTP_PROXY_TEMP_PATH\""
. auto/define
have=NGX_HTTP_FASTCGI_TEMP_PATH value="\"$NGX_HTTP_FASTCGI_TEMP_PATH\""
. auto/define
have=NGX_HTTP_UWSGI_TEMP_PATH value="\"$NGX_HTTP_UWSGI_TEMP_PATH\""
. auto/define
have=NGX_HTTP_SCGI_TEMP_PATH value="\"$NGX_HTTP_SCGI_TEMP_PATH\""
. auto/define
. auto/make
. auto/lib/make
. auto/install
# STUB
. auto/stubs
have=NGX_USER value="\"$NGX_USER\"" . auto/define
have=NGX_GROUP value="\"$NGX_GROUP\"" . auto/define
if [ ".$NGX_BUILD" != "." ]; then
have=NGX_BUILD value="\"$NGX_BUILD\"" . auto/define
fi
. auto/summary

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,21 +1,15 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for system byte ordering ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for system byte ordering
END
echo $ngx_n "checking for system endianess ...$ngx_c"
echo >> $NGX_ERR
echo "checking for system endianess" >> $NGX_ERR
cat << END > $NGX_AUTOTEST.c
int main(void) {
int main() {
int i = 0x11223344;
char *p;
@ -33,18 +27,18 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
if $NGX_AUTOTEST >/dev/null 2>&1; then
echo " little endian"
echo " little endianess"
have=NGX_HAVE_LITTLE_ENDIAN . auto/have
else
echo " big endian"
echo " big endianess"
fi
rm -rf $NGX_AUTOTEST*
rm $NGX_AUTOTEST*
else
rm -rf $NGX_AUTOTEST*
rm $NGX_AUTOTEST*
echo
echo "$0: error: cannot detect system byte ordering"
echo "$0: error: can not detect system endianess"
exit 1
fi

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_feature ...$ngx_c"
@ -20,9 +19,7 @@ if test -n "$ngx_feature_name"; then
fi
if test -n "$ngx_feature_path"; then
for ngx_temp in $ngx_feature_path; do
ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
done
ngx_feature_inc_path="-I $ngx_feature_path"
fi
cat << END > $NGX_AUTOTEST.c
@ -31,7 +28,7 @@ cat << END > $NGX_AUTOTEST.c
$NGX_INCLUDE_UNISTD_H
$ngx_feature_incs
int main(void) {
int main() {
$ngx_feature_test;
return 0;
}
@ -40,7 +37,7 @@ END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
ngx_feature_inc_path=
@ -53,7 +50,7 @@ if [ -x $NGX_AUTOTEST ]; then
yes)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
if /bin/sh -c $NGX_AUTOTEST >/dev/null 2>&1; then
echo " found"
ngx_found=yes
@ -66,27 +63,9 @@ if [ -x $NGX_AUTOTEST ]; then
fi
;;
value)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
echo " found"
ngx_found=yes
cat << END >> $NGX_AUTO_CONFIG_H
#ifndef $ngx_feature_name
#define $ngx_feature_name `$NGX_AUTOTEST`
#endif
END
else
echo " found but is not working"
fi
;;
bug)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
if /bin/sh -c $NGX_AUTOTEST >/dev/null 2>&1; then
echo " not found"
else
@ -120,4 +99,4 @@ else
echo "----------" >> $NGX_AUTOCONF_ERR
fi
rm -rf $NGX_AUTOTEST*
rm $NGX_AUTOTEST*

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_HEADERS_H

View File

@ -1,13 +1,10 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_include="unistd.h"; . auto/include
ngx_include="inttypes.h"; . auto/include
ngx_include="limits.h"; . auto/include
ngx_include="sys/filio.h"; . auto/include
ngx_include="sys/param.h"; . auto/include
ngx_include="sys/mount.h"; . auto/include
ngx_include="sys/statvfs.h"; . auto/include
ngx_include="crypt.h"; . auto/include
ngx_include="unistd.h"; . auto/include
ngx_include="inttypes.h"; . auto/include
ngx_include="limits.h"; . auto/include
ngx_include="sys/filio.h"; . auto/include
ngx_include="crypt.h"; . auto/include
ngx_include="malloc.h"; . auto/include

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_include ...$ngx_c"
@ -17,10 +16,9 @@ ngx_found=no
cat << END > $NGX_AUTOTEST.c
$NGX_INCLUDE_SYS_PARAM_H
#include <$ngx_include>
int main(void) {
int main() {
return 0;
}
@ -45,6 +43,9 @@ if [ -x $NGX_AUTOTEST ]; then
eval "NGX_INCLUDE_$ngx_name='#include <$ngx_include>'"
#STUB
eval "NGX_$ngx_name='#include <$ngx_include>'"
else
echo " not found"
@ -55,4 +56,4 @@ else
echo "----------" >> $NGX_AUTOCONF_ERR
fi
rm -rf $NGX_AUTOTEST*
rm $NGX_AUTOTEST*

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_MAKEFILE=$NGX_OBJS/Makefile
@ -44,10 +43,36 @@ fi
cat << END > Makefile
default: build
build:
\$(MAKE) -f $NGX_MAKEFILE
install:
\$(MAKE) -f $NGX_MAKEFILE install
clean:
rm -rf Makefile $NGX_OBJS
.PHONY: default clean
upgrade:
$NGX_SBIN_PATH -t
kill -USR2 \`cat $NGX_PID_PATH\`
sleep 1
test -f $NGX_PID_PATH.oldbin
kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
upgrade1:
# upgrade 0.1.x to 0.2+
$NGX_SBIN_PATH -t
cp $NGX_PID_PATH $NGX_PID_PATH.oldbin
kill -USR2 \`cat $NGX_PID_PATH\`
sleep 1
test -f $NGX_PID_PATH.oldbin
cp $NGX_PID_PATH $NGX_PID_PATH.newbin
kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
END

View File

@ -1,14 +1,13 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $USE_PERL != NO ]; then
if [ $USE_PERL = YES ]; then
cat << END >> $NGX_MAKEFILE
install_perl_modules:
cd $NGX_OBJS/src/http/modules/perl && \$(MAKE) install
cd $NGX_OBJS/src/http/modules/perl && make install
END
NGX_INSTALL_PERL_MODULES=install_perl_modules
@ -16,205 +15,46 @@ END
fi
case ".$NGX_SBIN_PATH" in
./*)
;;
*)
NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH
;;
esac
case ".$NGX_MODULES_PATH" in
./*)
;;
*)
NGX_MODULES_PATH=$NGX_PREFIX/$NGX_MODULES_PATH
;;
esac
NGX_MODULES_PATH=`dirname $NGX_MODULES_PATH/.`
case ".$NGX_CONF_PATH" in
./*)
;;
*)
NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH
;;
esac
NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
case ".$NGX_PID_PATH" in
./*)
;;
*)
NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH
;;
esac
case ".$NGX_ERROR_LOG_PATH" in
./* | .)
;;
*)
NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH
;;
esac
case ".$NGX_HTTP_LOG_PATH" in
./*)
;;
*)
NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH
;;
esac
if test -f man/nginx.8 ; then
NGX_MAN=man/nginx.8
else
NGX_MAN=docs/man/nginx.8
fi
if test -d html ; then
NGX_HTML=html
else
NGX_HTML=docs/html
fi
cat << END >> $NGX_MAKEFILE
manpage: $NGX_OBJS/nginx.8
install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
$NGX_INSTALL_PERL_MODULES
test -d '$NGX_PREFIX' || mkdir -p '$NGX_PREFIX'
$NGX_OBJS/nginx.8: $NGX_MAN $NGX_AUTO_CONFIG_H
sed -e "s|%%PREFIX%%|$NGX_PREFIX|" \\
-e "s|%%PID_PATH%%|$NGX_PID_PATH|" \\
-e "s|%%CONF_PATH%%|$NGX_CONF_PATH|" \\
-e "s|%%ERROR_LOG_PATH%%|${NGX_ERROR_LOG_PATH:-stderr}|" \\
< $NGX_MAN > \$@
test -d '`dirname "$NGX_SBIN_PATH"`' \
|| mkdir -p '`dirname "$NGX_SBIN_PATH"`'
test ! -f '$NGX_SBIN_PATH' || mv '$NGX_SBIN_PATH' '$NGX_SBIN_PATH.old'
cp $NGX_OBJS/nginx '$NGX_SBIN_PATH'
install: build $NGX_INSTALL_PERL_MODULES
test -d '\$(DESTDIR)$NGX_PREFIX' || mkdir -p '\$(DESTDIR)$NGX_PREFIX'
test -d '`dirname "$NGX_CONF_PATH"`' \
|| mkdir -p '`dirname "$NGX_CONF_PATH"`'
test -d '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`' \\
|| mkdir -p '\$(DESTDIR)`dirname "$NGX_SBIN_PATH"`'
test ! -f '\$(DESTDIR)$NGX_SBIN_PATH' \\
|| mv '\$(DESTDIR)$NGX_SBIN_PATH' \\
'\$(DESTDIR)$NGX_SBIN_PATH.old'
cp $NGX_OBJS/nginx '\$(DESTDIR)$NGX_SBIN_PATH'
cp conf/koi-win '`dirname "$NGX_CONF_PATH"`'
cp conf/koi-utf '`dirname "$NGX_CONF_PATH"`'
cp conf/win-utf '`dirname "$NGX_CONF_PATH"`'
test -d '\$(DESTDIR)$NGX_CONF_PREFIX' \\
|| mkdir -p '\$(DESTDIR)$NGX_CONF_PREFIX'
test -f '`dirname "$NGX_CONF_PATH"`/mime.types' || \
cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types'
cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types.default'
cp conf/koi-win '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/koi-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/win-utf '\$(DESTDIR)$NGX_CONF_PREFIX'
test -f '$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_CONF_PATH'
cp conf/nginx.conf '`dirname "$NGX_CONF_PATH"`/nginx.conf.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types' \\
|| cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/mime.types '\$(DESTDIR)$NGX_CONF_PREFIX/mime.types.default'
test -d '`dirname "$NGX_PID_PATH"`' \
|| mkdir -p '`dirname "$NGX_PID_PATH"`'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params' \\
|| cp conf/fastcgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/fastcgi_params \\
'\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi_params.default'
test -d '`dirname "$NGX_HTTP_LOG_PATH"`' || \
mkdir -p '`dirname "$NGX_HTTP_LOG_PATH"`'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf' \\
|| cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/fastcgi.conf '\$(DESTDIR)$NGX_CONF_PREFIX/fastcgi.conf.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params' \\
|| cp conf/uwsgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/uwsgi_params \\
'\$(DESTDIR)$NGX_CONF_PREFIX/uwsgi_params.default'
test -f '\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params' \\
|| cp conf/scgi_params '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/scgi_params \\
'\$(DESTDIR)$NGX_CONF_PREFIX/scgi_params.default'
test -f '\$(DESTDIR)$NGX_CONF_PATH' \\
|| cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PATH'
cp conf/nginx.conf '\$(DESTDIR)$NGX_CONF_PREFIX/nginx.conf.default'
test -d '\$(DESTDIR)`dirname "$NGX_PID_PATH"`' \\
|| mkdir -p '\$(DESTDIR)`dirname "$NGX_PID_PATH"`'
test -d '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`' \\
|| mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
test -d '\$(DESTDIR)$NGX_PREFIX/html' \\
|| cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'
test -d '$NGX_PREFIX/html' || cp -r html '$NGX_PREFIX'
END
if test -n "$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' \\
|| mkdir -p '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`'
test -d '`dirname "$NGX_ERROR_LOG_PATH"`' || \
mkdir -p '`dirname "$NGX_ERROR_LOG_PATH"`'
END
fi
if test -n "$DYNAMIC_MODULES"; then
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)$NGX_MODULES_PATH' \\
|| mkdir -p '\$(DESTDIR)$NGX_MODULES_PATH'
END
fi
for ngx_module in $DYNAMIC_MODULES
do
ngx_module=$ngx_module$ngx_modext
cat << END >> $NGX_MAKEFILE
test ! -f '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' \\
|| mv '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module' \\
'\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module.old'
cp $NGX_OBJS/$ngx_module '\$(DESTDIR)$NGX_MODULES_PATH/$ngx_module'
END
done
# create Makefile
cat << END >> Makefile
build:
\$(MAKE) -f $NGX_MAKEFILE
install:
\$(MAKE) -f $NGX_MAKEFILE install
modules:
\$(MAKE) -f $NGX_MAKEFILE modules
upgrade:
$NGX_SBIN_PATH -t
kill -USR2 \`cat $NGX_PID_PATH\`
sleep 1
test -f $NGX_PID_PATH.oldbin
kill -QUIT \`cat $NGX_PID_PATH.oldbin\`
.PHONY: build install modules upgrade
END

View File

@ -1,54 +1,44 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $USE_PCRE = YES -o $PCRE != NONE ]; then
. auto/lib/pcre/conf
else
if [ $USE_PCRE = DISABLED -a $HTTP = YES -a $HTTP_REWRITE = YES ]; then
cat << END
$0: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option or you have to enable the PCRE support.
END
exit 1
fi
fi
if [ $USE_OPENSSL = YES ]; then
. auto/lib/openssl/conf
fi
if [ $USE_MD5 = YES ]; then
if [ $OPENSSL != NONE -a $OPENSSL != NO ]; then
have=NGX_HAVE_OPENSSL_MD5_H . auto/have
have=NGX_OPENSSL_MD5 . auto/have
MD5=YES
else
. auto/lib/md5/conf
fi
fi
if [ $USE_SHA1 = YES ]; then
if [ $OPENSSL != NONE -a $OPENSSL != NO ]; then
have=NGX_HAVE_OPENSSL_SHA1_H . auto/have
SHA1=YES
else
. auto/lib/sha1/conf
fi
fi
if [ $USE_ZLIB = YES ]; then
. auto/lib/zlib/conf
fi
if [ $USE_LIBXSLT != NO ]; then
. auto/lib/libxslt/conf
fi
if [ $USE_LIBGD != NO ]; then
. auto/lib/libgd/conf
fi
if [ $USE_PERL != NO ]; then
if [ $USE_PERL = YES ]; then
. auto/lib/perl/conf
fi
if [ $USE_GEOIP != NO ]; then
. auto/lib/geoip/conf
fi
if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then
. auto/lib/google-perftools/conf
fi
if [ $NGX_LIBATOMIC != NO ]; then
. auto/lib/libatomic/conf
fi

View File

@ -1,97 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="GeoIP library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <GeoIP.h>"
ngx_feature_path=
ngx_feature_libs="-lGeoIP"
ngx_feature_test="GeoIP_open(NULL, 0)"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD port
ngx_feature="GeoIP library in /usr/local/"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lGeoIP"
else
ngx_feature_libs="-L/usr/local/lib -lGeoIP"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD port
ngx_feature="GeoIP library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lGeoIP"
else
ngx_feature_libs="-L/usr/pkg/lib -lGeoIP"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="GeoIP library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lGeoIP"
else
ngx_feature_libs="-L/opt/local/lib -lGeoIP"
fi
. auto/feature
fi
if [ $ngx_found = yes ]; then
CORE_INCS="$CORE_INCS $ngx_feature_path"
if [ $USE_GEOIP = YES ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
fi
NGX_LIB_GEOIP=$ngx_feature_libs
ngx_feature="GeoIP IPv6 support"
ngx_feature_name="NGX_HAVE_GEOIP_V6"
ngx_feature_run=no
ngx_feature_incs="#include <stdio.h>
#include <GeoIP.h>"
#ngx_feature_path=
#ngx_feature_libs=
ngx_feature_test="printf(\"%d\", GEOIP_CITY_EDITION_REV0_V6);"
. auto/feature
else
cat << END
$0: error: the GeoIP module requires the GeoIP library.
You can either do not enable the module or install the library.
END
exit 1
fi

View File

@ -1,62 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="Google perftools"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs="-lprofiler"
ngx_feature_test="void ProfilerStop(void);
ProfilerStop()"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD port
ngx_feature="Google perftools in /usr/local/"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lprofiler"
else
ngx_feature_libs="-L/usr/local/lib -lprofiler"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="Google perftools in /opt/local/"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lprofiler"
else
ngx_feature_libs="-L/opt/local/lib -lprofiler"
fi
. auto/feature
fi
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
else
cat << END
$0: error: the Google perftools module requires the Google perftools
library. You can either do not enable the module or install the library.
END
exit 1
fi

View File

@ -1,43 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $NGX_LIBATOMIC != YES ]; then
have=NGX_HAVE_LIBATOMIC . auto/have
CORE_INCS="$CORE_INCS $NGX_LIBATOMIC/src"
LINK_DEPS="$LINK_DEPS $NGX_LIBATOMIC/src/libatomic_ops.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBATOMIC/src/libatomic_ops.a"
else
ngx_feature="atomic_ops library"
ngx_feature_name=NGX_HAVE_LIBATOMIC
ngx_feature_run=yes
ngx_feature_incs="#define AO_REQUIRE_CAS
#include <atomic_ops.h>"
ngx_feature_path=
ngx_feature_libs="-latomic_ops"
ngx_feature_test="long n = 0;
if (!AO_compare_and_swap(&n, 0, 1))
return 1;
if (AO_fetch_and_add(&n, 1) != 1)
return 1;
if (n != 2)
return 1;
AO_nop();"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
else
cat << END
$0: error: libatomic_ops library was not found.
END
exit 1
fi
fi

View File

@ -1,16 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_MAKEFILE
$NGX_LIBATOMIC/src/libatomic_ops.a: $NGX_LIBATOMIC/Makefile
cd $NGX_LIBATOMIC && \$(MAKE)
$NGX_LIBATOMIC/Makefile: $NGX_MAKEFILE
cd $NGX_LIBATOMIC \\
&& if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
&& ./configure
END

View File

@ -1,95 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="GD library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <gd.h>"
ngx_feature_path=
ngx_feature_libs="-lgd"
ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
(void) img"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD port
ngx_feature="GD library in /usr/local/"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lgd"
else
ngx_feature_libs="-L/usr/local/lib -lgd"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD port
ngx_feature="GD library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lgd"
else
ngx_feature_libs="-L/usr/pkg/lib -lgd"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="GD library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lgd"
else
ngx_feature_libs="-L/opt/local/lib -lgd"
fi
. auto/feature
fi
if [ $ngx_found = yes ]; then
CORE_INCS="$CORE_INCS $ngx_feature_path"
if [ $USE_LIBGD = YES ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
fi
NGX_LIB_LIBGD=$ngx_feature_libs
ngx_feature="GD WebP support"
ngx_feature_name="NGX_HAVE_GD_WEBP"
ngx_feature_test="gdImagePtr img = gdImageCreateFromWebpPtr(1, NULL);
(void) img"
. auto/feature
else
cat << END
$0: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
END
exit 1
fi

View File

@ -1,165 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="libxslt"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>"
ngx_feature_path="/usr/include/libxml2"
ngx_feature_libs="-lxml2 -lxslt"
ngx_feature_test="xmlParserCtxtPtr ctxt = NULL;
xsltStylesheetPtr sheet = NULL;
xmlDocPtr doc = NULL;
xmlParseChunk(ctxt, NULL, 0, 0);
xsltApplyStylesheet(sheet, doc, NULL);"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD port
ngx_feature="libxslt in /usr/local/"
ngx_feature_path="/usr/local/include/libxml2 /usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lxml2 -lxslt"
else
ngx_feature_libs="-L/usr/local/lib -lxml2 -lxslt"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD port
ngx_feature="libxslt in /usr/pkg/"
ngx_feature_path="/usr/pkg/include/libxml2 /usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lxml2 -lxslt"
else
ngx_feature_libs="-L/usr/pkg/lib -lxml2 -lxslt"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="libxslt in /opt/local/"
ngx_feature_path="/opt/local/include/libxml2 /opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lxml2 -lxslt"
else
ngx_feature_libs="-L/opt/local/lib -lxml2 -lxslt"
fi
. auto/feature
fi
if [ $ngx_found = yes ]; then
CORE_INCS="$CORE_INCS $ngx_feature_path"
if [ $USE_LIBXSLT = YES ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
fi
NGX_LIB_LIBXSLT=$ngx_feature_libs
else
cat << END
$0: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.
END
exit 1
fi
ngx_feature="libexslt"
ngx_feature_name=NGX_HAVE_EXSLT
ngx_feature_run=no
ngx_feature_incs="#include <libexslt/exslt.h>"
ngx_feature_path="/usr/include/libxml2"
ngx_feature_libs="-lexslt"
ngx_feature_test="exsltRegisterAll();"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD port
ngx_feature="libexslt in /usr/local/"
ngx_feature_path="/usr/local/include/libxml2 /usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lexslt"
else
ngx_feature_libs="-L/usr/local/lib -lexslt"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD port
ngx_feature="libexslt in /usr/pkg/"
ngx_feature_path="/usr/pkg/include/libxml2 /usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lexslt"
else
ngx_feature_libs="-L/usr/pkg/lib -lexslt"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="libexslt in /opt/local/"
ngx_feature_path="/opt/local/include/libxml2 /opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lexslt"
else
ngx_feature_libs="-L/opt/local/lib -lexslt"
fi
. auto/feature
fi
if [ $ngx_found = yes ]; then
if [ $USE_LIBXSLT = YES ]; then
CORE_LIBS="$CORE_LIBS -lexslt"
fi
NGX_LIB_LIBXSLT="$NGX_LIB_LIBXSLT -lexslt"
fi

View File

@ -1,12 +1,19 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then
. auto/lib/pcre/make
fi
if [ $MD5 != NONE -a $MD5 != NO -a $MD5 != YES ]; then
. auto/lib/md5/make
fi
if [ $SHA1 != NONE -a $SHA1 != NO -a $SHA1 != YES ]; then
. auto/lib/sha1/make
fi
if [ $OPENSSL != NONE -a $OPENSSL != NO -a $OPENSSL != YES ]; then
. auto/lib/openssl/make
fi
@ -15,10 +22,6 @@ if [ $ZLIB != NONE -a $ZLIB != NO -a $ZLIB != YES ]; then
. auto/lib/zlib/make
fi
if [ $NGX_LIBATOMIC != NO -a $NGX_LIBATOMIC != YES ]; then
. auto/lib/libatomic/make
fi
if [ $USE_PERL != NO ]; then
if [ $USE_PERL = YES ]; then
. auto/lib/perl/make
fi

112
auto/lib/md5/conf Normal file
View File

@ -0,0 +1,112 @@
# Copyright (C) Igor Sysoev
if [ $MD5 != NONE ]; then
if grep MD5_Init $MD5/md5.h >/dev/null; then
# OpenSSL md5
OPENSSL_MD5=YES
have=NGX_HAVE_OPENSSL_MD5 . auto/have
have=NGX_OPENSSL_MD5 . auto/have
else
# rsaref md5
OPENSSL_MD5=NO
fi
CORE_INCS="$CORE_INCS $MD5"
case "$NGX_CC_NAME" in
msvc* | owc* | bcc)
LINK_DEPS="$LINK_DEPS $MD5/md5.lib"
CORE_LIBS="$CORE_LIBS $MD5/md5.lib"
;;
icc*)
LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
# to allow -ipo optimization we link with the *.o but not library
CORE_LIBS="$CORE_LIBS $MD5/md5_dgst.o"
if [ $MD5_ASM = YES ]; then
CORE_LIBS="$CORE_LIBS $MD5/asm/mx86-elf.o"
fi
;;
*)
LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
CORE_LIBS="$CORE_LIBS $MD5/libmd5.a"
#CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5"
;;
esac
else
if [ "$NGX_PLATFORM" != win32 ]; then
MD5=NO
# Solaris 8/9
ngx_feature="rsaref md5 library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <md5.h>"
ngx_feature_path=
ngx_feature_libs="-lmd5"
ngx_feature_test="MD5_CTX md5; MD5Init(&md5)"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
MD5=YES
MD5_LIB=md5
ngx_found=no
else
# FreeBSD
ngx_feature="rsaref md library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <md5.h>"
ngx_feature_path=
ngx_feature_libs="-lmd"
ngx_feature_test="MD5_CTX md5; MD5Init(&md5)"
. auto/feature
fi
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
MD5=YES
MD5_LIB=md
ngx_found=no
else
if [ $MD5 = NO ]; then
# OpenSSL crypto library
ngx_feature="OpenSSL md5 crypto library"
ngx_feature_name="NGX_OPENSSL_MD5"
ngx_feature_run=no
ngx_feature_incs="#include <openssl/md5.h>"
ngx_feature_path=
ngx_feature_libs="-lcrypto"
ngx_feature_test="MD5_CTX md5; MD5_Init(&md5)"
. auto/feature
fi
fi
if [ $ngx_found = yes ]; then
have=NGX_HAVE_OPENSSL_MD5_H . auto/have
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
MD5=YES
MD5_LIB=crypto
fi
fi
fi

96
auto/lib/md5/make Normal file
View File

@ -0,0 +1,96 @@
# Copyright (C) Igor Sysoev
case "$NGX_CC_NAME" in
msvc*)
ngx_makefile=makefile.msvc
ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC MD5_ASM=$MD5_ASM"
;;
owc*)
ngx_makefile=makefile.owc
ngx_opt="CPU_OPT=\"$CPU_OPT\""
;;
bcc)
ngx_makefile=makefile.bcc
ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DMD5_ASM=$MD5_ASM"
;;
esac
done=NO
case "$NGX_PLATFORM" in
win32)
cp auto/lib/md5/$ngx_makefile $MD5
cat << END >> $NGX_MAKEFILE
`echo "$MD5/md5.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
cd `echo $MD5 | sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f $ngx_makefile $ngx_opt
cd ..\\..\\..
END
done=YES
;;
SunOS:*:i86pc)
if [ $MD5_ASM = YES ]; then
cat << END >> $NGX_MAKEFILE
$MD5/libmd5.a: $NGX_MAKEFILE
cd $MD5 \\
&& \$(MAKE) CFLAGS="$MD5_OPT -DSOL -DMD5_ASM -DL_ENDIAN" \\
CC="\$(CC)" CPP="\$(CPP)" \\
MD5_ASM_OBJ=asm/mx86-sol.o clean libmd5.a
END
done=YES
fi
;;
# FreeBSD: i386
# Linux: i686
*:i386 | *:i686)
if [ $MD5_ASM = YES ]; then
cat << END >> $NGX_MAKEFILE
$MD5/libmd5.a: $NGX_MAKEFILE
cd $MD5 \\
&& \$(MAKE) CFLAGS="$MD5_OPT -DELF -DMD5_ASM -DL_ENDIAN" \\
CC="\$(CC)" CPP="\$(CPP)" \\
MD5_ASM_OBJ=asm/mx86-elf.o clean libmd5.a
END
done=YES
fi
;;
esac
if [ $done = NO ]; then
cat << END >> $NGX_MAKEFILE
$MD5/libmd5.a: $NGX_MAKEFILE
cd $MD5 \\
&& \$(MAKE) CFLAGS="$MD5_OPT" \\
CC="\$(CC)" MD5_ASM_OBJ= clean libmd5.a
END
fi

19
auto/lib/md5/makefile.bcc Normal file
View File

@ -0,0 +1,19 @@
# Copyright (C) Igor Sysoev
CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
!if "$(MD5_ASM)" == "YES"
md5.lib:
bcc32 -c $(CFLAGS) -DMD5_ASM md5_dgst.c
tlib md5.lib +md5_dgst.obj +"asm\m-win32.obj"
!else
md5.lib:
bcc32 -c $(CFLAGS) md5_dgst.c
tlib md5.lib +md5_dgst.obj
!endif

View File

@ -0,0 +1,19 @@
# Copyright (C) Igor Sysoev
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
!IF "$(MD5_ASM)" == "YES"
md5.lib:
cl -c $(CFLAGS) -D MD5_ASM md5_dgst.c
link -lib -out:md5.lib md5_dgst.obj asm/m-win32.obj
!ELSE
md5.lib:
cl -c $(CFLAGS) md5_dgst.c
link -lib -out:md5.lib md5_dgst.obj
!ENDIF

View File

@ -0,0 +1,9 @@
# Copyright (C) Igor Sysoev
CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
md5.lib:
wcl386 -c $(CFLAGS) -dL_ENDIAN md5_dgst.c
wlib -n md5.lib md5_dgst.obj

View File

@ -1,173 +1,70 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $OPENSSL != NONE ]; then
have=NGX_OPENSSL . auto/have
have=NGX_SSL . auto/have
if [ $USE_OPENSSL_QUIC = YES ]; then
have=NGX_QUIC . auto/have
have=NGX_QUIC_OPENSSL_COMPAT . auto/have
fi
CORE_INCS="$CORE_INCS $OPENSSL/include"
case "$CC" in
cl | bcc32)
CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
if [ -f $OPENSSL/ms/do_ms.bat ]; then
# before OpenSSL 1.1.0
CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
else
# OpenSSL 1.1.0+
CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
fi
# libeay32.lib requires gdi32.lib
CORE_LIBS="$CORE_LIBS gdi32.lib"
# OpenSSL 1.0.0 requires crypt32.lib
CORE_LIBS="$CORE_LIBS crypt32.lib"
;;
*)
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
if [ "$NGX_PLATFORM" = win32 ]; then
CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
fi
have=NGX_OPENSSL . auto/have
have=NGX_SSL . auto/have
LINK_DEPS="$LINK_DEPS $OPENSSL/libssl.a $OPENSSL/libcrypto.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/libssl.a $OPENSSL/libcrypto.a"
;;
esac
case "$NGX_SYSTEM" in
SunOS|Linux)
CORE_LIBS="$CORE_LIBS -ldl"
;;
esac
else
if [ "$NGX_PLATFORM" != win32 ]; then
case "$NGX_PLATFORM" in
OPENSSL=NO
ngx_feature="OpenSSL library"
ngx_feature_name="NGX_OPENSSL"
ngx_feature_run=no
ngx_feature_incs="#include <openssl/ssl.h>"
ngx_feature_path=
ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD"
ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
. auto/feature
if [ $ngx_found = no ]; then
# FreeBSD port
ngx_feature="OpenSSL library in /usr/local/"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
else
ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
fi
ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD port
ngx_feature="OpenSSL library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
else
ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
fi
ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="OpenSSL library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
else
ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
fi
ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
. auto/feature
fi
if [ $ngx_found = yes ]; then
win32)
have=NGX_OPENSSL . auto/have
have=NGX_SSL . auto/have
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
OPENSSL=YES
if [ $USE_OPENSSL_QUIC = YES ]; then
CORE_INCS="$CORE_INCS c:/openssl/include"
CORE_LIBS="$CORE_LIBS c:/openssl/ssleay32.lib"
CORE_LIBS="$CORE_LIBS c:/openssl/libeay32.lib"
ngx_feature="OpenSSL QUIC support"
ngx_feature_name="NGX_QUIC"
ngx_feature_test="SSL_set_quic_method(NULL, NULL)"
. auto/feature
# libeay32.lib requires gdi32.lib
CORE_LIBS="$CORE_LIBS gdi32.lib"
# OpenSSL 0.8's libeay32.lib requires advapi32.lib
CORE_LIBS="$CORE_LIBS advapi32.lib"
;;
if [ $ngx_found = no ]; then
have=NGX_QUIC_OPENSSL_COMPAT . auto/have
*)
OPENSSL=NO
ngx_feature="OpenSSL QUIC compatibility"
ngx_feature_test="SSL_CTX_add_custom_ext(NULL, 0, 0,
NULL, NULL, NULL, NULL, NULL)"
. auto/feature
fi
ngx_feature="OpenSSL library"
ngx_feature_name="NGX_OPENSSL"
ngx_feature_run=no
ngx_feature_incs="#include <openssl/ssl.h>"
ngx_feature_path=
ngx_feature_libs="-lssl -lcrypto"
ngx_feature_test="SSL_library_init()"
. auto/feature
if [ $ngx_found = no ]; then
cat << END
if [ $ngx_found = yes ]; then
have=NGX_SSL . auto/have
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
OPENSSL=YES
$0: error: certain modules require OpenSSL QUIC support.
You can either do not enable the modules, or install the OpenSSL library with
QUIC support into the system, or build the OpenSSL library with QUIC support
statically from the source with nginx by using --with-openssl=<path> option.
END
exit 1
fi
case "$NGX_SYSTEM" in
SunOS)
CORE_LIBS="$CORE_LIBS -ldl"
;;
esac
fi
fi
fi
;;
if [ $OPENSSL != YES ]; then
cat << END
$0: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
END
exit 1
fi
esac
fi

View File

@ -1,72 +1,27 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$CC" in
if test -n "$OPENSSL_OPT"; then
NGX_OPENSSL_CONFIG="./Configure \"$OPENSSL_OPT\""
else
NGX_OPENSSL_CONFIG="./config"
fi
cl)
case "$NGX_MACHINE" in
amd64)
OPENSSL_TARGET=VC-WIN64A
;;
*)
OPENSSL_TARGET=VC-WIN32
;;
esac
cat << END >> $NGX_MAKEFILE
$OPENSSL/openssl/include/openssl/ssl.h: $NGX_MAKEFILE
\$(MAKE) -f auto/lib/openssl/makefile.msvc \
OPENSSL="$OPENSSL" OPENSSL_OPT="$OPENSSL_OPT" \
OPENSSL_TARGET="$OPENSSL_TARGET"
END
;;
bcc32)
ngx_opt=`echo "-DOPENSSL=\"$OPENSSL\" -DOPENSSL_OPT=\"$OPENSSL_OPT\"" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
`echo "$OPENSSL\\openssl\\lib\\libeay32.lib: \
$OPENSSL\\openssl\\include\\openssl\\ssl.h" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
`echo "$OPENSSL\\openssl\\lib\\ssleay32.lib: \
$OPENSSL\\openssl\\include\\openssl\\ssl.h" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
`echo "$OPENSSL\\openssl\\include\\openssl\\ssl.h: $NGX_MAKEFILE" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f auto/lib/openssl/makefile.bcc $ngx_opt
END
;;
case $USE_THREADS in
NO) NGX_OPENSSL_CONFIG="$NGX_OPENSSL_CONFIG no-threads" ;;
*) NGX_OPENSSL_CONFIG="$NGX_OPENSSL_CONFIG threads" ;;
esac
case "$NGX_PLATFORM" in
*)
case $OPENSSL in
/*) ngx_prefix="$OPENSSL/.openssl" ;;
*) ngx_prefix="$PWD/$OPENSSL/.openssl" ;;
esac
cat << END >> $NGX_MAKEFILE
$OPENSSL/.openssl/include/openssl/ssl.h: $NGX_MAKEFILE
$OPENSSL/libssl.a:
cd $OPENSSL \\
&& if [ -f Makefile ]; then \$(MAKE) clean; fi \\
&& ./config --prefix=$ngx_prefix no-shared no-threads $OPENSSL_OPT \\
&& \$(MAKE) \\
&& \$(MAKE) install_sw LIBDIR=lib
&& \$(MAKE) clean \\
&& $NGX_OPENSSL_CONFIG no-shared \\
&& \$(MAKE)
END

View File

@ -1,18 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
all:
cd $(OPENSSL)
perl Configure BC-32 no-shared --prefix=openssl $(OPENSSL_OPT)
ms\do_nasm
$(MAKE) -f ms\bcb.mak
$(MAKE) -f ms\bcb.mak install
# Borland's make does not expand "[ch]" in
# copy "inc32\openssl\*.[ch]" "openssl\include\openssl"
copy inc32\openssl\*.h openssl\include\openssl

View File

@ -1,21 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
all:
cd $(OPENSSL)
perl Configure $(OPENSSL_TARGET) no-shared no-threads \
--prefix="%cd%/openssl" \
--openssldir="%cd%/openssl/ssl" \
$(OPENSSL_OPT)
if exist ms\do_ms.bat ( \
ms\do_ms \
&& $(MAKE) -f ms\nt.mak \
&& $(MAKE) -f ms\nt.mak install \
) else ( \
$(MAKE) \
&& $(MAKE) install_sw \
)

View File

@ -1,116 +1,90 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $PCRE != NONE ]; then
CORE_INCS="$CORE_INCS $PCRE"
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
if [ -f $PCRE/src/pcre2.h.generic ]; then
case "$NGX_CC_NAME" in
PCRE_LIBRARY=PCRE2
have=NGX_PCRE . auto/have
have=NGX_PCRE2 . auto/have
if [ "$NGX_PLATFORM" = win32 ]; then
have=PCRE2_STATIC . auto/have
fi
CORE_INCS="$CORE_INCS $PCRE/src/"
CORE_DEPS="$CORE_DEPS $PCRE/src/pcre2.h"
case "$NGX_CC_NAME" in
msvc)
LINK_DEPS="$LINK_DEPS $PCRE/src/pcre2-8.lib"
CORE_LIBS="$CORE_LIBS $PCRE/src/pcre2-8.lib"
;;
*)
LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre2-8.a"
CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre2-8.a"
;;
esac
else
PCRE_LIBRARY=PCRE
have=NGX_PCRE . auto/have
if [ "$NGX_PLATFORM" = win32 ]; then
msvc* | owc* | bcc)
have=NGX_PCRE . auto/have
have=PCRE_STATIC . auto/have
fi
CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
LINK_DEPS="$LINK_DEPS $PCRE/pcre.lib"
CORE_LIBS="$CORE_LIBS $PCRE/pcre.lib"
;;
CORE_INCS="$CORE_INCS $PCRE"
CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
icc* )
have=NGX_PCRE . auto/have
CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
case "$NGX_CC_NAME" in
LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
msvc | owc | bcc)
LINK_DEPS="$LINK_DEPS $PCRE/pcre.lib"
CORE_LIBS="$CORE_LIBS $PCRE/pcre.lib"
;;
echo $ngx_n "checking for PCRE library ...$ngx_c"
*)
LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
;;
if [ -f $PCRE/pcre.h ]; then
ngx_pcre_ver=`grep PCRE_MAJOR $PCRE/pcre.h \
| sed -e 's/^.*PCRE_MAJOR.* \(.*\)$/\1/'`
esac
fi
else if [ -f $PCRE/configure.in ]; then
ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
| sed -e 's/^.*=\(.*\)$/\1/'`
if [ $PCRE_JIT = YES ]; then
have=NGX_HAVE_PCRE_JIT . auto/have
PCRE_CONF_OPT="$PCRE_CONF_OPT --enable-jit"
fi
else
ngx_pcre_ver=`grep pcre_major, $PCRE/configure.ac \
| sed -e 's/^.*pcre_major,.*\[\(.*\)\].*$/\1/'`
fi
fi
echo " $ngx_pcre_ver major version found"
# to allow -ipo optimization we link with the *.o but not library
case "$ngx_pcre_ver" in
4|5)
CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
;;
6)
CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
;;
*)
CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
CORE_LIBS="$CORE_LIBS $PCRE/pcre_newline.o"
;;
esac
;;
*)
have=NGX_PCRE . auto/have
CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
;;
esac
else
if [ "$NGX_PLATFORM" != win32 ]; then
PCRE=NO
fi
if [ $PCRE = NO -a $PCRE2 != DISABLED ]; then
ngx_feature="PCRE2 library"
ngx_feature_name="NGX_PCRE2"
ngx_feature_run=no
ngx_feature_incs="#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>"
ngx_feature_path=
ngx_feature_libs="-lpcre2-8"
ngx_feature_test="pcre2_code *re;
re = pcre2_compile(NULL, 0, 0, NULL, NULL, NULL);
if (re == NULL) return 1"
. auto/feature
if [ $ngx_found = no ]; then
# pcre2-config
ngx_pcre2_prefix=`pcre2-config --prefix 2>/dev/null`
if [ -n "$ngx_pcre2_prefix" ]; then
ngx_feature="PCRE2 library in $ngx_pcre2_prefix"
ngx_feature_path=`pcre2-config --cflags \
| sed -n -e 's/.*-I *\([^ ][^ ]*\).*/\1/p'`
ngx_feature_libs=`pcre2-config --libs8`
. auto/feature
fi
fi
if [ $ngx_found = yes ]; then
have=NGX_PCRE . auto/have
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
PCRE_LIBRARY=PCRE2
fi
fi
if [ $PCRE = NO ]; then
ngx_feature="PCRE library"
ngx_feature_name="NGX_PCRE"
@ -118,16 +92,23 @@ else
ngx_feature_incs="#include <pcre.h>"
ngx_feature_path=
ngx_feature_libs="-lpcre"
ngx_feature_test="pcre *re;
re = pcre_compile(NULL, 0, NULL, 0, NULL);
if (re == NULL) return 1"
ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
. auto/feature
if [ $ngx_found = no ]; then
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
ngx_found=no
else
# FreeBSD port
ngx_feature="PCRE library in /usr/local/"
ngx_feature_name="NGX_PCRE"
ngx_feature_run=no
ngx_feature_incs="#include <pcre.h>"
ngx_feature_path="/usr/local/include"
if [ $NGX_RPATH = YES ]; then
@ -136,84 +117,106 @@ else
ngx_feature_libs="-L/usr/local/lib -lpcre"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# RedHat RPM, Solaris package
ngx_feature="PCRE library in /usr/include/pcre/"
ngx_feature_path="/usr/include/pcre"
ngx_feature_libs="-lpcre"
. auto/feature
fi
if [ $ngx_found = no ]; then
# NetBSD port
ngx_feature="PCRE library in /usr/pkg/"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
else
ngx_feature_libs="-L/usr/pkg/lib -lpcre"
fi
. auto/feature
fi
if [ $ngx_found = no ]; then
# MacPorts
ngx_feature="PCRE library in /opt/local/"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
else
ngx_feature_libs="-L/opt/local/lib -lpcre"
fi
ngx_feature_test="pcre *re;
re = pcre_compile(NULL, 0, NULL, 0, NULL)"
. auto/feature
fi
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
PCRE_LIBRARY=PCRE
fi
ngx_found=no
if [ $PCRE = YES ]; then
ngx_feature="PCRE JIT support"
ngx_feature_name="NGX_HAVE_PCRE_JIT"
ngx_feature_test="int jit = 0;
pcre_free_study(NULL);
pcre_config(PCRE_CONFIG_JIT, &jit);
if (jit != 1) return 1;"
. auto/feature
else
# Linux package
if [ $ngx_found = yes ]; then
PCRE_JIT=YES
if [ $PCRE = NO ]; then
ngx_feature="PCRE library in /usr/include/pcre/"
ngx_feature_name="NGX_PCRE"
ngx_feature_run=no
ngx_feature_incs="#include <pcre.h>"
ngx_feature_path="/usr/include/pcre"
ngx_feature_libs="-lpcre"
ngx_feature_test="pcre *re;
re = pcre_compile(NULL, 0, NULL, 0, NULL)"
. auto/feature
fi
fi
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
ngx_found=no
else
# NetBSD port
if [ $PCRE = NO ]; then
ngx_feature="PCRE library in /usr/pkg/"
ngx_feature_name="NGX_PCRE"
ngx_feature_run=no
ngx_feature_incs="#include <pcre.h>"
ngx_feature_path="/usr/pkg/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
else
ngx_feature_libs="-L/usr/pkg/lib -lpcre"
fi
ngx_feature_test="pcre *re;
re = pcre_compile(NULL, 0, NULL, 0, NULL)"
. auto/feature
fi
fi
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
ngx_found=no
else
# MacPorts
if [ $PCRE = NO ]; then
ngx_feature="PCRE library in /opt/local/"
ngx_feature_name="NGX_PCRE"
ngx_feature_run=no
ngx_feature_incs="#include <pcre.h>"
ngx_feature_path="/opt/local/include"
if [ $NGX_RPATH = YES ]; then
ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
else
ngx_feature_libs="-L/opt/local/lib -lpcre"
fi
ngx_feature_test="pcre *re;
re = pcre_compile(NULL, 0, NULL, 0, NULL)"
. auto/feature
fi
fi
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
CORE_INCS="$CORE_INCS $ngx_feature_path"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
PCRE=YES
ngx_found=no
fi
fi
if [ $PCRE != YES ]; then
cat << END
$0: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
END
exit 1
fi
fi

View File

@ -1,152 +1,56 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $PCRE_LIBRARY = PCRE2 ]; then
case "$NGX_CC_NAME" in
# PCRE2
msvc*)
ngx_makefile=makefile.msvc
ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
;;
if [ $NGX_CC_NAME = msvc ]; then
owc*)
ngx_makefile=makefile.owc
ngx_opt="CPU_OPT=\"$CPU_OPT\""
;;
# With PCRE2, it is not possible to compile all sources.
# Since list of source files changes between versions, we
# test files which might not be present.
bcc)
ngx_makefile=makefile.bcc
ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
;;
ngx_pcre_srcs="pcre2_auto_possess.c \
pcre2_chartables.c \
pcre2_compile.c \
pcre2_config.c \
pcre2_context.c \
pcre2_dfa_match.c \
pcre2_error.c \
pcre2_jit_compile.c \
pcre2_maketables.c \
pcre2_match.c \
pcre2_match_data.c \
pcre2_newline.c \
pcre2_ord2utf.c \
pcre2_pattern_info.c \
pcre2_string_utils.c \
pcre2_study.c \
pcre2_substitute.c \
pcre2_substring.c \
pcre2_tables.c \
pcre2_ucd.c \
pcre2_valid_utf.c \
pcre2_xclass.c"
esac
ngx_pcre_test="pcre2_convert.c \
pcre2_extuni.c \
pcre2_find_bracket.c \
pcre2_script_run.c \
pcre2_serialize.c"
for ngx_src in $ngx_pcre_test
do
if [ -f $PCRE/src/$ngx_src ]; then
ngx_pcre_srcs="$ngx_pcre_srcs $ngx_src"
fi
done
case "$NGX_PLATFORM" in
ngx_pcre_objs=`echo $ngx_pcre_srcs \
| sed -e "s#\([^ ]*\.\)c#\1$ngx_objext#g"`
win32)
cp auto/lib/pcre/patch.pcre.in $PCRE
cp auto/lib/pcre/patch.pcre.in.owc $PCRE
cp auto/lib/pcre/patch.config.in $PCRE
cp auto/lib/pcre/patch.pcre.c $PCRE
cp auto/lib/pcre/$ngx_makefile $PCRE
ngx_pcre_srcs=`echo $ngx_pcre_srcs \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g"`
ngx_pcre_objs=`echo $ngx_pcre_objs \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g"`
ngx_pcre=`echo $PCRE | sed -e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
PCRE_CFLAGS = -O2 -Ob1 -Oi -Gs $LIBC $CPU_OPT
PCRE_FLAGS = -DHAVE_CONFIG_H -DPCRE2_STATIC -DPCRE2_CODE_UNIT_WIDTH=8 \\
-DHAVE_MEMMOVE
`echo "$PCRE/pcre.h: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
cd $ngx_pcre
\$(MAKE) -f $ngx_makefile pcre.h
cd ..\\..\\..
PCRE_SRCS = $ngx_pcre_srcs
PCRE_OBJS = $ngx_pcre_objs
$PCRE/src/pcre2.h:
cd $PCRE/src \\
&& copy /y config.h.generic config.h \\
&& copy /y pcre2.h.generic pcre2.h \\
&& copy /y pcre2_chartables.c.dist pcre2_chartables.c
$PCRE/src/pcre2-8.lib: $PCRE/src/pcre2.h $NGX_MAKEFILE
cd $PCRE/src \\
&& cl -nologo -c \$(PCRE_CFLAGS) -I . \$(PCRE_FLAGS) \$(PCRE_SRCS) \\
&& link -lib -out:pcre2-8.lib -verbose:lib \$(PCRE_OBJS)
`echo "$PCRE/pcre.lib: $PCRE/pcre.h" | sed -e "s/\//$ngx_regex_dirsep/g"`
cd $ngx_pcre
\$(MAKE) -f $ngx_makefile $ngx_opt
cd ..\\..\\..
END
else
cat << END >> $NGX_MAKEFILE
$PCRE/src/pcre2.h: $PCRE/Makefile
$PCRE/Makefile: $NGX_MAKEFILE
cd $PCRE \\
&& if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
&& CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
./configure --disable-shared $PCRE_CONF_OPT
$PCRE/.libs/libpcre2-8.a: $PCRE/Makefile
cd $PCRE \\
&& \$(MAKE) libpcre2-8.la
END
fi
else
# PCRE
case "$NGX_CC_NAME" in
msvc)
ngx_makefile=makefile.msvc
ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
ngx_pcre="PCRE=\"$PCRE\""
;;
owc)
ngx_makefile=makefile.owc
ngx_opt="CPU_OPT=\"$CPU_OPT\""
ngx_pcre=`echo PCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"`
;;
bcc)
ngx_makefile=makefile.bcc
ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
ngx_pcre=`echo \-DPCRE=\"$PCRE\" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
;;
*)
ngx_makefile=
;;
esac
if [ -n "$ngx_makefile" ]; then
cat << END >> $NGX_MAKEFILE
`echo "$PCRE/pcre.lib: $PCRE/pcre.h $NGX_MAKEFILE" \
| sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre $ngx_opt
`echo "$PCRE/pcre.h:" | sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre pcre.h
END
else
;;
*)
cat << END >> $NGX_MAKEFILE
$PCRE/pcre.h: $PCRE/Makefile
@ -155,7 +59,8 @@ $PCRE/Makefile: $NGX_MAKEFILE
cd $PCRE \\
&& if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
&& CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
./configure --disable-shared $PCRE_CONF_OPT
./configure --disable-shared
$PCRE/.libs/libpcre.a: $PCRE/Makefile
cd $PCRE \\
@ -163,6 +68,6 @@ $PCRE/.libs/libpcre.a: $PCRE/Makefile
END
fi
;;
fi
esac

View File

@ -1,27 +1,21 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -q -O2 -tWM -w-8004 $(CPU_OPT)
PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 \
-DSUPPORT_PCRE8 -DHAVE_MEMMOVE
PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10
pcre.lib:
cd $(PCRE)
pcre.lib: pcre.h
bcc32 -q -edftables dftables.c
bcc32 -c $(CFLAGS) -I. $(PCREFLAGS) pcre_*.c
dftables > chartables.c
copy /y nul pcre.lst
for %n in (*.obj) do @echo +%n ^^& >> pcre.lst
echo + >> pcre.lst
bcc32 -c $(CFLAGS) $(PCREFLAGS) maketables.c get.c study.c pcre.c
tlib pcre.lib @pcre.lst
tlib pcre.lib +maketables.obj +get.obj +study.obj +pcre.obj
pcre.h:
cd $(PCRE)
copy /y pcre.h.generic pcre.h
copy /y config.h.generic config.h
copy /y pcre_chartables.c.dist pcre_chartables.c
patch -o pcre.h pcre.in patch.pcre.in
patch -o config.h config.in patch.config.in
patch -o pcre.c pcre.c patch.pcre.c

View File

@ -1,23 +1,23 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 \
-DSUPPORT_PCRE8 -DHAVE_MEMMOVE
PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10
pcre.lib:
cd $(PCRE)
pcre.lib: pcre.h
cl -Fedftables dftables.c
cl -nologo -c $(CFLAGS) -I . $(PCREFLAGS) pcre_*.c
dftables > chartables.c
link -lib -out:pcre.lib -verbose:lib pcre_*.obj
cl -nologo -c $(CFLAGS) $(PCREFLAGS) \
maketables.c get.c study.c pcre.c
link -lib -out:pcre.lib -verbose:lib \
maketables.obj get.obj study.obj pcre.obj
pcre.h:
cd $(PCRE)
copy /y pcre.h.generic pcre.h
copy /y config.h.generic config.h
copy /y pcre_chartables.c.dist pcre_chartables.c
patch -o pcre.h pcre.in patch.pcre.in
patch -o config.h config.in patch.config.in
patch -o pcre.c pcre.c patch.pcre.c

View File

@ -1,25 +1,19 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 &
-DSUPPORT_PCRE8 -DHAVE_MEMMOVE
PCREFLAGS = -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10
pcre.lib:
cd $(PCRE)
pcre.lib: pcre.h
wcl386 -zq -bt=nt -l=nt -fe=dftables dftables.c
dftables > chartables.c
wcl386 $(CFLAGS) -i=. $(PCREFLAGS) pcre_*.c
wcl386 $(CFLAGS) $(PCREFLAGS) maketables.c get.c study.c pcre.c
wlib -n pcre.lib maketables.obj get.obj study.obj pcre.obj
dir /b *.obj > pcre.lst
wlib -n pcre.lib @pcre.lst
pcre.h:
cd $(PCRE)
copy /y pcre.h.generic pcre.h
copy /y config.h.generic config.h
copy /y pcre_chartables.c.dist pcre_chartables.c
patch -o pcre.h pcre.in patch.pcre.in.owc
patch -o config.h config.in patch.config.in

View File

@ -0,0 +1,11 @@
--- config.in Thu Aug 21 14:43:07 2003
+++ config.in Sun Mar 7 02:37:24 2004
@@ -28,7 +28,7 @@
found. */
#define HAVE_STRERROR 0
-#define HAVE_MEMMOVE 0
+#define HAVE_MEMMOVE 1
/* There are some non-Unix systems that don't even have bcopy(). If this macro
is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of

View File

@ -0,0 +1,13 @@
--- pcre.c Thu Aug 21 14:43:07 2003
+++ pcre.c Tue Mar 22 12:56:59 2005
@@ -246,8 +246,8 @@
extern "C" void (*pcre_free)(void *) = free;
extern "C" int (*pcre_callout)(pcre_callout_block *) = NULL;
#else
-void *(*pcre_malloc)(size_t) = malloc;
-void (*pcre_free)(void *) = free;
+void *(__cdecl *pcre_malloc)(size_t) = malloc;
+void (__cdecl *pcre_free)(void *) = free;
int (*pcre_callout)(pcre_callout_block *) = NULL;
#endif
#endif

View File

@ -0,0 +1,26 @@
--- pcre.in Thu Aug 21 14:43:07 2003
+++ pcre.h Tue Mar 22 12:56:59 2005
@@ -10,9 +10,9 @@
/* The file pcre.h is build by "configure". Do not edit it; instead
make changes to pcre.in. */
-#define PCRE_MAJOR @PCRE_MAJOR@
-#define PCRE_MINOR @PCRE_MINOR@
-#define PCRE_DATE @PCRE_DATE@
+#define PCRE_MAJOR 4
+#define PCRE_MINOR 4
+#define PCRE_DATE 21-August-2003
/* Win32 uses DLL by default */
@@ -143,8 +143,8 @@
have to be different again. */
#ifndef VPCOMPAT
-PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
-PCRE_DATA_SCOPE void (*pcre_free)(void *);
+PCRE_DATA_SCOPE void *(__cdecl *pcre_malloc)(size_t);
+PCRE_DATA_SCOPE void (__cdecl *pcre_free)(void *);
PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *);
#else /* VPCOMPAT */
extern void *pcre_malloc(size_t);

View File

@ -0,0 +1,15 @@
--- pcre.in Thu Aug 21 14:43:07 2003
+++ pcre.h Tue Mar 22 12:56:59 2005
@@ -10,9 +10,9 @@
/* The file pcre.h is build by "configure". Do not edit it; instead
make changes to pcre.in. */
-#define PCRE_MAJOR @PCRE_MAJOR@
-#define PCRE_MINOR @PCRE_MINOR@
-#define PCRE_DATE @PCRE_DATE@
+#define PCRE_MAJOR 4
+#define PCRE_MINOR 4
+#define PCRE_DATE 21-August-2003
/* Win32 uses DLL by default */

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo "checking for perl"
@ -12,26 +11,16 @@ NGX_PERL_VER=`$NGX_PERL -v 2>&1 | grep '^This is perl' 2>&1 \
if test -n "$NGX_PERL_VER"; then
echo " + perl version: $NGX_PERL_VER"
if [ "`$NGX_PERL -e 'use 5.008006; print "OK"'`" != "OK" ]; then
if [ "`echo 'use 5.006001; print "OK"' | $NGX_PERL 2>&1`" != OK ]; then
echo
echo "$0: error: perl 5.8.6 or higher is required"
echo "$0: error: perl 5.6.1 or higher is required"
echo
exit 1;
fi
if [ "`$NGX_PERL -MExtUtils::Embed -e 'print "OK"'`" != "OK" ]; then
echo
echo "$0: error: perl module ExtUtils::Embed is required"
echo
exit 1;
fi
NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
NGX_PM_LDFLAGS=`$NGX_PERL -MConfig -e 'print $Config{lddlflags}'`
NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
# gcc 4.1/4.2 warn about unused values in pTHX_
NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
@ -42,10 +31,6 @@ if test -n "$NGX_PERL_VER"; then
ngx_perl_ldopts=`$NGX_PERL -MExtUtils::Embed -e ldopts`
ngx_perl_dlext=`$NGX_PERL -MConfig -e 'print $Config{dlext}'`
ngx_perl_libdir="src/http/modules/perl/blib/arch/auto"
ngx_perl_module="$ngx_perl_libdir/nginx/nginx.$ngx_perl_dlext"
if $NGX_PERL -V:usemultiplicity | grep define > /dev/null; then
have=NGX_HAVE_PERL_MULTIPLICITY . auto/have
echo " + perl interpreter multiplicity found"
@ -56,17 +41,8 @@ if test -n "$NGX_PERL_VER"; then
ngx_perl_ldopts=`echo $ngx_perl_ldopts | sed 's/ -pthread//'`
fi
if [ "$NGX_SYSTEM" = "Darwin" ]; then
# OS X system perl wants to link universal binaries
ngx_perl_ldopts=`echo $ngx_perl_ldopts \
| sed -e 's/-arch i386//' -e 's/-arch x86_64//'`
fi
if [ $USE_PERL = YES ]; then
CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
fi
NGX_LIB_PERL="$ngx_perl_ldopts"
CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
LINK_DEPS="$LINK_DEPS $NGX_OBJS/src/http/modules/perl/blib/arch/auto/nginx/nginx.so"
if test -n "$NGX_PERL_MODULES"; then
have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\""
@ -76,7 +52,7 @@ if test -n "$NGX_PERL_VER"; then
else
echo
echo "$0: error: perl 5.8.6 or higher is required"
echo "$0: error: perl 5.6.1 or higher is required"
echo
exit 1;

View File

@ -1,46 +1,34 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_MAKEFILE
$NGX_OBJS/src/http/modules/perl/ngx_http_perl_module.o: \\
$NGX_OBJS/$ngx_perl_module
$NGX_OBJS/$ngx_perl_module: \\
\$(CORE_DEPS) \$(HTTP_DEPS) \\
src/http/modules/perl/ngx_http_perl_module.h \\
$NGX_OBJS/src/http/modules/perl/blib/arch/auto/nginx/nginx.so: \
src/http/modules/perl/nginx.pm \
src/http/modules/perl/nginx.xs \
src/http/modules/perl/ngx_http_perl_module.h \
$NGX_OBJS/src/http/modules/perl/Makefile
cd $NGX_OBJS/src/http/modules/perl && \$(MAKE)
cp -p src/http/modules/perl/nginx.* $NGX_OBJS/src/http/modules/perl/
cd $NGX_OBJS/src/http/modules/perl && make
rm -rf $NGX_OBJS/install_perl
$NGX_OBJS/src/http/modules/perl/Makefile: \\
$NGX_AUTO_CONFIG_H \\
src/core/nginx.h \\
src/http/modules/perl/Makefile.PL \\
src/http/modules/perl/nginx.pm \\
src/http/modules/perl/nginx.xs \\
src/http/modules/perl/typemap
grep 'define NGINX_VERSION' src/core/nginx.h \\
| sed -e 's/^.*"\(.*\)".*/\1/' > \\
$NGX_OBJS/src/http/modules/perl/version
sed "s/%%VERSION%%/\`cat $NGX_OBJS/src/http/modules/perl/version\`/" \\
src/http/modules/perl/nginx.pm > \\
$NGX_OBJS/src/http/modules/perl/nginx.pm
cp -p src/http/modules/perl/nginx.xs $NGX_OBJS/src/http/modules/perl/
$NGX_OBJS/src/http/modules/perl/Makefile: \
src/http/modules/perl/Makefile.PL \
src/http/modules/perl/nginx.pm
cp -p src/http/modules/perl/nginx.* $NGX_OBJS/src/http/modules/perl/
cp -p src/http/modules/perl/typemap $NGX_OBJS/src/http/modules/perl/
cp -p src/http/modules/perl/Makefile.PL $NGX_OBJS/src/http/modules/perl/
cd $NGX_OBJS/src/http/modules/perl \\
&& NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \\
NGX_PM_LDFLAGS="$NGX_LD_OPT \$(NGX_PM_LDFLAGS)" \\
NGX_INCS="$CORE_INCS $NGX_OBJS $HTTP_INCS" \\
NGX_DEPS="\$(CORE_DEPS) \$(HTTP_DEPS)" \\
$NGX_PERL Makefile.PL \\
LIB=$NGX_PERL_MODULES \\
cd $NGX_OBJS/src/http/modules/perl \
&& NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \
NGX_PCRE=$PCRE \
NGX_OBJS=$NGX_OBJS \
$NGX_PERL Makefile.PL \
LIB=$NGX_PERL_MODULES \
INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN
END

83
auto/lib/sha1/conf Normal file
View File

@ -0,0 +1,83 @@
# Copyright (C) Igor Sysoev
if [ $SHA1 != NONE ]; then
CORE_INCS="$CORE_INCS $SHA1"
case "$NGX_CC_NAME" in
msvc* | owc* | bcc)
LINK_DEPS="$LINK_DEPS $SHA1/sha1.lib"
CORE_LIBS="$CORE_LIBS $SHA1/sha1.lib"
;;
icc*)
LINK_DEPS="$LINK_DEPS $SHA1/libsha.a"
# to allow -ipo optimization we link with the *.o but not library
CORE_LIBS="$CORE_LIBS $SHA1/sha1_dgst.o"
if [ $SHA1_ASM = YES ]; then
CORE_LIBS="$CORE_LIBS $SHA1/asm/sx86-elf.o"
fi
;;
*)
LINK_DEPS="$LINK_DEPS $SHA1/libsha.a"
CORE_LIBS="$CORE_LIBS $SHA1/libsha.a"
#CORE_LIBS="$CORE_LIBS -L $SHA1 -lsha"
;;
esac
else
if [ "$NGX_PLATFORM" != win32 ]; then
SHA1=NO
# FreeBSD
ngx_feature="sha1 in system md library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <sha.h>"
ngx_feature_path=
ngx_feature_libs="-lmd"
ngx_feature_test="SHA_CTX sha1; SHA1_Init(&sha1)"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
SHA1=YES
SHA1_LIB=md
ngx_found=no
else
if [ $SHA1 = NO ]; then
# OpenSSL crypto library
ngx_feature="OpenSSL sha1 crypto library"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <openssl/sha.h>"
ngx_feature_path=
ngx_feature_libs="-lcrypto"
ngx_feature_test="SHA_CTX sha1; SHA1_Init(&sha1)"
. auto/feature
fi
fi
if [ $ngx_found = yes ]; then
have=NGX_HAVE_OPENSSL_SHA1_H . auto/have
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
SHA1=YES
SHA1_LIB=crypto
fi
fi
fi

96
auto/lib/sha1/make Normal file
View File

@ -0,0 +1,96 @@
# Copyright (C) Igor Sysoev
case "$NGX_CC_NAME" in
msvc*)
ngx_makefile=makefile.msvc
ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC SHA1_ASM=$SHA1_ASM"
;;
owc*)
ngx_makefile=makefile.owc
ngx_opt="CPU_OPT=\"$CPU_OPT\""
;;
bcc)
ngx_makefile=makefile.bcc
ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DSHA1_ASM=$SHA1_ASM"
;;
esac
done=NO
case "$NGX_PLATFORM" in
win32)
cp auto/lib/sha1/$ngx_makefile $SHA1
cat << END >> $NGX_MAKEFILE
`echo "$SHA1/sha1.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
cd `echo $SHA1 | sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f $ngx_makefile $ngx_opt
cd ..\\..\\..
END
done=YES
;;
SunOS:*:i86pc)
if [ $SHA1_ASM = YES ]; then
cat << END >> $NGX_MAKEFILE
$SHA1/libsha.a: $NGX_MAKEFILE
cd $SHA1 \\
&& \$(MAKE) CFLAGS="$SHA1_OPT -DSOL -DSHA1_ASM -DL_ENDIAN" \\
CC="\$(CC)" CPP="\$(CPP)" \\
SHA_ASM_OBJ=asm/sx86-sol.o clean libsha.a
END
done=YES
fi
;;
# FreeBSD: i386
# Linux: i686
*:i386 | *:i686)
if [ $SHA1_ASM = YES ]; then
cat << END >> $NGX_MAKEFILE
$SHA1/libsha.a: $NGX_MAKEFILE
cd $SHA1 \\
&& \$(MAKE) CFLAGS="$SHA1_OPT -DELF -DSHA1_ASM -DL_ENDIAN" \\
CC="\$(CC)" CPP="\$(CPP)" \\
SHA_ASM_OBJ=asm/sx86-elf.o clean libsha.a
END
done=YES
fi
;;
esac
if [ $done = NO ]; then
cat << END >> $NGX_MAKEFILE
$SHA1/libsha.a: $NGX_MAKEFILE
cd $SHA1 \\
&& \$(MAKE) CFLAGS="$SHA1_OPT" \\
CC="\$(CC)" SHA_ASM_OBJ= clean libsha.a
END
fi

View File

@ -0,0 +1,19 @@
# Copyright (C) Igor Sysoev
CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
!if "$(SHA1_ASM)" == "YES"
sha1.lib:
bcc32 -c $(CFLAGS) -DSHA1_ASM sha1dgst.c
tlib sha1.lib +sha1dgst.obj +"asm\s-win32.obj"
!else
sha1.lib:
bcc32 -c $(CFLAGS) sha1dgst.c
tlib sha1.lib +sha1dgst.obj
!endif

View File

@ -0,0 +1,19 @@
# Copyright (C) Igor Sysoev
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
!IF "$(SHA1_ASM)" == "YES"
sha1.lib:
cl -c $(CFLAGS) -D SHA1_ASM sha1dgst.c
link -lib -out:sha1.lib sha1dgst.obj asm/s-win32.obj
!ELSE
sha1.lib:
cl -c $(CFLAGS) sha1dgst.c
link -lib -out:sha1.lib sha1dgst.obj
!ENDIF

View File

@ -0,0 +1,9 @@
# Copyright (C) Igor Sysoev
CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
sha1.lib:
wcl386 -c $(CFLAGS) -dL_ENDIAN sha1dgst.c
wlib -n sha1.lib sha1dgst.obj

39
auto/lib/test Normal file
View File

@ -0,0 +1,39 @@
# Copyright (C) Igor Sysoev
echo $ngx_n "checking for $ngx_lib ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for $ngx_lib
END
ngx_found=no
cat << END > $NGX_AUTOTEST.c
$ngx_lib_incs
int main() {
$ngx_lib_test;
return 0;
}
eval "$CC $cc_test_flags $ngx_lib_cflags \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $ngx_libs \
>> $NGX_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
echo " found"
ngx_found=yes
else
echo " not found"
fi
rm $NGX_AUTOTEST*

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $ZLIB != NONE ]; then
@ -8,14 +7,12 @@ if [ $ZLIB != NONE ]; then
case "$NGX_CC_NAME" in
msvc | owc | bcc)
have=NGX_ZLIB . auto/have
msvc* | owc* | bcc)
LINK_DEPS="$LINK_DEPS $ZLIB/zlib.lib"
CORE_LIBS="$CORE_LIBS $ZLIB/zlib.lib"
;;
icc)
have=NGX_ZLIB . auto/have
icc*)
LINK_DEPS="$LINK_DEPS $ZLIB/libz.a"
# to allow -ipo optimization we link with the *.o but not library
@ -32,7 +29,6 @@ if [ $ZLIB != NONE ]; then
;;
*)
have=NGX_ZLIB . auto/have
LINK_DEPS="$LINK_DEPS $ZLIB/libz.a"
CORE_LIBS="$CORE_LIBS $ZLIB/libz.a"
#CORE_LIBS="$CORE_LIBS -L $ZLIB -lz"
@ -48,7 +44,7 @@ else
# FreeBSD, Solaris, Linux
ngx_feature="zlib library"
ngx_feature_name="NGX_ZLIB"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <zlib.h>"
ngx_feature_path=
@ -64,16 +60,4 @@ else
fi
fi
if [ $ZLIB != YES ]; then
cat << END
$0: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
END
exit 1
fi
fi

View File

@ -1,31 +1,23 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$NGX_CC_NAME" in
msvc)
msvc*)
ngx_makefile=makefile.msvc
ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
ngx_zlib="ZLIB=\"$ZLIB\""
;;
owc)
owc*)
ngx_makefile=makefile.owc
ngx_opt="CPU_OPT=\"$CPU_OPT\""
ngx_zlib=`echo ZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
;;
bcc)
ngx_makefile=makefile.bcc
ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
ngx_zlib=`echo \-DZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
;;
*)
ngx_makefile=
;;
esac
@ -37,30 +29,17 @@ done=NO
case "$NGX_PLATFORM" in
win32)
cp auto/lib/zlib/$ngx_makefile $ZLIB
if [ -n "$ngx_makefile" ]; then
cat << END >> $NGX_MAKEFILE
cat << END >> $NGX_MAKEFILE
`echo "$ZLIB/zlib.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f auto/lib/zlib/$ngx_makefile $ngx_opt $ngx_zlib
cd `echo $ZLIB | sed -e "s/\//$ngx_regex_dirsep/g"`
\$(MAKE) -f $ngx_makefile $ngx_opt
cd ..\\..\\..
END
else
cat << END >> $NGX_MAKEFILE
$ZLIB/libz.a: $NGX_MAKEFILE
cd $ZLIB \\
&& \$(MAKE) distclean \\
&& \$(MAKE) -f win32/Makefile.gcc \\
CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
libz.a
END
fi
done=YES
;;
@ -75,7 +54,7 @@ END
$ZLIB/libz.a: $NGX_MAKEFILE
cd $ZLIB \\
&& \$(MAKE) distclean \\
&& \$(MAKE) clean \\
&& cp contrib/asm586/match.S . \\
&& CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
./configure \\
@ -92,7 +71,7 @@ END
$ZLIB/libz.a: $NGX_MAKEFILE
cd $ZLIB \\
&& \$(MAKE) distclean \\
&& \$(MAKE) clean \\
&& cp contrib/asm686/match.S . \\
&& CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
./configure \\
@ -125,7 +104,7 @@ if [ $done = NO ]; then
$ZLIB/libz.a: $NGX_MAKEFILE
cd $ZLIB \\
&& \$(MAKE) distclean \\
&& \$(MAKE) clean \\
&& CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
./configure \\
&& \$(MAKE) libz.a

View File

@ -1,17 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -q -O2 -tWM -w-8004 -w-8012 $(CPU_OPT)
zlib.lib:
cd $(ZLIB)
bcc32 -c $(CFLAGS) adler32.c crc32.c deflate.c \
trees.c zutil.c compress.c \
inflate.c inffast.c inftrees.c
bcc32 -c $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c \
compress.c
tlib zlib.lib +adler32.obj +crc32.obj +deflate.obj \
+trees.obj +zutil.obj +compress.obj \
+inflate.obj +inffast.obj +inftrees.obj
+trees.obj +zutil.obj +compress.obj

View File

@ -1,17 +1,11 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
zlib.lib:
cd $(ZLIB)
cl -c $(CFLAGS) adler32.c crc32.c deflate.c \
trees.c zutil.c compress.c \
inflate.c inffast.c inftrees.c
cl -c $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c compress.c
link -lib -out:zlib.lib adler32.obj crc32.obj deflate.obj \
trees.obj zutil.obj compress.obj \
inflate.obj inffast.obj inftrees.obj
trees.obj zutil.obj compress.obj

View File

@ -1,14 +1,9 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
zlib.lib:
cd $(ZLIB)
wcl386 -c $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c &
compress.c inflate.c inffast.c inftrees.c
wlib -n zlib.lib adler32.obj crc32.obj deflate.obj trees.obj &
zutil.obj compress.obj inflate.obj inffast.obj inftrees.obj
wcl386 -c $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c compress.c
wlib -n zlib.lib adler32.obj crc32.obj deflate.obj trees.obj zutil.obj compress.obj

View File

@ -0,0 +1,10 @@
--- zlib.h Thu Jul 9 20:06:56 1998
+++ zlib-1.1.3/zlib.h Tue Mar 22 13:41:04 2005
@@ -709,7 +709,6 @@
(0 in case of error).
*/
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of

340
auto/make
View File

@ -1,18 +1,12 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo "creating $NGX_MAKEFILE"
mkdir -p $NGX_OBJS/src/core $NGX_OBJS/src/event $NGX_OBJS/src/event/modules \
$NGX_OBJS/src/event/quic \
$NGX_OBJS/src/os/unix $NGX_OBJS/src/os/win32 \
$NGX_OBJS/src/http $NGX_OBJS/src/http/v2 $NGX_OBJS/src/http/v3 \
$NGX_OBJS/src/http/modules $NGX_OBJS/src/http/modules/perl \
$NGX_OBJS/src/mail \
$NGX_OBJS/src/stream \
$NGX_OBJS/src/misc
$NGX_OBJS/src/http $NGX_OBJS/src/http/modules \
$NGX_OBJS/src/http/modules/perl \
$NGX_OBJS/src/mail
ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
@ -28,17 +22,26 @@ LINK = $LINK
END
if test -n "$NGX_PERL_CFLAGS"; then
echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
echo NGX_PM_CFLAGS = $NGX_PM_CFLAGS >> $NGX_MAKEFILE
echo NGX_PM_LDFLAGS = $NGX_PM_LDFLAGS >> $NGX_MAKEFILE
fi
if [ "$BMAKE" = wmake ]; then
echo MAKE = wmake >> $NGX_MAKEFILE
ngx_regex_cont=' '
ngx_long_regex_cont=' '
ngx_cont=' '
ngx_long_cont=' '
ngx_tab=' '
fi
# ALL_INCS, required by the addons and by OpenWatcom C precompiled headers
ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS $STREAM_INCS\
ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS\
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
@ -52,7 +55,7 @@ END
ngx_all_srcs="$CORE_SRCS"
# the core dependencies and include paths
# the core dependences and include pathes
ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
@ -72,7 +75,7 @@ CORE_INCS = $ngx_include_opt$ngx_incs
END
# the http dependencies and include paths
# the http dependences and include pathes
if [ $HTTP = YES ]; then
@ -98,13 +101,11 @@ END
fi
# the mail dependencies and include paths
# the mail dependences and include pathes
if [ $MAIL != NO ]; then
if [ $MAIL = YES ]; then
if [ $MAIL = YES ]; then
ngx_all_srcs="$ngx_all_srcs $MAIL_SRCS"
fi
ngx_all_srcs="$ngx_all_srcs $MAIL_SRCS"
ngx_deps=`echo $MAIL_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
@ -126,38 +127,7 @@ END
fi
# the stream dependencies and include paths
if [ $STREAM != NO ]; then
if [ $STREAM = YES ]; then
ngx_all_srcs="$ngx_all_srcs $STREAM_SRCS"
fi
ngx_deps=`echo $STREAM_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_incs=`echo $STREAM_INCS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
cat << END >> $NGX_MAKEFILE
STREAM_DEPS = $ngx_deps
STREAM_INCS = $ngx_include_opt$ngx_incs
END
fi
ngx_all_srcs="$ngx_all_srcs $MISC_SRCS"
if test -n "$NGX_ADDON_SRCS$DYNAMIC_MODULES"; then
if test -n "$NGX_ADDON_SRCS"; then
cat << END >> $NGX_MAKEFILE
@ -210,7 +180,6 @@ ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_libs=
if test -n "$NGX_LD_OPT$CORE_LIBS"; then
ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
@ -219,22 +188,13 @@ fi
ngx_link=${CORE_LINK:+`echo $CORE_LINK \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
ngx_main_link=${MAIN_LINK:+`echo $MAIN_LINK \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
cat << END >> $NGX_MAKEFILE
build: binary modules manpage
binary: $NGX_OBJS${ngx_dirsep}nginx$ngx_binext
$NGX_OBJS${ngx_dirsep}nginx$ngx_binext: $ngx_deps$ngx_spacer
\$(LINK) $ngx_long_start$ngx_binout$NGX_OBJS${ngx_dirsep}nginx$ngx_binext$ngx_long_cont$ngx_objs$ngx_libs$ngx_link$ngx_main_link
$NGX_OBJS${ngx_dirsep}nginx${ngx_binext}: $ngx_deps$ngx_spacer
\$(LINK) ${ngx_long_start}${ngx_binout}$NGX_OBJS${ngx_dirsep}nginx$ngx_long_cont$ngx_objs$ngx_libs$ngx_link
$ngx_rcc
$ngx_long_end
modules:
${ngx_long_end}
END
@ -283,7 +243,7 @@ if [ $HTTP = YES ]; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
else
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS)"
ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS) "
ngx_perl_cc="$ngx_perl_cc \$(CORE_INCS) \$(HTTP_INCS)"
fi
@ -314,7 +274,7 @@ $ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
END
fi
done
done
fi
@ -344,63 +304,7 @@ $ngx_obj: \$(CORE_DEPS) \$(MAIL_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
fi
# the stream sources
if [ $STREAM = YES ]; then
if test -n "$NGX_PCH"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
else
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(STREAM_INCS)"
fi
for ngx_src in $STREAM_SRCS
do
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) \$(STREAM_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
fi
# the misc sources
if test -n "$MISC_SRCS"; then
ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
for ngx_src in $MISC_SRCS
do
ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=`echo $ngx_src \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(CORE_DEPS) $ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
done
fi
@ -432,16 +336,16 @@ $ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
done
done
fi
# the addons config.make
if test -n "$NGX_ADDONS$DYNAMIC_ADDONS"; then
if test -n "$NGX_ADDONS"; then
for ngx_addon_dir in $NGX_ADDONS $DYNAMIC_ADDONS
for ngx_addon_dir in $NGX_ADDONS
do
if test -f $ngx_addon_dir/config.make; then
. $ngx_addon_dir/config.make
@ -488,187 +392,3 @@ $ngx_pch
END
fi
# dynamic modules
if test -n "$NGX_PCH"; then
ngx_cc="\$(CC) $ngx_compile_opt $ngx_pic_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
else
ngx_cc="\$(CC) $ngx_compile_opt $ngx_pic_opt \$(CFLAGS) \$(ALL_INCS)"
ngx_perl_cc="\$(CC) $ngx_compile_opt $ngx_pic_opt \$(NGX_PERL_CFLAGS)"
ngx_perl_cc="$ngx_perl_cc \$(ALL_INCS)"
fi
for ngx_module in $DYNAMIC_MODULES
do
eval ngx_module_srcs="\$${ngx_module}_SRCS"
eval ngx_module_shrd="\$${ngx_module}_SHRD"
eval eval ngx_module_libs="\\\"\$${ngx_module}_LIBS\\\""
eval ngx_module_modules="\$${ngx_module}_MODULES"
eval ngx_module_order="\$${ngx_module}_ORDER"
ngx_modules_c=$NGX_OBJS/${ngx_module}_modules.c
cat << END > $ngx_modules_c
#include <ngx_config.h>
#include <ngx_core.h>
END
for mod in $ngx_module_modules
do
echo "extern ngx_module_t $mod;" >> $ngx_modules_c
done
echo >> $ngx_modules_c
echo 'ngx_module_t *ngx_modules[] = {' >> $ngx_modules_c
for mod in $ngx_module_modules
do
echo " &$mod," >> $ngx_modules_c
done
cat << END >> $ngx_modules_c
NULL
};
END
echo 'char *ngx_module_names[] = {' >> $ngx_modules_c
for mod in $ngx_module_modules
do
echo " \"$mod\"," >> $ngx_modules_c
done
cat << END >> $ngx_modules_c
NULL
};
END
echo 'char *ngx_module_order[] = {' >> $ngx_modules_c
for mod in $ngx_module_order
do
echo " \"$mod\"," >> $ngx_modules_c
done
cat << END >> $ngx_modules_c
NULL
};
END
ngx_modules_c=`echo $ngx_modules_c | sed -e "s/\//$ngx_regex_dirsep/g"`
ngx_modules_obj=`echo $ngx_modules_c \
| sed -e "s/\(.*\.\)c/\1$ngx_objext/"`
ngx_module_objs=
for ngx_src in $ngx_module_srcs $ngx_module_shrd
do
case "$ngx_src" in
src/*)
ngx_obj=$ngx_src
;;
*)
ngx_obj="addon/`basename \`dirname $ngx_src\``"
mkdir -p $NGX_OBJS/$ngx_obj
ngx_obj="$ngx_obj/`basename $ngx_src`"
;;
esac
ngx_module_objs="$ngx_module_objs $ngx_obj"
done
ngx_module_objs=`echo $ngx_module_objs \
| sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \
-e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \
-e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \
-e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"`
ngx_deps=`echo $ngx_module_objs $ngx_modules_obj $LINK_DEPS \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_objs=`echo $ngx_module_objs $ngx_modules_obj \
| sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
-e "s/\//$ngx_regex_dirsep/g"`
ngx_obj=$NGX_OBJS$ngx_dirsep$ngx_module$ngx_modext
if [ "$NGX_PLATFORM" = win32 ]; then
ngx_module_libs="$CORE_LIBS $ngx_module_libs"
fi
ngx_libs=
if test -n "$NGX_LD_OPT$ngx_module_libs"; then
ngx_libs=`echo $NGX_LD_OPT $ngx_module_libs \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
fi
ngx_link=${CORE_LINK:+`echo $CORE_LINK \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
ngx_module_link=${MODULE_LINK:+`echo $MODULE_LINK \
| sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
cat << END >> $NGX_MAKEFILE
modules: $ngx_obj
$ngx_obj: $ngx_deps$ngx_spacer
\$(LINK) $ngx_long_start$ngx_binout$ngx_obj$ngx_long_cont$ngx_objs$ngx_libs$ngx_link$ngx_module_link
$ngx_long_end
$ngx_modules_obj: \$(CORE_DEPS)$ngx_cont$ngx_modules_c
$ngx_cc$ngx_tab$ngx_objout$ngx_modules_obj$ngx_tab$ngx_modules_c$NGX_AUX
END
for ngx_source in $ngx_module_srcs
do
case "$ngx_source" in
src/*)
ngx_obj=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
;;
*)
ngx_obj="addon/`basename \`dirname $ngx_source\``"
ngx_obj=`echo $ngx_obj/\`basename $ngx_source\` \
| sed -e "s/\//$ngx_regex_dirsep/g"`
;;
esac
ngx_obj=`echo $ngx_obj \
| sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
-e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
$ngx_perl_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
else
cat << END >> $NGX_MAKEFILE
$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
$ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
END
fi
done
done

View File

@ -1,178 +0,0 @@
# Copyright (C) Ruslan Ermilov
# Copyright (C) Nginx, Inc.
case $ngx_module_type in
HTTP_*) ngx_var=HTTP ;;
*) ngx_var=$ngx_module_type ;;
esac
if [ "$ngx_module_link" = DYNAMIC ]; then
for ngx_module in $ngx_module_name; do
# extract the first name
break
done
DYNAMIC_MODULES="$DYNAMIC_MODULES $ngx_module"
eval ${ngx_module}_MODULES=\"$ngx_module_name\"
if [ -z "$ngx_module_order" -a \
\( "$ngx_module_type" = "HTTP_FILTER" \
-o "$ngx_module_type" = "HTTP_AUX_FILTER" \) ]
then
eval ${ngx_module}_ORDER=\"$ngx_module_name \
ngx_http_copy_filter_module\"
else
eval ${ngx_module}_ORDER=\"$ngx_module_order\"
fi
srcs=
shrd=
for src in $ngx_module_srcs
do
found=no
for old in $DYNAMIC_MODULES_SRCS
do
if [ $src = $old ]; then
found=yes
break
fi
done
if [ $found = no ]; then
srcs="$srcs $src"
else
shrd="$shrd $src"
fi
done
eval ${ngx_module}_SRCS=\"$srcs\"
eval ${ngx_module}_SHRD=\"$shrd\"
DYNAMIC_MODULES_SRCS="$DYNAMIC_MODULES_SRCS $srcs"
if test -n "$ngx_module_incs"; then
CORE_INCS="$CORE_INCS $ngx_module_incs"
fi
if test -n "$ngx_module_deps"; then
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
fi
libs=
for lib in $ngx_module_libs
do
case $lib in
LIBXSLT | LIBGD | GEOIP | PERL)
libs="$libs \$NGX_LIB_$lib"
if eval [ "\$USE_${lib}" = NO ] ; then
eval USE_${lib}=DYNAMIC
fi
;;
PCRE | OPENSSL | ZLIB)
eval USE_${lib}=YES
;;
MD5 | SHA1)
# obsolete
;;
*)
libs="$libs $lib"
;;
esac
done
eval ${ngx_module}_LIBS=\'$libs\'
elif [ "$ngx_module_link" = YES ]; then
eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
$ngx_module_name\"
eval ${ngx_var}_SRCS=\"\$${ngx_var}_SRCS $ngx_module_srcs\"
if test -n "$ngx_module_incs"; then
eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
fi
if test -n "$ngx_module_deps"; then
eval ${ngx_var}_DEPS=\"\$${ngx_var}_DEPS $ngx_module_deps\"
fi
for lib in $ngx_module_libs
do
case $lib in
PCRE | OPENSSL | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
eval USE_${lib}=YES
;;
MD5 | SHA1)
# obsolete
;;
*)
CORE_LIBS="$CORE_LIBS $lib"
;;
esac
done
elif [ "$ngx_module_link" = ADDON ]; then
eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
$ngx_module_name\"
srcs=
for src in $ngx_module_srcs
do
found=no
for old in $NGX_ADDON_SRCS
do
if [ $src = $old ]; then
found=yes
break
fi
done
if [ $found = no ]; then
srcs="$srcs $src"
fi
done
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $srcs"
if test -n "$ngx_module_incs"; then
eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
fi
if test -n "$ngx_module_deps"; then
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
fi
for lib in $ngx_module_libs
do
case $lib in
PCRE | OPENSSL | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
eval USE_${lib}=YES
;;
MD5 | SHA1)
# obsolete
;;
*)
CORE_LIBS="$CORE_LIBS $lib"
;;
esac
done
fi

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,23 +1,19 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
help=no
NGX_PREFIX=
NGX_SBIN_PATH=
NGX_MODULES_PATH=
NGX_CONF_PREFIX=
NGX_CONF_PATH=
NGX_ERROR_LOG_PATH=
NGX_PID_PATH=
NGX_LOCK_PATH=
NGX_USER=
NGX_GROUP=
NGX_BUILD=
CC=${CC:-cc}
CC=${CC:-gcc}
CPP=
NGX_OBJS=objs
@ -31,6 +27,7 @@ NGX_RPATH=NO
NGX_TEST_BUILD_DEVPOLL=NO
NGX_TEST_BUILD_EVENTPORT=NO
NGX_TEST_BUILD_EPOLL=NO
NGX_TEST_BUILD_RTSIG=NO
NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO
NGX_PLATFORM=
@ -38,75 +35,47 @@ NGX_WINE=
EVENT_FOUND=NO
EVENT_RTSIG=NO
EVENT_SELECT=NO
EVENT_POLL=NO
EVENT_AIO=NO
USE_THREADS=NO
NGX_FILE_AIO=NO
QUIC_BPF=NO
HTTP=YES
NGX_HTTP_LOG_PATH=
NGX_HTTP_CLIENT_TEMP_PATH=
NGX_HTTP_PROXY_TEMP_PATH=
NGX_HTTP_FASTCGI_TEMP_PATH=
NGX_HTTP_UWSGI_TEMP_PATH=
NGX_HTTP_SCGI_TEMP_PATH=
HTTP_CACHE=YES
HTTP_CHARSET=YES
HTTP_GZIP=YES
HTTP_SSL=NO
HTTP_V2=NO
HTTP_V3=NO
HTTP_SSI=YES
HTTP_POSTPONE=NO
HTTP_REALIP=NO
HTTP_XSLT=NO
HTTP_IMAGE_FILTER=NO
HTTP_SUB=NO
HTTP_ADDITION=NO
HTTP_DAV=NO
HTTP_ACCESS=YES
HTTP_AUTH_BASIC=YES
HTTP_AUTH_REQUEST=NO
HTTP_MIRROR=YES
HTTP_USERID=YES
HTTP_SLICE=NO
HTTP_AUTOINDEX=YES
HTTP_RANDOM_INDEX=NO
HTTP_STATUS=NO
HTTP_GEO=YES
HTTP_GEOIP=NO
HTTP_MAP=YES
HTTP_SPLIT_CLIENTS=YES
HTTP_REFERER=YES
HTTP_REWRITE=YES
HTTP_PROXY=YES
HTTP_FASTCGI=YES
HTTP_UWSGI=YES
HTTP_SCGI=YES
HTTP_GRPC=YES
HTTP_PERL=NO
HTTP_MEMCACHED=YES
HTTP_LIMIT_CONN=YES
HTTP_LIMIT_REQ=YES
HTTP_LIMIT_ZONE=YES
HTTP_EMPTY_GIF=YES
HTTP_BROWSER=YES
HTTP_SECURE_LINK=NO
HTTP_DEGRADATION=NO
HTTP_FLV=NO
HTTP_MP4=NO
HTTP_GUNZIP=NO
HTTP_GZIP_STATIC=NO
HTTP_UPSTREAM_HASH=YES
HTTP_UPSTREAM_IP_HASH=YES
HTTP_UPSTREAM_LEAST_CONN=YES
HTTP_UPSTREAM_RANDOM=YES
HTTP_UPSTREAM_KEEPALIVE=YES
HTTP_UPSTREAM_ZONE=YES
# STUB
HTTP_STUB_STATUS=NO
@ -117,45 +86,25 @@ MAIL_POP3=YES
MAIL_IMAP=YES
MAIL_SMTP=YES
STREAM=NO
STREAM_SSL=NO
STREAM_QUIC=NO
STREAM_REALIP=NO
STREAM_LIMIT_CONN=YES
STREAM_ACCESS=YES
STREAM_GEO=YES
STREAM_GEOIP=NO
STREAM_MAP=YES
STREAM_SPLIT_CLIENTS=YES
STREAM_RETURN=YES
STREAM_SET=YES
STREAM_UPSTREAM_HASH=YES
STREAM_UPSTREAM_LEAST_CONN=YES
STREAM_UPSTREAM_RANDOM=YES
STREAM_UPSTREAM_ZONE=YES
STREAM_SSL_PREREAD=NO
DYNAMIC_MODULES=
DYNAMIC_MODULES_SRCS=
NGX_ADDONS=
NGX_ADDON_SRCS=
NGX_ADDON_DEPS=
DYNAMIC_ADDONS=
NGX_COMPAT=NO
USE_PCRE=NO
PCRE=NONE
PCRE_OPT=
PCRE_CONF_OPT=
PCRE_JIT=NO
PCRE2=YES
USE_OPENSSL=NO
USE_OPENSSL_QUIC=NO
OPENSSL=NONE
USE_MD5=NO
MD5=NONE
MD5_OPT=
MD5_ASM=NO
USE_SHA1=NO
SHA1=NONE
SHA1_OPT=
SHA1_ASM=NO
USE_ZLIB=NO
ZLIB=NONE
ZLIB_OPT=
@ -164,27 +113,11 @@ ZLIB_ASM=NO
USE_PERL=NO
NGX_PERL=perl
USE_LIBXSLT=NO
USE_LIBGD=NO
USE_GEOIP=NO
NGX_GOOGLE_PERFTOOLS=NO
NGX_CPP_TEST=NO
SO_COOKIE_FOUND=NO
NGX_LIBATOMIC=NO
NGX_CPU_CACHE_LINE=
NGX_POST_CONF_MSG=
opt=
for option
do
opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
case "$option" in
-*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) value="" ;;
@ -193,10 +126,8 @@ do
case "$option" in
--help) help=yes ;;
--prefix=) NGX_PREFIX="!" ;;
--prefix=*) NGX_PREFIX="$value" ;;
--sbin-path=*) NGX_SBIN_PATH="$value" ;;
--modules-path=*) NGX_MODULES_PATH="$value" ;;
--conf-path=*) NGX_CONF_PATH="$value" ;;
--error-log-path=*) NGX_ERROR_LOG_PATH="$value";;
--pid-path=*) NGX_PID_PATH="$value" ;;
@ -206,59 +137,30 @@ do
--crossbuild=*) NGX_PLATFORM="$value" ;;
--build=*) NGX_BUILD="$value" ;;
--builddir=*) NGX_OBJS="$value" ;;
--with-rtsig_module) EVENT_RTSIG=YES ;;
--with-select_module) EVENT_SELECT=YES ;;
--without-select_module) EVENT_SELECT=NONE ;;
--with-poll_module) EVENT_POLL=YES ;;
--without-poll_module) EVENT_POLL=NONE ;;
--with-aio_module) EVENT_AIO=YES ;;
--with-threads) USE_THREADS=YES ;;
--with-file-aio) NGX_FILE_AIO=YES ;;
--without-quic_bpf_module) QUIC_BPF=NONE ;;
--with-ipv6)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-ipv6\" option is deprecated"
;;
--with-threads=*) USE_THREADS="$value" ;;
--with-threads) USE_THREADS="pthreads" ;;
--without-http) HTTP=NO ;;
--without-http-cache) HTTP_CACHE=NO ;;
--http-log-path=*) NGX_HTTP_LOG_PATH="$value" ;;
--http-client-body-temp-path=*) NGX_HTTP_CLIENT_TEMP_PATH="$value" ;;
--http-proxy-temp-path=*) NGX_HTTP_PROXY_TEMP_PATH="$value" ;;
--http-fastcgi-temp-path=*) NGX_HTTP_FASTCGI_TEMP_PATH="$value" ;;
--http-uwsgi-temp-path=*) NGX_HTTP_UWSGI_TEMP_PATH="$value" ;;
--http-scgi-temp-path=*) NGX_HTTP_SCGI_TEMP_PATH="$value" ;;
--with-http_ssl_module) HTTP_SSL=YES ;;
--with-http_v2_module) HTTP_V2=YES ;;
--with-http_v3_module) HTTP_V3=YES ;;
--with-http_realip_module) HTTP_REALIP=YES ;;
--with-http_addition_module) HTTP_ADDITION=YES ;;
--with-http_xslt_module) HTTP_XSLT=YES ;;
--with-http_xslt_module=dynamic) HTTP_XSLT=DYNAMIC ;;
--with-http_image_filter_module) HTTP_IMAGE_FILTER=YES ;;
--with-http_image_filter_module=dynamic)
HTTP_IMAGE_FILTER=DYNAMIC ;;
--with-http_geoip_module) HTTP_GEOIP=YES ;;
--with-http_geoip_module=dynamic)
HTTP_GEOIP=DYNAMIC ;;
--with-http_sub_module) HTTP_SUB=YES ;;
--with-http_dav_module) HTTP_DAV=YES ;;
--with-http_flv_module) HTTP_FLV=YES ;;
--with-http_mp4_module) HTTP_MP4=YES ;;
--with-http_gunzip_module) HTTP_GUNZIP=YES ;;
--with-http_gzip_static_module) HTTP_GZIP_STATIC=YES ;;
--with-http_auth_request_module) HTTP_AUTH_REQUEST=YES ;;
--with-http_random_index_module) HTTP_RANDOM_INDEX=YES ;;
--with-http_secure_link_module) HTTP_SECURE_LINK=YES ;;
--with-http_degradation_module) HTTP_DEGRADATION=YES ;;
--with-http_slice_module) HTTP_SLICE=YES ;;
--without-http_charset_module) HTTP_CHARSET=NO ;;
--without-http_gzip_module) HTTP_GZIP=NO ;;
@ -266,35 +168,21 @@ $0: warning: the \"--with-ipv6\" option is deprecated"
--without-http_userid_module) HTTP_USERID=NO ;;
--without-http_access_module) HTTP_ACCESS=NO ;;
--without-http_auth_basic_module) HTTP_AUTH_BASIC=NO ;;
--without-http_mirror_module) HTTP_MIRROR=NO ;;
--without-http_autoindex_module) HTTP_AUTOINDEX=NO ;;
--without-http_status_module) HTTP_STATUS=NO ;;
--without-http_geo_module) HTTP_GEO=NO ;;
--without-http_map_module) HTTP_MAP=NO ;;
--without-http_split_clients_module) HTTP_SPLIT_CLIENTS=NO ;;
--without-http_referer_module) HTTP_REFERER=NO ;;
--without-http_rewrite_module) HTTP_REWRITE=NO ;;
--without-http_proxy_module) HTTP_PROXY=NO ;;
--without-http_fastcgi_module) HTTP_FASTCGI=NO ;;
--without-http_uwsgi_module) HTTP_UWSGI=NO ;;
--without-http_scgi_module) HTTP_SCGI=NO ;;
--without-http_grpc_module) HTTP_GRPC=NO ;;
--without-http_memcached_module) HTTP_MEMCACHED=NO ;;
--without-http_limit_conn_module) HTTP_LIMIT_CONN=NO ;;
--without-http_limit_req_module) HTTP_LIMIT_REQ=NO ;;
--without-http_limit_zone_module) HTTP_LIMIT_ZONE=NO ;;
--without-http_empty_gif_module) HTTP_EMPTY_GIF=NO ;;
--without-http_browser_module) HTTP_BROWSER=NO ;;
--without-http_upstream_hash_module) HTTP_UPSTREAM_HASH=NO ;;
--without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
--without-http_upstream_least_conn_module)
HTTP_UPSTREAM_LEAST_CONN=NO ;;
--without-http_upstream_random_module)
HTTP_UPSTREAM_RANDOM=NO ;;
--without-http_upstream_keepalive_module) HTTP_UPSTREAM_KEEPALIVE=NO ;;
--without-http_upstream_zone_module) HTTP_UPSTREAM_ZONE=NO ;;
--with-http_perl_module) HTTP_PERL=YES ;;
--with-http_perl_module=dynamic) HTTP_PERL=DYNAMIC ;;
--with-perl_modules_path=*) NGX_PERL_MODULES="$value" ;;
--with-perl=*) NGX_PERL="$value" ;;
@ -302,60 +190,15 @@ $0: warning: the \"--with-ipv6\" option is deprecated"
--with-http_stub_status_module) HTTP_STUB_STATUS=YES ;;
--with-mail) MAIL=YES ;;
--with-mail=dynamic) MAIL=DYNAMIC ;;
--with-mail_ssl_module) MAIL_SSL=YES ;;
# STUB
--with-imap)
MAIL=YES
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-imap\" option is deprecated, \
use the \"--with-mail\" option instead"
;;
--with-imap_ssl_module)
MAIL_SSL=YES
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-imap_ssl_module\" option is deprecated, \
use the \"--with-mail_ssl_module\" option instead"
;;
--with-imap) MAIL=YES ;;
--with-imap_ssl_module) MAIL_SSL=YES ;;
--without-mail_pop3_module) MAIL_POP3=NO ;;
--without-mail_imap_module) MAIL_IMAP=NO ;;
--without-mail_smtp_module) MAIL_SMTP=NO ;;
--with-stream) STREAM=YES ;;
--with-stream=dynamic) STREAM=DYNAMIC ;;
--with-stream_ssl_module) STREAM_SSL=YES ;;
--with-stream_quic_module) STREAM_QUIC=YES ;;
--with-stream_realip_module) STREAM_REALIP=YES ;;
--with-stream_geoip_module) STREAM_GEOIP=YES ;;
--with-stream_geoip_module=dynamic)
STREAM_GEOIP=DYNAMIC ;;
--with-stream_ssl_preread_module)
STREAM_SSL_PREREAD=YES ;;
--without-stream_limit_conn_module)
STREAM_LIMIT_CONN=NO ;;
--without-stream_access_module) STREAM_ACCESS=NO ;;
--without-stream_geo_module) STREAM_GEO=NO ;;
--without-stream_map_module) STREAM_MAP=NO ;;
--without-stream_split_clients_module)
STREAM_SPLIT_CLIENTS=NO ;;
--without-stream_return_module) STREAM_RETURN=NO ;;
--without-stream_set_module) STREAM_SET=NO ;;
--without-stream_upstream_hash_module)
STREAM_UPSTREAM_HASH=NO ;;
--without-stream_upstream_least_conn_module)
STREAM_UPSTREAM_LEAST_CONN=NO ;;
--without-stream_upstream_random_module)
STREAM_UPSTREAM_RANDOM=NO ;;
--without-stream_upstream_zone_module)
STREAM_UPSTREAM_ZONE=NO ;;
--with-google_perftools_module) NGX_GOOGLE_PERFTOOLS=YES ;;
--with-cpp_test_module) NGX_CPP_TEST=YES ;;
--add-module=*) NGX_ADDONS="$NGX_ADDONS $value" ;;
--add-dynamic-module=*) DYNAMIC_ADDONS="$DYNAMIC_ADDONS $value" ;;
--with-compat) NGX_COMPAT=YES ;;
--with-cc=*) CC="$value" ;;
--with-cpp=*) CPP="$value" ;;
@ -365,51 +208,28 @@ use the \"--with-mail_ssl_module\" option instead"
--with-debug) NGX_DEBUG=YES ;;
--without-pcre) USE_PCRE=DISABLED ;;
--with-pcre) USE_PCRE=YES ;;
--with-pcre=*) PCRE="$value" ;;
--with-pcre-opt=*) PCRE_OPT="$value" ;;
--with-pcre-jit) PCRE_JIT=YES ;;
--without-pcre2) PCRE2=DISABLED ;;
--with-openssl=*) OPENSSL="$value" ;;
--with-openssl-opt=*) OPENSSL_OPT="$value" ;;
--with-md5=*)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-md5\" option is deprecated"
;;
--with-md5-opt=*)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-md5-opt\" option is deprecated"
;;
--with-md5-asm)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-md5-asm\" option is deprecated"
;;
--with-md5=*) MD5="$value" ;;
--with-md5-opt=*) MD5_OPT="$value" ;;
--with-md5-asm) MD5_ASM=YES ;;
--with-sha1=*)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-sha1\" option is deprecated"
;;
--with-sha1-opt=*)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-sha1-opt\" option is deprecated"
;;
--with-sha1-asm)
NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
$0: warning: the \"--with-sha1-asm\" option is deprecated"
;;
--with-sha1=*) SHA1="$value" ;;
--with-sha1-opt=*) SHA1_OPT="$value" ;;
--with-sha1-asm) SHA1_ASM=YES ;;
--with-zlib=*) ZLIB="$value" ;;
--with-zlib-opt=*) ZLIB_OPT="$value" ;;
--with-zlib-asm=*) ZLIB_ASM="$value" ;;
--with-libatomic) NGX_LIBATOMIC=YES ;;
--with-libatomic=*) NGX_LIBATOMIC="$value" ;;
--test-build-devpoll) NGX_TEST_BUILD_DEVPOLL=YES ;;
--test-build-eventport) NGX_TEST_BUILD_EVENTPORT=YES ;;
--test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
--test-build-rtsig) NGX_TEST_BUILD_RTSIG=YES ;;
--test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
*)
@ -420,65 +240,38 @@ $0: warning: the \"--with-sha1-asm\" option is deprecated"
done
NGX_CONFIGURE="$opt"
if [ $help = yes ]; then
cat << END
--help print this message
--help this message
--prefix=PATH set installation prefix
--sbin-path=PATH set nginx binary pathname
--modules-path=PATH set modules path
--conf-path=PATH set nginx.conf pathname
--error-log-path=PATH set error log pathname
--pid-path=PATH set nginx.pid pathname
--lock-path=PATH set nginx.lock pathname
--prefix=PATH set the installation prefix
--sbin-path=PATH set path to the nginx binary file
--conf-path=PATH set path to the nginx.conf file
--error-log-path=PATH set path to the error log
--pid-path=PATH set path to nginx.pid file
--lock-path=PATH set path to nginx.lock file
--user=USER set non-privileged user for
worker processes
--group=GROUP set non-privileged group for
worker processes
--user=USER set non-privilege user
for the worker processes
--group=GROUP set non-privilege group
for the worker processes
--build=NAME set build name
--builddir=DIR set build directory
--builddir=DIR set the build directory
--with-rtsig_module enable rtsig module
--with-select_module enable select module
--without-select_module disable select module
--with-poll_module enable poll module
--without-poll_module disable poll module
--with-threads enable thread pool support
--with-file-aio enable file AIO support
--without-quic_bpf_module disable ngx_quic_bpf_module
--with-http_ssl_module enable ngx_http_ssl_module
--with-http_v2_module enable ngx_http_v2_module
--with-http_v3_module enable ngx_http_v3_module
--with-http_realip_module enable ngx_http_realip_module
--with-http_addition_module enable ngx_http_addition_module
--with-http_xslt_module enable ngx_http_xslt_module
--with-http_xslt_module=dynamic enable dynamic ngx_http_xslt_module
--with-http_image_filter_module enable ngx_http_image_filter_module
--with-http_image_filter_module=dynamic
enable dynamic ngx_http_image_filter_module
--with-http_geoip_module enable ngx_http_geoip_module
--with-http_geoip_module=dynamic enable dynamic ngx_http_geoip_module
--with-http_sub_module enable ngx_http_sub_module
--with-http_dav_module enable ngx_http_dav_module
--with-http_flv_module enable ngx_http_flv_module
--with-http_mp4_module enable ngx_http_mp4_module
--with-http_gunzip_module enable ngx_http_gunzip_module
--with-http_gzip_static_module enable ngx_http_gzip_static_module
--with-http_auth_request_module enable ngx_http_auth_request_module
--with-http_random_index_module enable ngx_http_random_index_module
--with-http_secure_link_module enable ngx_http_secure_link_module
--with-http_degradation_module enable ngx_http_degradation_module
--with-http_slice_module enable ngx_http_slice_module
--with-http_stub_status_module enable ngx_http_stub_status_module
--without-http_charset_module disable ngx_http_charset_module
@ -487,124 +280,71 @@ cat << END
--without-http_userid_module disable ngx_http_userid_module
--without-http_access_module disable ngx_http_access_module
--without-http_auth_basic_module disable ngx_http_auth_basic_module
--without-http_mirror_module disable ngx_http_mirror_module
--without-http_autoindex_module disable ngx_http_autoindex_module
--without-http_geo_module disable ngx_http_geo_module
--without-http_map_module disable ngx_http_map_module
--without-http_split_clients_module disable ngx_http_split_clients_module
--without-http_referer_module disable ngx_http_referer_module
--without-http_rewrite_module disable ngx_http_rewrite_module
--without-http_proxy_module disable ngx_http_proxy_module
--without-http_fastcgi_module disable ngx_http_fastcgi_module
--without-http_uwsgi_module disable ngx_http_uwsgi_module
--without-http_scgi_module disable ngx_http_scgi_module
--without-http_grpc_module disable ngx_http_grpc_module
--without-http_memcached_module disable ngx_http_memcached_module
--without-http_limit_conn_module disable ngx_http_limit_conn_module
--without-http_limit_req_module disable ngx_http_limit_req_module
--without-http_limit_zone_module disable ngx_http_limit_zone_module
--without-http_empty_gif_module disable ngx_http_empty_gif_module
--without-http_browser_module disable ngx_http_browser_module
--without-http_upstream_hash_module
disable ngx_http_upstream_hash_module
--without-http_upstream_ip_hash_module
disable ngx_http_upstream_ip_hash_module
--without-http_upstream_least_conn_module
disable ngx_http_upstream_least_conn_module
--without-http_upstream_random_module
disable ngx_http_upstream_random_module
--without-http_upstream_keepalive_module
disable ngx_http_upstream_keepalive_module
--without-http_upstream_zone_module
disable ngx_http_upstream_zone_module
--with-http_perl_module enable ngx_http_perl_module
--with-http_perl_module=dynamic enable dynamic ngx_http_perl_module
--with-perl_modules_path=PATH set Perl modules path
--with-perl=PATH set perl binary pathname
--with-perl_modules_path=PATH set path to the perl modules
--with-perl=PATH set path to the perl binary
--http-log-path=PATH set http access log pathname
--http-client-body-temp-path=PATH set path to store
http client request body temporary files
--http-proxy-temp-path=PATH set path to store
http proxy temporary files
--http-fastcgi-temp-path=PATH set path to store
http fastcgi temporary files
--http-uwsgi-temp-path=PATH set path to store
http uwsgi temporary files
--http-scgi-temp-path=PATH set path to store
http scgi temporary files
--http-log-path=PATH set path to the http access log
--http-client-body-temp-path=PATH set path to the http client request body
temporary files
--http-proxy-temp-path=PATH set path to the http proxy temporary files
--http-fastcgi-temp-path=PATH set path to the http fastcgi temporary
files
--without-http disable HTTP server
--without-http-cache disable HTTP cache
--with-mail enable POP3/IMAP4/SMTP proxy module
--with-mail=dynamic enable dynamic POP3/IMAP4/SMTP proxy module
--with-mail_ssl_module enable ngx_mail_ssl_module
--without-mail_pop3_module disable ngx_mail_pop3_module
--without-mail_imap_module disable ngx_mail_imap_module
--without-mail_smtp_module disable ngx_mail_smtp_module
--with-stream enable TCP/UDP proxy module
--with-stream=dynamic enable dynamic TCP/UDP proxy module
--with-stream_ssl_module enable ngx_stream_ssl_module
--with-stream_quic_module enable ngx_stream_quic_module
--with-stream_realip_module enable ngx_stream_realip_module
--with-stream_geoip_module enable ngx_stream_geoip_module
--with-stream_geoip_module=dynamic enable dynamic ngx_stream_geoip_module
--with-stream_ssl_preread_module enable ngx_stream_ssl_preread_module
--without-stream_limit_conn_module disable ngx_stream_limit_conn_module
--without-stream_access_module disable ngx_stream_access_module
--without-stream_geo_module disable ngx_stream_geo_module
--without-stream_map_module disable ngx_stream_map_module
--without-stream_split_clients_module
disable ngx_stream_split_clients_module
--without-stream_return_module disable ngx_stream_return_module
--without-stream_set_module disable ngx_stream_set_module
--without-stream_upstream_hash_module
disable ngx_stream_upstream_hash_module
--without-stream_upstream_least_conn_module
disable ngx_stream_upstream_least_conn_module
--without-stream_upstream_random_module
disable ngx_stream_upstream_random_module
--without-stream_upstream_zone_module
disable ngx_stream_upstream_zone_module
--add-module=PATH enable an external module
--with-google_perftools_module enable ngx_google_perftools_module
--with-cpp_test_module enable ngx_cpp_test_module
--add-module=PATH enable external module
--add-dynamic-module=PATH enable dynamic external module
--with-compat dynamic modules compatibility
--with-cc=PATH set C compiler pathname
--with-cpp=PATH set C preprocessor pathname
--with-cc-opt=OPTIONS set additional C compiler options
--with-ld-opt=OPTIONS set additional linker options
--with-cpu-opt=CPU build for the specified CPU, valid values:
--with-cc=PATH set path to C compiler
--with-cpp=PATH set path to C preprocessor
--with-cc-opt=OPTIONS set additional options for C compiler
--with-ld-opt=OPTIONS set additional options for linker
--with-cpu-opt=CPU build for specified CPU, the valid values:
pentium, pentiumpro, pentium3, pentium4,
athlon, opteron, sparc32, sparc64, ppc64
--without-pcre disable PCRE library usage
--with-pcre force PCRE library usage
--without-pcre disable PCRE libarary usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional build options for PCRE
--with-pcre-jit build PCRE with JIT compilation support
--without-pcre2 do not use PCRE2 library
--with-pcre-opt=OPTIONS set additional options for PCRE building
--with-md5=DIR set path to md5 library sources
--with-md5-opt=OPTIONS set additional options for md5 building
--with-md5-asm use md5 assembler sources
--with-sha1=DIR set path to sha1 library sources
--with-sha1-opt=OPTIONS set additional options for sha1 building
--with-sha1-asm use sha1 assembler sources
--with-zlib=DIR set path to zlib library sources
--with-zlib-opt=OPTIONS set additional build options for zlib
--with-zlib-opt=OPTIONS set additional options for zlib building
--with-zlib-asm=CPU use zlib assembler sources optimized
for the specified CPU, valid values:
for specified CPU, the valid values:
pentium, pentiumpro
--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources
--with-openssl=DIR set path to OpenSSL library sources
--with-openssl-opt=OPTIONS set additional build options for OpenSSL
--with-openssl-opt=OPTIONS set additional options for OpenSSL building
--with-debug enable debug logging
--with-debug enable the debugging logging
END
@ -612,30 +352,156 @@ END
fi
if [ $HTTP = NO ]; then
HTTP_CHARSET=NO
HTTP_GZIP=NO
HTTP_SSI=NO
HTTP_USERID=NO
HTTP_ACCESS=NO
HTTP_STATUS=NO
HTTP_REWRITE=NO
HTTP_PROXY=NO
HTTP_FASTCGI=NO
fi
if [ ".$NGX_PLATFORM" = ".win32" ]; then
NGX_WINE=$WINE
fi
NGX_SBIN_PATH=${NGX_SBIN_PATH:-sbin/nginx}
NGX_MODULES_PATH=${NGX_MODULES_PATH:-modules}
NGX_CONF_PATH=${NGX_CONF_PATH:-conf/nginx.conf}
NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
NGX_PID_PATH=${NGX_PID_PATH:-logs/nginx.pid}
NGX_LOCK_PATH=${NGX_LOCK_PATH:-logs/nginx.lock}
NGX_PREFIX=${NGX_PREFIX:-/usr/local/nginx}
if [ ".$NGX_ERROR_LOG_PATH" = ".stderr" ]; then
NGX_ERROR_LOG_PATH=
else
NGX_ERROR_LOG_PATH=${NGX_ERROR_LOG_PATH:-logs/error.log}
fi
NGX_HTTP_LOG_PATH=${NGX_HTTP_LOG_PATH:-logs/access.log}
NGX_HTTP_CLIENT_TEMP_PATH=${NGX_HTTP_CLIENT_TEMP_PATH:-client_body_temp}
NGX_HTTP_PROXY_TEMP_PATH=${NGX_HTTP_PROXY_TEMP_PATH:-proxy_temp}
NGX_HTTP_FASTCGI_TEMP_PATH=${NGX_HTTP_FASTCGI_TEMP_PATH:-fastcgi_temp}
NGX_HTTP_UWSGI_TEMP_PATH=${NGX_HTTP_UWSGI_TEMP_PATH:-uwsgi_temp}
NGX_HTTP_SCGI_TEMP_PATH=${NGX_HTTP_SCGI_TEMP_PATH:-scgi_temp}
case ".$NGX_SBIN_PATH" in
./*)
;;
.)
NGX_SBIN_PATH=$NGX_PREFIX/sbin/nginx
;;
*)
NGX_SBIN_PATH=$NGX_PREFIX/$NGX_SBIN_PATH
;;
esac
case ".$NGX_CONF_PATH" in
./*)
;;
.)
NGX_CONF_PATH=$NGX_PREFIX/conf/nginx.conf
;;
*)
NGX_CONF_PATH=$NGX_PREFIX/$NGX_CONF_PATH
;;
esac
case ".$NGX_PID_PATH" in
./*)
;;
.)
NGX_PID_PATH=$NGX_PREFIX/logs/nginx.pid
;;
*)
NGX_PID_PATH=$NGX_PREFIX/$NGX_PID_PATH
;;
esac
case ".$NGX_LOCK_PATH" in
./*)
;;
.)
NGX_LOCK_PATH=$NGX_PREFIX/logs/nginx.lock
;;
*)
NGX_LOCK_PATH=$NGX_PREFIX/$NGX_LOCK_PATH
;;
esac
case ".$NGX_ERROR_LOG_PATH" in
./*)
;;
.)
NGX_ERROR_LOG_PATH=$NGX_PREFIX/logs/error.log
;;
.stderr)
NGX_ERROR_LOG_PATH=
;;
*)
NGX_ERROR_LOG_PATH=$NGX_PREFIX/$NGX_ERROR_LOG_PATH
;;
esac
case ".$NGX_HTTP_LOG_PATH" in
./*)
;;
.)
NGX_HTTP_LOG_PATH=$NGX_PREFIX/logs/access.log
;;
*)
NGX_HTTP_LOG_PATH=$NGX_PREFIX/$NGX_HTTP_LOG_PATH
;;
esac
case ".$NGX_HTTP_CLIENT_TEMP_PATH" in
./*)
;;
.)
NGX_HTTP_CLIENT_TEMP_PATH=$NGX_PREFIX/client_body_temp
;;
*)
NGX_HTTP_CLIENT_TEMP_PATH=$NGX_PREFIX/$NGX_HTTP_CLIENT_TEMP_PATH
;;
esac
case ".$NGX_HTTP_PROXY_TEMP_PATH" in
./*)
;;
.)
NGX_HTTP_PROXY_TEMP_PATH=$NGX_PREFIX/proxy_temp
;;
*)
NGX_HTTP_PROXY_TEMP_PATH=$NGX_PREFIX/$NGX_HTTP_PROXY_TEMP_PATH
;;
esac
case ".$NGX_HTTP_FASTCGI_TEMP_PATH" in
./*)
;;
.)
NGX_HTTP_FASTCGI_TEMP_PATH=$NGX_PREFIX/fastcgi_temp
;;
*)
NGX_HTTP_FASTCGI_TEMP_PATH=$NGX_PREFIX/$NGX_HTTP_FASTCGI_TEMP_PATH
;;
esac
case ".$NGX_PERL_MODULES" in
./*)

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo "checking for $NGX_SYSTEM specific features"
@ -19,10 +18,6 @@ case "$NGX_PLATFORM" in
. auto/os/solaris
;;
Darwin:*)
. auto/os/darwin
;;
win32)
. auto/os/win32
;;
@ -41,12 +36,22 @@ case "$NGX_PLATFORM" in
'
;;
NetBSD:*)
Darwin:*)
have=NGX_DARWIN . auto/have_headers
have=NGX_HAVE_INHERITED_NONBLOCK . auto/have
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
CORE_SRCS="$UNIX_SRCS"
NGX_RPATH=YES
ngx_feature="atomic(3)"
ngx_feature_name=NGX_DARWIN_ATOMIC
ngx_feature_run=no
ngx_feature_incs="#include <libkern/OSAtomic.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int32_t lock, n;
n = OSAtomicCompareAndSwap32Barrier(0, 1, lock)"
. auto/feature
;;
HP-UX:*)
@ -56,7 +61,6 @@ case "$NGX_PLATFORM" in
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
CORE_SRCS="$UNIX_SRCS"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_HPUX_ALT_XOPEN_SOCKET_API"
;;
OSF1:*)
@ -68,15 +72,6 @@ case "$NGX_PLATFORM" in
CORE_SRCS="$UNIX_SRCS"
;;
GNU:*)
# GNU Hurd
have=NGX_GNU_HURD . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
CORE_SRCS="$UNIX_SRCS"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
;;
*)
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
@ -110,13 +105,7 @@ case "$NGX_MACHINE" in
NGX_MACH_CACHE_LINE=64
;;
aarch64 | arm64)
have=NGX_ALIGNMENT value=16 . auto/define
NGX_MACH_CACHE_LINE=64
;;
*)
have=NGX_ALIGNMENT value=16 . auto/define
NGX_MACH_CACHE_LINE=32
;;

View File

@ -1,120 +0,0 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_DARWIN . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $DARWIN_DEPS"
CORE_SRCS="$UNIX_SRCS $DARWIN_SRCS"
ngx_spacer='
'
MAIN_LINK=
MODULE_LINK="-shared -Wl,-undefined,dynamic_lookup"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D__APPLE_USE_RFC_3542"
# kqueue
echo " + kqueue found"
have=NGX_HAVE_KQUEUE . auto/have
have=NGX_HAVE_CLEAR_EVENT . auto/have
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
EVENT_FOUND=YES
NGX_KQUEUE_CHECKED=YES
ngx_feature="kqueue's EVFILT_TIMER"
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
if ((kq = kqueue()) == -1) return 1;
kev.ident = 0;
kev.filter = EVFILT_TIMER;
kev.flags = EV_ADD|EV_ENABLE;
kev.fflags = 0;
kev.data = 1000;
kev.udata = 0;
ts.tv_sec = 0;
ts.tv_nsec = 0;
if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
if (kev.flags & EV_ERROR) return 1;"
. auto/feature
ngx_feature="Darwin 64-bit kqueue millisecond timeout bug"
ngx_feature_name=NGX_DARWIN_KEVENT_BUG
ngx_feature_run=bug
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
struct timeval tv, tv0;
kq = kqueue();
ts.tv_sec = 0;
ts.tv_nsec = 999000000;
gettimeofday(&tv, 0);
kevent(kq, NULL, 0, &kev, 1, &ts);
gettimeofday(&tv0, 0);
timersub(&tv0, &tv, &tv);
if (tv.tv_sec * 1000000 + tv.tv_usec < 900000) return 1;"
. auto/feature
# sendfile()
ngx_feature="sendfile()"
ngx_feature_name="NGX_HAVE_SENDFILE"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/errno.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int s = 0, fd = 1;
off_t n; off_t off = 0;
n = sendfile(s, fd, off, &n, NULL, 0);
if (n == -1 && errno == ENOSYS) return 1"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $DARWIN_SENDFILE_SRCS"
fi
ngx_feature="atomic(3)"
ngx_feature_name=NGX_DARWIN_ATOMIC
ngx_feature_run=no
ngx_feature_incs="#include <libkern/OSAtomic.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int32_t lock = 0;
if (!OSAtomicCompareAndSwap32Barrier(0, 1, &lock)) return 1"
. auto/feature

202
auto/os/features Normal file
View File

@ -0,0 +1,202 @@
# Copyright (C) Igor Sysoev
NGX_USER=${NGX_USER:-nobody}
if [ -z "$NGX_GROUP" ]; then
if [ $NGX_USER = nobody ]; then
if grep nobody /etc/group 2>&1 >/dev/null; then
echo "checking for nobody group ... found"
NGX_GROUP=nobody
else
echo "checking for nobody group ... not found"
if grep nogroup /etc/group 2>&1 >/dev/null; then
echo "checking for nogroup group ... found"
NGX_GROUP=nogroup
else
echo "checking for nogroup group ... not found"
NGX_GROUP=nobody
fi
fi
else
NGX_GROUP=$NGX_USER
fi
fi
ngx_feature="poll()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <poll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n, dp; struct pollfd pl;
dp = 0;
pl.fd = 0;
pl.events = 0;
pl.revents = 0;
n = poll(&pl, 1, 0)"
. auto/feature
if [ $ngx_found = no ]; then
EVENT_POLL=NONE
fi
ngx_feature="/dev/poll"
ngx_feature_name="NGX_HAVE_DEVPOLL"
ngx_feature_run=no
ngx_feature_incs="#include <sys/devpoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n, dp; struct dvpoll dvp;
dp = 0;
dvp.dp_fds = NULL;
dvp.dp_nfds = 0;
dvp.dp_timeout = 0;
n = ioctl(dp, DP_POLL, &dvp)"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
EVENT_FOUND=YES
fi
if test -z "$NGX_KQUEUE_CHECKED"; then
ngx_feature="kqueue"
ngx_feature_name="NGX_HAVE_KQUEUE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/event.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq; kq = kqueue()"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_CLEAR_EVENT . auto/have
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
EVENT_FOUND=YES
ngx_feature="kqueue's NOTE_LOWAT"
ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/event.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct kevent kev;
kev.fflags = NOTE_LOWAT;"
. auto/feature
ngx_feature="kqueue's EVFILT_TIMER"
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
if ((kq = kqueue()) == -1) return 1;
kev.ident = 0;
kev.filter = EVFILT_TIMER;
kev.flags = EV_ADD|EV_ENABLE;
kev.fflags = 0;
kev.data = 1000;
kev.udata = 0;
ts.tv_sec = 0;
ts.tv_nsec = 0;
if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
if (kev.flags & EV_ERROR) return 1;"
. auto/feature
if [ "$NGX_SYSTEM" = "Darwin" ]; then
ngx_feature="Darwin 64-bit kqueue millisecond timeout bug"
ngx_feature_name=NGX_DARWIN_KEVENT_BUG
ngx_feature_run=bug
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
struct timeval tv, tv0;
kq = kqueue();
ts.tv_sec = 0;
ts.tv_nsec = 999000000;
gettimeofday(&tv, 0);
kevent(kq, NULL, 0, &kev, 1, &ts);
gettimeofday(&tv0, 0);
timersub(&tv0, &tv, &tv);
if (tv.tv_sec * 1000000 + tv.tv_usec < 900000) return 1;"
. auto/feature
fi
fi
fi
if [ "$NGX_SYSTEM" = "NetBSD" ]; then
# NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
cat << END >> $NGX_AUTO_CONFIG_H
#define NGX_KQUEUE_UDATA_T
END
else
cat << END >> $NGX_AUTO_CONFIG_H
#define NGX_KQUEUE_UDATA_T (void *)
END
fi
ngx_feature="crypt()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="crypt(\"test\", \"salt\");"
. auto/feature
if [ $ngx_found = no ]; then
ngx_feature="crypt() in libcrypt"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=-lcrypt
. auto/feature
if [ $ngx_found = yes ]; then
CRYPT_LIB="-lcrypt"
fi
fi

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_FREEBSD . auto/have_headers
@ -44,21 +43,6 @@ if [ $osreldate -gt 300007 ]; then
CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
fi
if [ $osreldate -gt 1100093 ]; then
echo " + sendfile()'s SF_NODISKIO found"
have=NGX_HAVE_SENDFILE_NODISKIO . auto/have
fi
# POSIX semaphores
# http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545
if [ $osreldate -ge 701106 ]; then
echo " + POSIX semaphores should work"
else
have=NGX_HAVE_POSIX_SEM . auto/nohave
fi
# kqueue
@ -78,7 +62,7 @@ fi
NGX_KQUEUE_CHECKED=YES
# kqueue's NOTE_LOWAT
# kqueue's NOTE_LAWAT
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500018 ]
@ -97,9 +81,40 @@ then
fi
# cpuset_setaffinity()
if [ $USE_THREADS = "rfork" ]; then
if [ $version -ge 701000 ]; then
echo " + cpuset_setaffinity() found"
have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
echo " + using rfork()"
# # kqueue's EVFILT_SIGNAL is safe
#
# if [ $version -gt 460101 ]; then
# echo " + kqueue's EVFILT_SIGNAL is safe"
# have=NGX_HAVE_SAFE_EVFILT_SIGNAL . auto/have
# else
# echo "$0: error: the kqueue's EVFILT_SIGNAL is unsafe on this"
# echo "FreeBSD version, so --with-threads=rfork could not be used"
# echo
#
# exit 1
# fi
fi
if [ $EVENT_AIO = YES ]; then
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500014 ]
then
have=NGX_HAVE_AIO . auto/have
EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
CORE_SRCS="$CORE_SRCS $AIO_SRCS"
else
cat << END
$0: error: the kqueue does not support AIO on this FreeBSD version
END
exit 1
fi
fi

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_LINUX . auto/have_headers
@ -12,26 +11,29 @@ CORE_SRCS="$UNIX_SRCS $LINUX_SRCS"
ngx_spacer='
'
cc_aux_flags="$CC_AUX_FLAGS"
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
# Linux kernel version
version=$((`uname -r \
| sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \
\1*256*256+\2*256+\3/p' \
-e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`))
version=`grep "#define LINUX_VERSION_CODE" /usr/include/linux/version.h \
| sed -e 's/^.* \(.*\)$/\1/'`
version=${version:-0}
# posix_fadvise64() had been implemented in 2.5.60
# enable the rt signals on Linux 2.2.19 and onward
if [ $version -lt 132412 ]; then
have=NGX_HAVE_POSIX_FADVISE . auto/nohave
if [ $version -ge 131609 -o $EVENT_RTSIG = YES ]; then
echo " + rt signals found"
have=NGX_HAVE_RTSIG . auto/have
have=NGX_HAVE_POLL . auto/have
EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
EVENT_FOUND=YES
fi
# epoll, EPOLLET version
ngx_feature="epoll"
@ -40,11 +42,10 @@ ngx_feature_run=yes
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int efd = 0;
ngx_feature_test="int efd = 0, fd = 1, n;
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
ee.data.ptr = NULL;
(void) ee;
efd = epoll_create(100);
if (efd == -1) return 1;"
. auto/feature
@ -54,90 +55,17 @@ if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
EVENT_FOUND=YES
# EPOLLRDHUP appeared in Linux 2.6.17, glibc 2.8
ngx_feature="EPOLLRDHUP"
ngx_feature_name="NGX_HAVE_EPOLLRDHUP"
ngx_feature_run=no
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int efd = 0, fd = 0;
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLRDHUP|EPOLLET;
ee.data.ptr = NULL;
epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
. auto/feature
# EPOLLEXCLUSIVE appeared in Linux 4.5, glibc 2.24
ngx_feature="EPOLLEXCLUSIVE"
ngx_feature_name="NGX_HAVE_EPOLLEXCLUSIVE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/epoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int efd = 0, fd = 0;
struct epoll_event ee;
ee.events = EPOLLIN|EPOLLEXCLUSIVE;
ee.data.ptr = NULL;
epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
. auto/feature
# eventfd()
ngx_feature="eventfd()"
ngx_feature_name="NGX_HAVE_EVENTFD"
ngx_feature_run=no
ngx_feature_incs="#include <sys/eventfd.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="(void) eventfd(0, 0)"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_SYS_EVENTFD_H . auto/have
fi
if [ $ngx_found = no ]; then
ngx_feature="eventfd() (SYS_eventfd)"
ngx_feature_incs="#include <sys/syscall.h>"
ngx_feature_test="(void) SYS_eventfd"
. auto/feature
fi
fi
# O_PATH and AT_EMPTY_PATH were introduced in 2.6.39, glibc 2.14
ngx_feature="O_PATH"
ngx_feature_name="NGX_HAVE_O_PATH"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int fd; struct stat sb;
fd = openat(AT_FDCWD, \".\", O_PATH|O_DIRECTORY|O_NOFOLLOW);
if (fstatat(fd, \"\", &sb, AT_EMPTY_PATH) != 0) return 1"
. auto/feature
# sendfile()
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_GNU_SOURCE"
ngx_feature="sendfile()"
ngx_feature_name="NGX_HAVE_SENDFILE"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
#include <errno.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int s = 0, fd = 1;
@ -153,12 +81,12 @@ fi
# sendfile64()
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_FILE_OFFSET_BITS=64"
ngx_feature="sendfile64()"
ngx_feature_name="NGX_HAVE_SENDFILE64"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/sendfile.h>
#include <errno.h>"
#include <errno.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int s = 0, fd = 1;
@ -182,113 +110,14 @@ ngx_feature_test="if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) return 1"
. auto/feature
# prctl(PR_SET_KEEPCAPS)
# sched_setaffinity()
ngx_feature="prctl(PR_SET_KEEPCAPS)"
ngx_feature_name="NGX_HAVE_PR_SET_KEEPCAPS"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/prctl.h>"
ngx_feature="sched_setaffinity()"
ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
ngx_feature_run=no
ngx_feature_incs="#include <sched.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) == -1) return 1"
ngx_feature_test="long mask = 0;
sched_setaffinity(0, 32, (cpu_set_t *) &mask)"
. auto/feature
# capabilities
ngx_feature="capabilities"
ngx_feature_name="NGX_HAVE_CAPABILITIES"
ngx_feature_run=no
ngx_feature_incs="#include <linux/capability.h>
#include <sys/syscall.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct __user_cap_data_struct data;
struct __user_cap_header_struct header;
header.version = _LINUX_CAPABILITY_VERSION_1;
data.effective = CAP_TO_MASK(CAP_NET_RAW);
data.permitted = 0;
(void) header;
(void) data;
(void) SYS_capset"
. auto/feature
# crypt_r()
ngx_feature="crypt_r()"
ngx_feature_name="NGX_HAVE_GNU_CRYPT_R"
ngx_feature_run=no
ngx_feature_incs="#include <crypt.h>"
ngx_feature_path=
ngx_feature_libs=-lcrypt
ngx_feature_test="struct crypt_data cd;
crypt_r(\"key\", \"salt\", &cd);"
. auto/feature
ngx_include="sys/vfs.h"; . auto/include
# BPF sockhash
ngx_feature="BPF sockhash"
ngx_feature_name="NGX_HAVE_BPF"
ngx_feature_run=no
ngx_feature_incs="#include <linux/bpf.h>
#include <sys/syscall.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="union bpf_attr attr = { 0 };
attr.map_flags = 0;
attr.map_type = BPF_MAP_TYPE_SOCKHASH;
syscall(__NR_bpf, 0, &attr, 0);"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS src/core/ngx_bpf.c"
CORE_DEPS="$CORE_DEPS src/core/ngx_bpf.h"
if [ $QUIC_BPF != NONE ]; then
QUIC_BPF=YES
fi
fi
ngx_feature="SO_COOKIE"
ngx_feature_name="NGX_HAVE_SO_COOKIE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
$NGX_INCLUDE_INTTYPES_H"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(uint64_t);
uint64_t cookie;
getsockopt(0, SOL_SOCKET, SO_COOKIE, &cookie, &optlen)"
. auto/feature
if [ $ngx_found = yes ]; then
SO_COOKIE_FOUND=YES
fi
# UDP segmentation offloading
ngx_feature="UDP_SEGMENT"
ngx_feature_name="NGX_HAVE_UDP_SEGMENT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/udp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(int);
int val;
getsockopt(0, SOL_UDP, UDP_SEGMENT, &val, &optlen)"
. auto/feature
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_SOLARIS . auto/have_headers
@ -8,14 +7,14 @@ have=NGX_SOLARIS . auto/have_headers
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS"
CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
CORE_LIBS="$CORE_LIBS -lsocket -lnsl"
CORE_LIBS="$CORE_LIBS -lsocket -lnsl -lrt"
NGX_RPATH=YES
# Solaris's make does not support a blank line between target and rules
ngx_spacer=
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_FILE_OFFSET_BITS=64 -lsocket -lnsl"
CC_AUX_FLAGS="$CC_AUX_FLAGS -D_FILE_OFFSET_BITS=64 -lsocket -lnsl -lrt"
if [ $ZLIB_ASM != NO ]; then
@ -35,8 +34,7 @@ ngx_feature_path=
ngx_feature_libs="-lsendfile"
ngx_feature_test="int fd = 1; sendfilevec_t vec[1];
size_t sent; ssize_t n;
n = sendfilev(fd, vec, 1, &sent);
if (n == -1) return 1"
n = sendfilev(fd, vec, 1, &sent)"
. auto/feature
@ -52,7 +50,7 @@ ngx_feature_run=no
ngx_feature_incs="#include <port.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="(void) port_create()"
ngx_feature_test="int n = port_create()"
. auto/feature
if [ $ngx_found = yes ]; then

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_WIN32 . auto/have_headers
@ -9,31 +8,16 @@ CORE_INCS="$WIN32_INCS"
CORE_DEPS="$WIN32_DEPS"
CORE_SRCS="$WIN32_SRCS $IOCP_SRCS"
OS_CONFIG="$WIN32_CONFIG"
CORE_LIBS="$CORE_LIBS shell32.lib ws2_32.lib"
NGX_ICONS="$NGX_WIN32_ICONS"
SELECT_SRCS=$WIN32_SELECT_SRCS
POLL_SRCS=$WIN32_POLL_SRCS
ngx_pic_opt=
ngx_binext=".exe"
case "$NGX_CC_NAME" in
gcc)
CORE_LIBS="$CORE_LIBS -ladvapi32 -lws2_32"
MAIN_LINK="$MAIN_LINK -Wl,--export-all-symbols"
MAIN_LINK="$MAIN_LINK -Wl,--out-implib=$NGX_OBJS/libnginx.a"
MODULE_LINK="-shared -L $NGX_OBJS -lnginx"
;;
*)
CORE_LIBS="$CORE_LIBS advapi32.lib ws2_32.lib"
;;
esac
EVENT_MODULES="$EVENT_MODULES $IOCP_MODULE"
#EVENT_FOUND=YES
EVENT_FOUND=YES
have=NGX_HAVE_INET6 . auto/have
if [ $EVENT_SELECT = NO ]; then
CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
fi
have=NGX_HAVE_AIO . auto/have
have=NGX_HAVE_IOCP . auto/have

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CORE_MODULES="ngx_core_module ngx_errlog_module ngx_conf_module"
@ -16,32 +15,23 @@ CORE_DEPS="src/core/nginx.h \
src/core/ngx_list.h \
src/core/ngx_hash.h \
src/core/ngx_buf.h \
src/core/ngx_queue.h \
src/core/ngx_string.h \
src/core/ngx_parse.h \
src/core/ngx_parse_time.h \
src/core/ngx_inet.h \
src/core/ngx_file.h \
src/core/ngx_crc.h \
src/core/ngx_crc32.h \
src/core/ngx_murmurhash.h \
src/core/ngx_md5.h \
src/core/ngx_sha1.h \
src/core/ngx_rbtree.h \
src/core/ngx_radix_tree.h \
src/core/ngx_rwlock.h \
src/core/ngx_slab.h \
src/core/ngx_times.h \
src/core/ngx_shmtx.h \
src/core/ngx_connection.h \
src/core/ngx_cycle.h \
src/core/ngx_conf_file.h \
src/core/ngx_module.h \
src/core/ngx_resolver.h \
src/core/ngx_open_file_cache.h \
src/core/ngx_crypt.h \
src/core/ngx_proxy_protocol.h \
src/core/ngx_syslog.h"
src/core/ngx_garbage_collector.h"
CORE_SRCS="src/core/nginx.c \
@ -51,17 +41,12 @@ CORE_SRCS="src/core/nginx.c \
src/core/ngx_list.c \
src/core/ngx_hash.c \
src/core/ngx_buf.c \
src/core/ngx_queue.c \
src/core/ngx_output_chain.c \
src/core/ngx_string.c \
src/core/ngx_parse.c \
src/core/ngx_parse_time.c \
src/core/ngx_inet.c \
src/core/ngx_file.c \
src/core/ngx_crc32.c \
src/core/ngx_murmurhash.c \
src/core/ngx_md5.c \
src/core/ngx_sha1.c \
src/core/ngx_rbtree.c \
src/core/ngx_radix_tree.c \
src/core/ngx_slab.c \
@ -70,44 +55,45 @@ CORE_SRCS="src/core/nginx.c \
src/core/ngx_connection.c \
src/core/ngx_cycle.c \
src/core/ngx_spinlock.c \
src/core/ngx_rwlock.c \
src/core/ngx_cpuinfo.c \
src/core/ngx_conf_file.c \
src/core/ngx_module.c \
src/core/ngx_resolver.c \
src/core/ngx_open_file_cache.c \
src/core/ngx_crypt.c \
src/core/ngx_proxy_protocol.c \
src/core/ngx_syslog.c"
src/core/ngx_garbage_collector.c"
REGEX_DEPS=src/core/ngx_regex.h
REGEX_SRCS=src/core/ngx_regex.c
OPENSSL_MODULE=ngx_openssl_module
OPENSSL_DEPS=src/event/ngx_event_openssl.h
OPENSSL_SRCS=src/event/ngx_event_openssl.c
EVENT_MODULES="ngx_events_module ngx_event_core_module"
EVENT_INCS="src/event src/event/modules src/event/quic"
EVENT_INCS="src/event src/event/modules"
EVENT_DEPS="src/event/ngx_event.h \
src/event/ngx_event_timer.h \
src/event/ngx_event_posted.h \
src/event/ngx_event_busy_lock.h \
src/event/ngx_event_connect.h \
src/event/ngx_event_pipe.h \
src/event/ngx_event_udp.h"
src/event/ngx_event_pipe.h"
EVENT_SRCS="src/event/ngx_event.c \
src/event/ngx_event_timer.c \
src/event/ngx_event_posted.c \
src/event/ngx_event_busy_lock.c \
src/event/ngx_event_accept.c \
src/event/ngx_event_udp.c \
src/event/ngx_event_connect.c \
src/event/ngx_event_pipe.c"
SELECT_MODULE=ngx_select_module
SELECT_SRCS=src/event/modules/ngx_select_module.c
WIN32_SELECT_SRCS=src/event/modules/ngx_win32_select_module.c
POLL_MODULE=ngx_poll_module
POLL_SRCS=src/event/modules/ngx_poll_module.c
WIN32_POLL_SRCS=src/event/modules/ngx_win32_poll_module.c
KQUEUE_MODULE=ngx_kqueue_module
KQUEUE_SRCS=src/event/modules/ngx_kqueue_module.c
@ -121,23 +107,31 @@ EVENTPORT_SRCS=src/event/modules/ngx_eventport_module.c
EPOLL_MODULE=ngx_epoll_module
EPOLL_SRCS=src/event/modules/ngx_epoll_module.c
RTSIG_MODULE=ngx_rtsig_module
RTSIG_SRCS=src/event/modules/ngx_rtsig_module.c
IOCP_MODULE=ngx_iocp_module
IOCP_SRCS=src/event/modules/ngx_iocp_module.c
FILE_AIO_SRCS="src/os/unix/ngx_file_aio_read.c"
LINUX_AIO_SRCS="src/os/unix/ngx_linux_aio_read.c"
AIO_MODULE=ngx_aio_module
AIO_SRCS="src/event/modules/ngx_aio_module.c \
src/os/unix/ngx_aio_read.c \
src/os/unix/ngx_aio_write.c \
src/os/unix/ngx_aio_read_chain.c \
src/os/unix/ngx_aio_write_chain.c"
UNIX_INCS="$CORE_INCS $EVENT_INCS src/os/unix"
UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/unix/ngx_time.h \
src/os/unix/ngx_types.h \
src/os/unix/ngx_errno.h \
src/os/unix/ngx_alloc.h \
src/os/unix/ngx_files.h \
src/os/unix/ngx_channel.h \
src/os/unix/ngx_shmem.h \
src/os/unix/ngx_process.h \
src/os/unix/ngx_setaffinity.h \
src/os/unix/ngx_setproctitle.h \
src/os/unix/ngx_atomic.h \
src/os/unix/ngx_gcc_atomic_x86.h \
@ -145,7 +139,6 @@ UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/unix/ngx_socket.h \
src/os/unix/ngx_os.h \
src/os/unix/ngx_user.h \
src/os/unix/ngx_dlopen.h \
src/os/unix/ngx_process_cycle.h"
# add to UNIX_DEPS
@ -166,55 +159,44 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \
src/os/unix/ngx_socket.c \
src/os/unix/ngx_recv.c \
src/os/unix/ngx_readv_chain.c \
src/os/unix/ngx_udp_recv.c \
src/os/unix/ngx_send.c \
src/os/unix/ngx_writev_chain.c \
src/os/unix/ngx_udp_send.c \
src/os/unix/ngx_udp_sendmsg_chain.c \
src/os/unix/ngx_channel.c \
src/os/unix/ngx_shmem.c \
src/os/unix/ngx_process.c \
src/os/unix/ngx_daemon.c \
src/os/unix/ngx_setaffinity.c \
src/os/unix/ngx_setproctitle.c \
src/os/unix/ngx_posix_init.c \
src/os/unix/ngx_user.c \
src/os/unix/ngx_dlopen.c \
src/os/unix/ngx_process_cycle.c"
POSIX_DEPS=src/os/unix/ngx_posix_config.h
THREAD_POOL_MODULE=ngx_thread_pool_module
THREAD_POOL_DEPS=src/core/ngx_thread_pool.h
THREAD_POOL_SRCS="src/core/ngx_thread_pool.c
src/os/unix/ngx_thread_cond.c
src/os/unix/ngx_thread_mutex.c
src/os/unix/ngx_thread_id.c"
FREEBSD_DEPS="src/os/unix/ngx_freebsd_config.h src/os/unix/ngx_freebsd.h"
FREEBSD_DEPS=src/os/unix/ngx_freebsd_config.h
FREEBSD_SRCS=src/os/unix/ngx_freebsd_init.c
FREEBSD_SENDFILE_SRCS=src/os/unix/ngx_freebsd_sendfile_chain.c
FREEBSD_RFORK_DEPS="src/os/unix/ngx_freebsd_rfork_thread.h"
FREEBSD_RFORK_SRCS="src/os/unix/ngx_freebsd_rfork_thread.c"
FREEBSD_RFORK_THREAD_SRCS="src/os/unix/rfork_thread.S"
LINUX_DEPS="src/os/unix/ngx_linux_config.h src/os/unix/ngx_linux.h"
PTHREAD_SRCS="src/os/unix/ngx_pthread_thread.c"
LINUX_DEPS=src/os/unix/ngx_linux_config.h
LINUX_SRCS=src/os/unix/ngx_linux_init.c
LINUX_SENDFILE_SRCS=src/os/unix/ngx_linux_sendfile_chain.c
SOLARIS_DEPS="src/os/unix/ngx_solaris_config.h src/os/unix/ngx_solaris.h"
SOLARIS_DEPS=src/os/unix/ngx_solaris_config.h
SOLARIS_SRCS=src/os/unix/ngx_solaris_init.c
SOLARIS_SENDFILEV_SRCS=src/os/unix/ngx_solaris_sendfilev_chain.c
DARWIN_DEPS="src/os/unix/ngx_darwin_config.h src/os/unix/ngx_darwin.h"
DARWIN_SRCS=src/os/unix/ngx_darwin_init.c
DARWIN_SENDFILE_SRCS=src/os/unix/ngx_darwin_sendfile_chain.c
WIN32_INCS="$CORE_INCS $EVENT_INCS src/os/win32"
WIN32_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/win32/ngx_win32_config.h \
src/os/win32/ngx_time.h \
src/os/win32/ngx_types.h \
src/os/win32/ngx_errno.h \
src/os/win32/ngx_alloc.h \
src/os/win32/ngx_files.h \
@ -225,7 +207,8 @@ WIN32_DEPS="$CORE_DEPS $EVENT_DEPS \
src/os/win32/ngx_socket.h \
src/os/win32/ngx_os.h \
src/os/win32/ngx_user.h \
src/os/win32/ngx_dlopen.h \
src/os/win32/ngx_gui.h \
src/os/win32/ngx_gui_resources.h \
src/os/win32/ngx_process_cycle.h"
WIN32_CONFIG=src/os/win32/ngx_win32_config.h
@ -241,21 +224,228 @@ WIN32_SRCS="$CORE_SRCS $EVENT_SRCS \
src/os/win32/ngx_socket.c \
src/os/win32/ngx_wsarecv.c \
src/os/win32/ngx_wsarecv_chain.c \
src/os/win32/ngx_udp_wsarecv.c \
src/os/win32/ngx_wsasend.c \
src/os/win32/ngx_wsasend_chain.c \
src/os/win32/ngx_win32_init.c \
src/os/win32/ngx_user.c \
src/os/win32/ngx_dlopen.c \
src/os/win32/ngx_event_log.c \
src/os/win32/ngx_gui.c \
src/os/win32/ngx_process_cycle.c \
src/event/ngx_event_acceptex.c"
NGX_WIN32_ICONS="src/os/win32/nginx.ico"
NGX_WIN32_ICONS="src/os/win32/nginx.ico src/os/win32/nginx_tray.ico"
NGX_WIN32_RC="src/os/win32/nginx.rc"
HTTP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c
# the http modules that have their logging formats
# must be after ngx_http_log_module
HTTP_HUFF_SRCS="src/http/ngx_http_huff_decode.c
src/http/ngx_http_huff_encode.c"
HTTP_MODULES="ngx_http_module \
ngx_http_core_module \
ngx_http_log_module \
ngx_http_upstream_module"
HTTP_CACHE_MODULE=ngx_http_cache_module
HTTP_WRITE_FILTER_MODULE="ngx_http_write_filter_module"
HTTP_HEADER_FILTER_MODULE="ngx_http_header_filter_module"
HTTP_POSTPONE_FILTER_MODULE=ngx_http_postpone_filter_module
HTTP_COPY_FILTER_MODULE=ngx_http_copy_filter_module
HTTP_CHUNKED_FILTER_MODULE=ngx_http_chunked_filter_module
HTTP_HEADERS_FILTER_MODULE=ngx_http_headers_filter_module
HTTP_RANGE_HEADER_FILTER_MODULE=ngx_http_range_header_filter_module
HTTP_RANGE_BODY_FILTER_MODULE=ngx_http_range_body_filter_module
HTTP_NOT_MODIFIED_FILTER_MODULE=ngx_http_not_modified_filter_module
HTTP_STATIC_MODULE=ngx_http_static_module
HTTP_INDEX_MODULE=ngx_http_index_module
HTTP_INCS="src/http src/http/modules"
HTTP_DEPS="src/http/ngx_http.h \
src/http/ngx_http_request.h \
src/http/ngx_http_config.h \
src/http/ngx_http_core_module.h \
src/http/ngx_http_cache.h \
src/http/ngx_http_variables.h \
src/http/ngx_http_script.h \
src/http/ngx_http_upstream.h \
src/http/ngx_http_upstream_round_robin.h \
src/http/ngx_http_busy_lock.h"
HTTP_SRCS="src/http/ngx_http.c \
src/http/ngx_http_core_module.c \
src/http/ngx_http_special_response.c \
src/http/ngx_http_request.c \
src/http/ngx_http_parse.c \
src/http/ngx_http_header_filter_module.c \
src/http/ngx_http_write_filter_module.c \
src/http/ngx_http_copy_filter_module.c \
src/http/modules/ngx_http_log_module.c \
src/http/ngx_http_request_body.c \
src/http/ngx_http_variables.c \
src/http/ngx_http_script.c \
src/http/ngx_http_upstream.c \
src/http/ngx_http_upstream_round_robin.c \
src/http/ngx_http_parse_time.c \
src/http/modules/ngx_http_static_module.c \
src/http/modules/ngx_http_index_module.c \
src/http/modules/ngx_http_chunked_filter_module.c \
src/http/modules/ngx_http_range_filter_module.c \
src/http/modules/ngx_http_headers_filter_module.c \
src/http/modules/ngx_http_not_modified_filter_module.c"
# STUB
HTTP_SRCS="$HTTP_SRCS src/http/ngx_http_busy_lock.c"
HTPP_POSTPONE_FILTER_SRCS=src/http/ngx_http_postpone_filter_module.c
HTPP_CACHE_SRCS=src/http/ngx_http_cache.c
HTPP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c
HTTP_CHARSET_FILTER_MODULE=ngx_http_charset_filter_module
HTTP_CHARSET_SRCS=src/http/modules/ngx_http_charset_filter_module.c
HTTP_GZIP_FILTER_MODULE=ngx_http_gzip_filter_module
HTTP_GZIP_SRCS=src/http/modules/ngx_http_gzip_filter_module.c
HTTP_SSI_FILTER_MODULE=ngx_http_ssi_filter_module
HTTP_SSI_DEPS=src/http/modules/ngx_http_ssi_filter_module.h
HTTP_SSI_SRCS=src/http/modules/ngx_http_ssi_filter_module.c
HTTP_SUB_FILTER_MODULE=ngx_http_sub_filter_module
HTTP_SUB_SRCS=src/http/modules/ngx_http_sub_filter_module.c
HTTP_USERID_FILTER_MODULE=ngx_http_userid_filter_module
HTTP_USERID_SRCS=src/http/modules/ngx_http_userid_filter_module.c
HTTP_REALIP_MODULE=ngx_http_realip_module
HTTP_REALIP_SRCS=src/http/modules/ngx_http_realip_module.c
HTTP_ADDITION_FILTER_MODULE=ngx_http_addition_filter_module
HTTP_ADDITION_SRCS=src/http/modules/ngx_http_addition_filter_module.c
HTTP_DAV_MODULE=ngx_http_dav_module
HTTP_DAV_SRCS=src/http/modules/ngx_http_dav_module.c
HTTP_ACCESS_MODULE=ngx_http_access_module
HTTP_ACCESS_SRCS=src/http/modules/ngx_http_access_module.c
HTTP_AUTH_BASIC_MODULE=ngx_http_auth_basic_module
HTTP_AUTH_BASIC_SRCS=src/http/modules/ngx_http_auth_basic_module.c
HTTP_AUTOINDEX_MODULE=ngx_http_autoindex_module
HTTP_AUTOINDEX_SRCS=src/http/modules/ngx_http_autoindex_module.c
HTTP_STATUS_MODULE=ngx_http_status_module
HTTP_STATUS_SRCS=src/http/modules/ngx_http_status_module.c
HTTP_GEO_MODULE=ngx_http_geo_module
HTTP_GEO_SRCS=src/http/modules/ngx_http_geo_module.c
HTTP_MAP_MODULE=ngx_http_map_module
HTTP_MAP_SRCS=src/http/modules/ngx_http_map_module.c
HTTP_REFERER_MODULE=ngx_http_referer_module
HTTP_REFERER_SRCS=src/http/modules/ngx_http_referer_module.c
HTTP_REWRITE_MODULE=ngx_http_rewrite_module
HTTP_REWRITE_SRCS=src/http/modules/ngx_http_rewrite_module.c
HTTP_SSL_MODULE=ngx_http_ssl_module
HTTP_SSL_DEPS=src/http/modules/ngx_http_ssl_module.h
HTTP_SSL_SRCS=src/http/modules/ngx_http_ssl_module.c
HTTP_PROXY_MODULE=ngx_http_proxy_module
HTTP_PROXY_SRCS=src/http/modules/ngx_http_proxy_module.c
HTTP_FASTCGI_MODULE=ngx_http_fastcgi_module
HTTP_FASTCGI_SRCS=src/http/modules/ngx_http_fastcgi_module.c
HTTP_PERL_MODULE=ngx_http_perl_module
HTTP_PERL_INCS=src/http/modules/perl
HTTP_PERL_DEPS=src/http/modules/perl/ngx_http_perl_module.h
HTTP_PERL_SRCS=src/http/modules/perl/ngx_http_perl_module.c
HTTP_MEMCACHED_MODULE=ngx_http_memcached_module
HTTP_MEMCACHED_SRCS=src/http/modules/ngx_http_memcached_module.c
HTTP_LIMIT_ZONE_MODULE=ngx_http_limit_zone_module
HTTP_LIMIT_ZONE_SRCS=src/http/modules/ngx_http_limit_zone_module.c
HTTP_EMPTY_GIF_MODULE=ngx_http_empty_gif_module
HTTP_EMPTY_GIF_SRCS=src/http/modules/ngx_http_empty_gif_module.c
HTTP_BROWSER_MODULE=ngx_http_browser_module
HTTP_BROWSER_SRCS=src/http/modules/ngx_http_browser_module.c
HTTP_FLV_MODULE=ngx_http_flv_module
HTTP_FLV_SRCS=src/http/modules/ngx_http_flv_module.c
HTTP_UPSTREAM_IP_HASH_MODULE=ngx_http_upstream_ip_hash_module
HTTP_UPSTREAM_IP_HASH_SRCS=src/http/modules/ngx_http_upstream_ip_hash_module.c
MAIL_INCS="src/mail"
MAIL_DEPS="src/mail/ngx_mail.h"
MAIL_MODULES="ngx_mail_module ngx_mail_core_module"
MAIL_SRCS="src/mail/ngx_mail.c \
src/mail/ngx_mail_core_module.c \
src/mail/ngx_mail_handler.c \
src/mail/ngx_mail_parse.c"
MAIL_POP3_MODULE="ngx_mail_pop3_module"
MAIL_POP3_DEPS="src/mail/ngx_mail_pop3_module.h"
MAIL_POP3_SRCS="src/mail/ngx_mail_pop3_module.c \
src/mail/ngx_mail_pop3_handler.c"
MAIL_IMAP_MODULE="ngx_mail_imap_module"
MAIL_IMAP_DEPS="src/mail/ngx_mail_imap_module.h"
MAIL_IMAP_SRCS="src/mail/ngx_mail_imap_module.c \
src/mail/ngx_mail_imap_handler.c"
MAIL_SMTP_MODULE="ngx_mail_smtp_module"
MAIL_SMTP_DEPS="src/mail/ngx_mail_smtp_module.h"
MAIL_SMTP_SRCS="src/mail/ngx_mail_smtp_module.c \
src/mail/ngx_mail_smtp_handler.c"
MAIL_SSL_MODULE="ngx_mail_ssl_module"
MAIL_SSL_DEPS="src/mail/ngx_mail_ssl_module.h"
MAIL_SSL_SRCS="src/mail/ngx_mail_ssl_module.c"
MAIL_AUTH_HTTP_MODULE="ngx_mail_auth_http_module"
MAIL_AUTH_HTTP_SRCS="src/mail/ngx_mail_auth_http_module.c"
MAIL_PROXY_MODULE="ngx_mail_proxy_module"
MAIL_PROXY_SRCS="src/mail/ngx_mail_proxy_module.c"

View File

@ -1,8 +1,8 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_USE_HTTP_FILE_CACHE_UNIQ . auto/have
have=NGX_SUPPRESS_WARN . auto/have
have=NGX_SMP . auto/have

View File

@ -1,53 +1,153 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
### STUB
if [ $USE_THREADS != NO ]; then
cat << END
$0: error: the threads support is broken now.
END
exit 1
fi
###
echo
echo "Configuration summary"
if [ $USE_THREADS = YES ]; then
echo " + using threads"
fi
case $USE_THREADS in
rfork) echo " + using rfork()ed threads" ;;
pthreads) echo " + using libpthread threads library" ;;
libthr) echo " + using FreeBSD libthr threads library" ;;
libc_r) echo " + using FreeBSD libc_r threads library" ;;
linuxthreads) echo " + using FreeBSD LinuxThreads port library" ;;
NO) echo " + threads are not used" ;;
*) echo " + using lib$USE_THREADS threads library" ;;
esac
if [ $USE_PCRE = DISABLED ]; then
echo " + PCRE library is disabled"
else
case $PCRE in
YES) echo " + using system $PCRE_LIBRARY library" ;;
YES) echo " + using system PCRE library" ;;
NONE) echo " + PCRE library is not used" ;;
*) echo " + using $PCRE_LIBRARY library: $PCRE" ;;
NO) echo " + PCRE library is not found" ;;
*) echo " + using PCRE library: $PCRE" ;;
esac
fi
case $OPENSSL in
YES) echo " + using system OpenSSL library" ;;
NONE) echo " + OpenSSL library is not used" ;;
NO) echo " + OpenSSL library is not found" ;;
*) echo " + using OpenSSL library: $OPENSSL" ;;
esac
case $MD5 in
YES)
case $OPENSSL in
NONE|NO) echo " + md5: using system $MD5_LIB library" ;;
*) echo " + md5: using OpenSSL library" ;;
esac
;;
NONE) echo " + md5 library is not used" ;;
NO) echo " + md5 library is not found" ;;
*) echo " + using md5 library: $MD5" ;;
esac
case $SHA1 in
YES)
case $OPENSSL in
NONE|NO) echo " + sha1: using system $SHA1_LIB library" ;;
*) echo " + sha1: using OpenSSL library" ;;
esac
;;
NONE) echo " + sha1 library is not used" ;;
NO) echo " + sha1 library is not found" ;;
*) echo " + using sha1 library: $SHA1" ;;
esac
case $ZLIB in
YES) echo " + using system zlib library" ;;
NONE) echo " + zlib library is not used" ;;
NO) echo " + zlib library is not found" ;;
*) echo " + using zlib library: $ZLIB" ;;
esac
case $NGX_LIBATOMIC in
YES) echo " + using system libatomic_ops library" ;;
NO) ;; # not used
*) echo " + using libatomic_ops library: $NGX_LIBATOMIC" ;;
esac
echo
if [ $HTTP_REWRITE = YES ]; then
if [ $USE_PCRE = DISABLED ]; then
cat << END
$0: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option or you have to enable the PCRE support.
END
exit 1
fi
if [ $PCRE = NONE -o $PCRE = NO ]; then
cat << END
$0: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
END
exit 1
fi
fi
if [ $HTTP_GZIP = YES ]; then
if [ $ZLIB = NONE -o $ZLIB = NO ]; then
cat << END
$0: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.
END
exit 1
fi
fi
if [ $HTTP_SSL = YES ]; then
if [ $OPENSSL = NONE -o $OPENSSL = NO ]; then
cat << END
$0: error: the HTTP SSL module requires the OpenSSL library.
You can either do not enable the module, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
END
exit 1
fi
fi
cat << END
nginx path prefix: "$NGX_PREFIX"
nginx binary file: "$NGX_SBIN_PATH"
nginx modules path: "$NGX_MODULES_PATH"
nginx configuration prefix: "$NGX_CONF_PREFIX"
nginx configuration file: "$NGX_CONF_PATH"
nginx pid file: "$NGX_PID_PATH"
END
@ -61,22 +161,7 @@ fi
cat << END
nginx http access log file: "$NGX_HTTP_LOG_PATH"
nginx http client request body temporary files: "$NGX_HTTP_CLIENT_TEMP_PATH"
nginx http proxy temporary files: "$NGX_HTTP_PROXY_TEMP_PATH"
nginx http fastcgi temporary files: "$NGX_HTTP_FASTCGI_TEMP_PATH"
END
if [ $HTTP_PROXY = YES ]; then
echo " nginx http proxy temporary files: \"$NGX_HTTP_PROXY_TEMP_PATH\""
fi
if [ $HTTP_FASTCGI = YES ]; then
echo " nginx http fastcgi temporary files: \"$NGX_HTTP_FASTCGI_TEMP_PATH\""
fi
if [ $HTTP_UWSGI = YES ]; then
echo " nginx http uwsgi temporary files: \"$NGX_HTTP_UWSGI_TEMP_PATH\""
fi
if [ $HTTP_SCGI = YES ]; then
echo " nginx http scgi temporary files: \"$NGX_HTTP_SCGI_TEMP_PATH\""
fi
echo "$NGX_POST_CONF_MSG"

View File

@ -1,21 +1,70 @@
# Copyright (C) Nginx, Inc.
# Copyright (C) Igor Sysoev
if [ $USE_THREADS = YES ]; then
case $USE_THREADS in
rfork)
have=NGX_THREADS . auto/have
have=NGX_USE_RFORK . auto/have
CORE_DEPS="$CORE_DEPS $FREEBSD_RFORK_DEPS"
CORE_SRCS="$CORE_SRCS $FREEBSD_RFORK_SRCS"
if [ "$NGX_PLATFORM" = win32 ]; then
cat << END
case "$NGX_PLATFORM" in
*:i386)
if [ \( $version -gt 500000 -a $version -lt 501000 \) \
-o $version -lt 491000 ]
then
CORE_SRCS="$CORE_SRCS $FREEBSD_RFORK_THREAD_SRCS"
fi
;;
esac
;;
$0: --with-threads is not supported on Windows
pthreads)
have=NGX_THREADS . auto/have
CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
CORE_LIBS="$CORE_LIBS -lpthread"
;;
END
exit 1
fi
libthr)
have=NGX_THREADS . auto/have
CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
CORE_LIBS="$CORE_LIBS -lthr"
;;
have=NGX_THREADS . auto/have
CORE_DEPS="$CORE_DEPS $THREAD_POOL_DEPS"
CORE_SRCS="$CORE_SRCS $THREAD_POOL_SRCS"
CORE_LIBS="$CORE_LIBS -lpthread"
NGX_LIBPTHREAD="-lpthread"
fi
linuxthreads)
have=NGX_THREADS . auto/have
have=NGX_LINUXTHREADS . auto/have
CFLAGS="$CFLAGS -D_THREAD_SAFE"
CFLAGS="$CFLAGS -I /usr/local/include/pthread/linuxthreads"
CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
CORE_LIBS="$CORE_LIBS -L /usr/local/lib -llthread -llgcc_r"
;;
libc_r)
case "$NGX_PLATFORM" in
FreeBSD:[34]*)
have=NGX_THREADS . auto/have
CFLAGS="$CFLAGS -pthread"
CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
CORE_LIBS="$CORE_LIBS -pthread"
;;
FreeBSD:[56]*)
have=NGX_THREADS . auto/have
CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
CORE_LIBS="$CORE_LIBS -lc_r"
;;
esac
;;
NO)
;;
*)
have=NGX_THREADS . auto/have
CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
CORE_LIBS="$CORE_LIBS -l$USE_THREADS"
;;
esac

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type size ...$ngx_c"
@ -20,13 +19,12 @@ cat << END > $NGX_AUTOTEST.c
#include <sys/time.h>
$NGX_INCLUDE_UNISTD_H
#include <signal.h>
#include <stdio.h>
#include <sys/resource.h>
$NGX_INCLUDE_INTTYPES_H
$NGX_INCLUDE_AUTO_CONFIG_H
int main(void) {
printf("%d", (int) sizeof($ngx_type));
int main() {
printf("%d", sizeof($ngx_type));
return 0;
}
@ -45,14 +43,27 @@ if [ -x $NGX_AUTOTEST ]; then
fi
rm -f $NGX_AUTOTEST
case $ngx_size in
4)
ngx_max_value=2147483647
if [ "$ngx_type"="long" ]; then
ngx_max_value=2147483647L
else
ngx_max_value=2147483647
fi
ngx_max_len='(sizeof("-2147483648") - 1)'
;;
8)
ngx_max_value=9223372036854775807LL
if [ "$ngx_type"="long long" ]; then
ngx_max_value=9223372036854775807LL
else
ngx_max_value=9223372036854775807L
fi
ngx_max_len='(sizeof("-9223372036854775808") - 1)'
;;
@ -66,11 +77,6 @@ case $ngx_size in
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
rm -rf $NGX_AUTOTEST*
exit 1
esac
rm -rf $NGX_AUTOTEST*

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type ...$ngx_c"
@ -27,9 +26,9 @@ do
#include <netinet/in.h>
$NGX_INCLUDE_INTTYPES_H
int main(void) {
int main() {
$ngx_try i = 0;
return (int) i;
return 0;
}
END
@ -49,23 +48,18 @@ END
fi
fi
rm -f $NGX_AUTOTEST
if [ $ngx_found = no ]; then
if [ $ngx_try = $ngx_type ]; then
echo $ngx_n " $ngx_try not found$ngx_c"
else
echo $ngx_n ", $ngx_try not found$ngx_c"
fi
echo $ngx_n " $ngx_try not found$ngx_c"
echo "----------" >> $NGX_AUTOCONF_ERR
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
fi
rm -rf $NGX_AUTOTEST*
if [ $ngx_found != no ]; then
else
break
fi
done

View File

@ -1,35 +1,26 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for uintptr_t ...$ngx_c"
cat << END >> $NGX_AUTOCONF_ERR
----------------------------------------
checking for uintptr_t
END
echo >> $NGX_ERR
echo "checking for uintptr_t" >> $NGX_ERR
found=no
cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
$NGX_INCLUDE_INTTYPES_H
$NGX_INTTYPES_H
int main(void) {
int main() {
uintptr_t i = 0;
return (int) i;
return 0;
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
if [ -x $NGX_AUTOTEST ]; then
echo " uintptr_t found"
@ -38,7 +29,7 @@ else
echo $ngx_n " uintptr_t not found" $ngx_c
fi
rm -rf $NGX_AUTOTEST*
rm $NGX_AUTOTEST*
if [ $found = no ]; then

View File

@ -1,6 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

869
auto/unix Normal file → Executable file
View File

@ -1,588 +1,5 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_USER=${NGX_USER:-nobody}
if [ -z "$NGX_GROUP" ]; then
if [ $NGX_USER = nobody ]; then
if grep nobody /etc/group 2>&1 >/dev/null; then
echo "checking for nobody group ... found"
NGX_GROUP=nobody
else
echo "checking for nobody group ... not found"
if grep nogroup /etc/group 2>&1 >/dev/null; then
echo "checking for nogroup group ... found"
NGX_GROUP=nogroup
else
echo "checking for nogroup group ... not found"
NGX_GROUP=nobody
fi
fi
else
NGX_GROUP=$NGX_USER
fi
fi
ngx_feature="poll()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <poll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n; struct pollfd pl;
pl.fd = 0;
pl.events = 0;
pl.revents = 0;
n = poll(&pl, 1, 0);
if (n == -1) return 1"
. auto/feature
if [ $ngx_found = no ]; then
EVENT_POLL=NONE
fi
ngx_feature="/dev/poll"
ngx_feature_name="NGX_HAVE_DEVPOLL"
ngx_feature_run=no
ngx_feature_incs="#include <sys/devpoll.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int n, dp; struct dvpoll dvp;
dp = 0;
dvp.dp_fds = NULL;
dvp.dp_nfds = 0;
dvp.dp_timeout = 0;
n = ioctl(dp, DP_POLL, &dvp);
if (n == -1) return 1"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
EVENT_FOUND=YES
fi
if test -z "$NGX_KQUEUE_CHECKED"; then
ngx_feature="kqueue"
ngx_feature_name="NGX_HAVE_KQUEUE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/event.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="(void) kqueue()"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_CLEAR_EVENT . auto/have
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
EVENT_FOUND=YES
ngx_feature="kqueue's NOTE_LOWAT"
ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/event.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct kevent kev;
kev.fflags = NOTE_LOWAT;
(void) kev"
. auto/feature
ngx_feature="kqueue's EVFILT_TIMER"
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/event.h>
#include <sys/time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int kq;
struct kevent kev;
struct timespec ts;
if ((kq = kqueue()) == -1) return 1;
kev.ident = 0;
kev.filter = EVFILT_TIMER;
kev.flags = EV_ADD|EV_ENABLE;
kev.fflags = 0;
kev.data = 1000;
kev.udata = 0;
ts.tv_sec = 0;
ts.tv_nsec = 0;
if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
if (kev.flags & EV_ERROR) return 1;"
. auto/feature
fi
fi
if [ "$NGX_SYSTEM" = "NetBSD" ]; then
# NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
cat << END >> $NGX_AUTO_CONFIG_H
#define NGX_KQUEUE_UDATA_T
END
else
cat << END >> $NGX_AUTO_CONFIG_H
#define NGX_KQUEUE_UDATA_T (void *)
END
fi
ngx_feature="crypt()"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="crypt(\"test\", \"salt\");"
. auto/feature
if [ $ngx_found = no ]; then
ngx_feature="crypt() in libcrypt"
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=-lcrypt
. auto/feature
if [ $ngx_found = yes ]; then
CRYPT_LIB="-lcrypt"
fi
fi
ngx_feature="F_READAHEAD"
ngx_feature_name="NGX_HAVE_F_READAHEAD"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="fcntl(0, F_READAHEAD, 1);"
. auto/feature
ngx_feature="posix_fadvise()"
ngx_feature_name="NGX_HAVE_POSIX_FADVISE"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL);"
. auto/feature
ngx_feature="O_DIRECT"
ngx_feature_name="NGX_HAVE_O_DIRECT"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
. auto/feature
if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
fi
ngx_feature="F_NOCACHE"
ngx_feature_name="NGX_HAVE_F_NOCACHE"
ngx_feature_run=no
ngx_feature_incs="#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
. auto/feature
ngx_feature="directio()"
ngx_feature_name="NGX_HAVE_DIRECTIO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="directio(0, DIRECTIO_ON);"
. auto/feature
ngx_feature="statfs()"
ngx_feature_name="NGX_HAVE_STATFS"
ngx_feature_run=no
ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
$NGX_INCLUDE_SYS_MOUNT_H
$NGX_INCLUDE_SYS_VFS_H"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct statfs fs;
statfs(\".\", &fs);"
. auto/feature
ngx_feature="statvfs()"
ngx_feature_name="NGX_HAVE_STATVFS"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/statvfs.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct statvfs fs;
statvfs(\".\", &fs);"
. auto/feature
ngx_feature="dlopen()"
ngx_feature_name="NGX_HAVE_DLOPEN"
ngx_feature_run=no
ngx_feature_incs="#include <dlfcn.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); dlsym(NULL, \"\")"
. auto/feature
if [ $ngx_found = no ]; then
ngx_feature="dlopen() in libdl"
ngx_feature_libs="-ldl"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -ldl"
NGX_LIBDL="-ldl"
fi
fi
ngx_feature="sched_yield()"
ngx_feature_name="NGX_HAVE_SCHED_YIELD"
ngx_feature_run=no
ngx_feature_incs="#include <sched.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sched_yield()"
. auto/feature
if [ $ngx_found = no ]; then
ngx_feature="sched_yield() in librt"
ngx_feature_libs="-lrt"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
ngx_feature="sched_setaffinity()"
ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
ngx_feature_run=no
ngx_feature_incs="#include <sched.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="cpu_set_t mask;
CPU_ZERO(&mask);
sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
. auto/feature
ngx_feature="SO_SETFIB"
ngx_feature_name="NGX_HAVE_SETFIB"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 0)"
. auto/feature
ngx_feature="SO_REUSEPORT"
ngx_feature_name="NGX_HAVE_REUSEPORT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_REUSEPORT, NULL, 0)"
. auto/feature
ngx_feature="SO_ACCEPTFILTER"
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
. auto/feature
# OpenBSD bind to any address for transparent proxying
ngx_feature="SO_BINDANY"
ngx_feature_name="NGX_HAVE_TRANSPARENT_PROXY"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_BINDANY, NULL, 0)"
. auto/feature
# Linux transparent proxying
ngx_feature="IP_TRANSPARENT"
ngx_feature_name="NGX_HAVE_TRANSPARENT_PROXY"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_TRANSPARENT, NULL, 0)"
. auto/feature
# FreeBSD bind to any address for transparent proxying
ngx_feature="IP_BINDANY"
ngx_feature_name="NGX_HAVE_TRANSPARENT_PROXY"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_BINDANY, NULL, 0)"
. auto/feature
# Linux IP_BIND_ADDRESS_NO_PORT
ngx_feature="IP_BIND_ADDRESS_NO_PORT"
ngx_feature_name="NGX_HAVE_IP_BIND_ADDRESS_NO_PORT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, NULL, 0)"
. auto/feature
# BSD way to get IPv4 datagram destination address
ngx_feature="IP_RECVDSTADDR"
ngx_feature_name="NGX_HAVE_IP_RECVDSTADDR"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_RECVDSTADDR, NULL, 0)"
. auto/feature
# BSD way to set IPv4 datagram source address
ngx_feature="IP_SENDSRCADDR"
ngx_feature_name="NGX_HAVE_IP_SENDSRCADDR"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_SENDSRCADDR, NULL, 0)"
. auto/feature
# Linux way to get IPv4 datagram destination address
ngx_feature="IP_PKTINFO"
ngx_feature_name="NGX_HAVE_IP_PKTINFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct in_pktinfo pkt;
pkt.ipi_spec_dst.s_addr = INADDR_ANY;
(void) pkt;
setsockopt(0, IPPROTO_IP, IP_PKTINFO, NULL, 0)"
. auto/feature
# RFC 3542 way to get IPv6 datagram destination address
ngx_feature="IPV6_RECVPKTINFO"
ngx_feature_name="NGX_HAVE_IPV6_RECVPKTINFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_IPV6, IPV6_RECVPKTINFO, NULL, 0)"
. auto/feature
ngx_feature="TCP_DEFER_ACCEPT"
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
. auto/feature
ngx_feature="TCP_KEEPIDLE"
ngx_feature_name="NGX_HAVE_KEEPALIVE_TUNABLE"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0);
setsockopt(0, IPPROTO_TCP, TCP_KEEPINTVL, NULL, 0);
setsockopt(0, IPPROTO_TCP, TCP_KEEPCNT, NULL, 0)"
. auto/feature
ngx_feature="TCP_FASTOPEN"
ngx_feature_name="NGX_HAVE_TCP_FASTOPEN"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_FASTOPEN, NULL, 0)"
. auto/feature
ngx_feature="TCP_INFO"
ngx_feature_name="NGX_HAVE_TCP_INFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(struct tcp_info);
struct tcp_info ti;
ti.tcpi_rtt = 0;
ti.tcpi_rttvar = 0;
ti.tcpi_snd_cwnd = 0;
ti.tcpi_rcv_space = 0;
getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)"
. auto/feature
ngx_feature="accept4()"
ngx_feature_name="NGX_HAVE_ACCEPT4"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
. auto/feature
if [ $NGX_FILE_AIO = YES ]; then
ngx_feature="kqueue AIO support"
ngx_feature_name="NGX_HAVE_FILE_AIO"
ngx_feature_run=no
ngx_feature_incs="#include <aio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct aiocb iocb;
iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
(void) aio_read(&iocb)"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
fi
if [ $ngx_found = no ]; then
ngx_feature="Linux AIO support"
ngx_feature_name="NGX_HAVE_FILE_AIO"
ngx_feature_run=no
ngx_feature_incs="#include <linux/aio_abi.h>
#include <sys/eventfd.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct iocb iocb;
iocb.aio_lio_opcode = IOCB_CMD_PREAD;
iocb.aio_flags = IOCB_FLAG_RESFD;
iocb.aio_resfd = -1;
(void) iocb;
(void) eventfd(0, 0)"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_EVENTFD . auto/have
have=NGX_HAVE_SYS_EVENTFD_H . auto/have
CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
fi
fi
if [ $ngx_found = no ]; then
ngx_feature="Linux AIO support (SYS_eventfd)"
ngx_feature_incs="#include <linux/aio_abi.h>
#include <sys/syscall.h>"
ngx_feature_test="struct iocb iocb;
iocb.aio_lio_opcode = IOCB_CMD_PREAD;
iocb.aio_flags = IOCB_FLAG_RESFD;
iocb.aio_resfd = -1;
(void) iocb;
(void) SYS_eventfd"
. auto/feature
if [ $ngx_found = yes ]; then
have=NGX_HAVE_EVENTFD . auto/have
CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
fi
fi
if [ $ngx_found = no ]; then
cat << END
$0: no supported file AIO was found
Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
END
exit 1
fi
fi
have=NGX_HAVE_UNIX_DOMAIN . auto/have
@ -604,9 +21,15 @@ ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
# POSIX types
NGX_INCLUDE_AUTO_CONFIG_H="#include \"ngx_auto_config.h\""
case "$NGX_AUTO_CONFIG_H" in
/*)
NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
;;
*)
NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
;;
esac
ngx_type="uint32_t"; ngx_types="u_int32_t"; . auto/types/typedef
ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
@ -615,7 +38,7 @@ ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
ngx_type="in_addr_t"; ngx_types="uint32_t u_int32_t"; . auto/types/typedef
ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
@ -623,7 +46,7 @@ ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
. auto/types/uintptr_t
. auto/endianness
. auto/endianess
ngx_type="size_t"; . auto/types/sizeof
ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
@ -636,30 +59,15 @@ ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
ngx_type="time_t"; . auto/types/sizeof
ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
# syscalls, libc calls and some features
ngx_feature="AF_INET6"
ngx_feature_name="NGX_HAVE_INET6"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct sockaddr_in6 sin6;
sin6.sin6_family = AF_INET6;
(void) sin6"
. auto/feature
ngx_feature="setproctitle()"
ngx_feature_name="NGX_HAVE_SETPROCTITLE"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>"
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=$NGX_SETPROCTITLE_LIB
ngx_feature_test="setproctitle(\"test\");"
@ -672,8 +80,7 @@ ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0);
if (n == -1) return 1"
ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
. auto/feature
@ -683,69 +90,34 @@ ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0);
if (n == -1) return 1"
ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
. auto/feature
# pwritev() was introduced in FreeBSD 6 and Linux 2.6.30, glibc 2.10
ngx_feature="pwritev()"
ngx_feature_name="NGX_HAVE_PWRITEV"
ngx_feature_run=no
ngx_feature_incs='#include <sys/uio.h>'
ngx_feature="strerror_r()"
ngx_feature_name="NGX_HAVE_STRERROR_R"
ngx_feature_run=yes
ngx_feature_incs="#include <string.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char buf[1]; struct iovec vec[1]; ssize_t n;
vec[0].iov_base = buf;
vec[0].iov_len = 1;
n = pwritev(1, vec, 1, 0);
if (n == -1) return 1"
ngx_feature_test="char buf[1024]; long n; n = strerror_r(1, buf, 1024);
if (n < 0 || n > 1024) return 1;"
. auto/feature
# strerrordesc_np(), introduced in glibc 2.32
# GNU style strerror_r() returns not length, but pointer
ngx_feature="strerrordesc_np()"
ngx_feature_name="NGX_HAVE_STRERRORDESC_NP"
ngx_feature_run=no
ngx_feature_incs='#include <string.h>'
ngx_feature="gnu style strerror_r()"
ngx_feature_name="NGX_HAVE_GNU_STRERROR_R"
ngx_feature_run=yes
ngx_feature_incs="#include <string.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="char *p; p = strerrordesc_np(0);
if (p == NULL) return 1"
ngx_feature_test="char buf[1024]; long n; n = strerror_r(1, buf, 1024);
if (n >= 0 && n < 1024) return 1;"
. auto/feature
if [ $ngx_found = no ]; then
ngx_feature="sys_nerr"
ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
ngx_feature_incs='#include <errno.h>
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='printf("%d", sys_nerr);'
. auto/feature
fi
if [ $ngx_found = no ]; then
# Cygiwn defines _sys_nerr
ngx_feature="_sys_nerr"
ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
ngx_feature_incs='#include <errno.h>
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='printf("%d", _sys_nerr);'
. auto/feature
fi
ngx_feature="localtime_r()"
ngx_feature_name="NGX_HAVE_LOCALTIME_R"
ngx_feature_run=no
@ -756,50 +128,33 @@ ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
. auto/feature
ngx_feature="clock_gettime(CLOCK_MONOTONIC)"
ngx_feature_name="NGX_HAVE_CLOCK_MONOTONIC"
ngx_feature_run=no
ngx_feature_incs="#include <time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts)"
. auto/feature
if [ $ngx_found = no ]; then
# Linux before glibc 2.17, notably CentOS 6
ngx_feature="clock_gettime(CLOCK_MONOTONIC) in librt"
ngx_feature_libs="-lrt"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
ngx_feature="posix_memalign()"
ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096);
if (n != 0) return 1"
ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
. auto/feature
ngx_feature="memalign()"
ngx_feature_name="NGX_HAVE_MEMALIGN"
ngx_feature_run=no
ngx_feature_incs="#include <stdlib.h>
#include <malloc.h>"
ngx_feature_incs="#include <stdlib.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="void *p; p = memalign(4096, 4096);
if (p == NULL) return 1"
ngx_feature_test="void *p; p = memalign(4096, 4096)"
. auto/feature
ngx_feature="sched_yield()"
ngx_feature_name="NGX_HAVE_SCHED_YIELD"
ngx_feature_run=no
ngx_feature_incs="#include <sched.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sched_yield()"
. auto/feature
@ -820,8 +175,8 @@ ngx_feature='mmap("/dev/zero", MAP_SHARED)'
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>"
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='void *p; int fd;
@ -835,7 +190,7 @@ ngx_feature="System V shared memory"
ngx_feature_name="NGX_HAVE_SYSVSHM"
ngx_feature_run=yes
ngx_feature_incs="#include <sys/ipc.h>
#include <sys/shm.h>"
#include <sys/shm.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int id;
@ -845,54 +200,13 @@ ngx_feature_test="int id;
. auto/feature
ngx_feature="POSIX semaphores"
ngx_feature_name="NGX_HAVE_POSIX_SEM"
ngx_feature_run=yes
ngx_feature_incs="#include <semaphore.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sem_t sem;
if (sem_init(&sem, 1, 0) == -1) return 1;
sem_destroy(&sem);"
. auto/feature
if [ $ngx_found = no ]; then
# Linux has POSIX semaphores in libpthread
ngx_feature="POSIX semaphores in libpthread"
ngx_feature_libs=-lpthread
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lpthread"
NGX_LIBPTHREAD="-lpthread"
fi
fi
if [ $ngx_found = no ]; then
# Solaris has POSIX semaphores in librt
ngx_feature="POSIX semaphores in librt"
ngx_feature_libs=-lrt
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
ngx_feature="struct msghdr.msg_control"
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <stdio.h>"
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct msghdr msg;
printf(\"%d\", (int) sizeof(msg.msg_control))"
ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
. auto/feature
@ -900,105 +214,18 @@ ngx_feature="ioctl(FIONBIO)"
ngx_feature_name="NGX_HAVE_FIONBIO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/ioctl.h>
#include <stdio.h>
$NGX_INCLUDE_SYS_FILIO_H"
$NGX_INCLUDE_SYS_FILIO_H"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int i = FIONBIO; printf(\"%d\", i)"
. auto/feature
ngx_feature="ioctl(FIONREAD)"
ngx_feature_name="NGX_HAVE_FIONREAD"
ngx_feature_run=no
ngx_feature_incs="#include <sys/ioctl.h>
#include <stdio.h>
$NGX_INCLUDE_SYS_FILIO_H"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="int i = FIONREAD; printf(\"%d\", i)"
ngx_feature_test="int i; i = FIONBIO"
. auto/feature
ngx_feature="struct tm.tm_gmtoff"
ngx_feature_name="NGX_HAVE_GMTOFF"
ngx_feature_run=no
ngx_feature_incs="#include <time.h>
#include <stdio.h>"
ngx_feature_incs="#include <time.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0;
printf(\"%d\", (int) tm.tm_gmtoff)"
. auto/feature
ngx_feature="struct dirent.d_namlen"
ngx_feature_name="NGX_HAVE_D_NAMLEN"
ngx_feature_run=no
ngx_feature_incs="#include <dirent.h>
#include <stdio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct dirent dir; dir.d_namlen = 0;
printf(\"%d\", (int) dir.d_namlen)"
. auto/feature
ngx_feature="struct dirent.d_type"
ngx_feature_name="NGX_HAVE_D_TYPE"
ngx_feature_run=no
ngx_feature_incs="#include <dirent.h>
#include <stdio.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct dirent dir; dir.d_type = DT_REG;
printf(\"%d\", (int) dir.d_type)"
. auto/feature
ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
. auto/feature
ngx_feature="sysconf(_SC_LEVEL1_DCACHE_LINESIZE)"
ngx_feature_name="NGX_HAVE_LEVEL1_DCACHE_LINESIZE"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sysconf(_SC_LEVEL1_DCACHE_LINESIZE)"
. auto/feature
ngx_feature="openat(), fstatat()"
ngx_feature_name="NGX_HAVE_OPENAT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct stat sb;
openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW);
fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);"
. auto/feature
ngx_feature="getaddrinfo()"
ngx_feature_name="NGX_HAVE_GETADDRINFO"
ngx_feature_run=no
ngx_feature_incs="#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='struct addrinfo *res;
if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
freeaddrinfo(res)'
ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
. auto/feature

View File

@ -1,26 +0,0 @@
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

View File

@ -9,8 +9,6 @@ fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

View File

@ -1,99 +1,70 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/avif avif;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.ms-excel xls;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.wap.xhtml+xml xhtml;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/zip zip;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream eot;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/x-realaudio ra;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
video/3gpp 3gpp 3gp;
video/mpeg mpeg mpg;
video/quicktime mov;
video/x-flv flv;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@ -15,11 +15,11 @@ events {
http {
include mime.types;
include conf/mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
#log_format main '$remote_addr - $remote_user [$time_local] $request '
# '"$status" $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
@ -63,11 +63,10 @@ http {
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
# include conf/fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
@ -96,17 +95,18 @@ http {
# HTTPS server
#
#server {
# listen 443 ssl;
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
# location / {
# root html;

View File

@ -1,17 +0,0 @@
scgi_param REQUEST_METHOD $request_method;
scgi_param REQUEST_URI $request_uri;
scgi_param QUERY_STRING $query_string;
scgi_param CONTENT_TYPE $content_type;
scgi_param DOCUMENT_URI $document_uri;
scgi_param DOCUMENT_ROOT $document_root;
scgi_param SCGI 1;
scgi_param SERVER_PROTOCOL $server_protocol;
scgi_param REQUEST_SCHEME $scheme;
scgi_param HTTPS $https if_not_empty;
scgi_param REMOTE_ADDR $remote_addr;
scgi_param REMOTE_PORT $remote_port;
scgi_param SERVER_PORT $server_port;
scgi_param SERVER_NAME $server_name;

View File

@ -1,17 +0,0 @@
uwsgi_param QUERY_STRING $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
uwsgi_param CONTENT_LENGTH $content_length;
uwsgi_param REQUEST_URI $request_uri;
uwsgi_param PATH_INFO $document_uri;
uwsgi_param DOCUMENT_ROOT $document_root;
uwsgi_param SERVER_PROTOCOL $server_protocol;
uwsgi_param REQUEST_SCHEME $scheme;
uwsgi_param HTTPS $https if_not_empty;
uwsgi_param REMOTE_ADDR $remote_addr;
uwsgi_param REMOTE_PORT $remote_port;
uwsgi_param SERVER_PORT $server_port;
uwsgi_param SERVER_NAME $server_name;

View File

@ -13,9 +13,3 @@ unicode2nginx by Maxim Dounin
configuration file format.
Two generated full maps for windows-1251 and koi8-r.
vim by Evan Miller
Syntax highlighting of nginx configuration for vim, to be
placed into ~/.vim/.

View File

@ -10,7 +10,7 @@
# Needs perl 5.6 or later.
# Written by Maxim Dounin, mdounin@mdounin.ru
# Written by Maxim Dounin, mdounin@rambler-co.ru
###############################################################################
@ -33,10 +33,7 @@ while (<>) {
# Produce UTF-8 sequence from character code;
my $un_utf8 = join('',
map { sprintf("%02X", $_) }
unpack("U0C*", pack("U", hex($un_code)))
);
my $un_utf8 = join('', map { sprintf("%02X", $_) } unpack("C*", pack("U", hex($un_code))));
print " $cs_code $un_utf8 ; $un_name\n";

View File

@ -1,4 +0,0 @@
au BufRead,BufNewFile *.nginx set ft=nginx
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
au BufRead,BufNewFile nginx.conf set ft=nginx

View File

@ -1 +0,0 @@
setlocal commentstring=#\ %s

View File

@ -1,11 +0,0 @@
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=
" cindent actually works for nginx' simple file structure
setlocal cindent
" Just make sure that the comments are not reset as defs would be.
setlocal cinkeys-=0#

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +1,53 @@
VER= $(shell grep 'define NGINX_VERSION' src/core/nginx.h \
| sed -e 's/^.*"\(.*\)".*/\1/')
| sed -e 's/^.*\"\(.*\)\"/\1/')
NGINX= nginx-$(VER)
TEMP= tmp
XSLS?= xslscript.pl
CP= $(HOME)/java
define XSLScript
javavm -cp $(CP)/xsls/saxon.jar:$(CP)/xsls/xsls.jar \
com.pault.StyleSheet \
-x com.pault.XX -y com.pault.XX \
$(1) docs/xsls/dump.xsls \
| awk 'BEGIN{e=0}/^\n*$$/{e=1;next}{if(e){print"";e=0};print}' > $(2)
if [ ! -s $(2) ]; then rm $(2); fi; test -s $(2)
endef
define XSLT
xsltproc $(shell echo $4 \
| sed -e "s/\([^= ]*\)=\([^= ]*\)/--param \1 \"'\2'\"/g") \
$3 $1 \
> $(HTML)/$(strip $(2))
endef
all: changes
changes: $(TEMP)/$(NGINX)/CHANGES.ru \
$(TEMP)/$(NGINX)/CHANGES
$(TEMP)/$(NGINX)/CHANGES.ru: docs/dtd/changes.dtd \
docs/xml/nginx/changes.xml \
docs/xml/change_log_conf.xml \
$(TEMP)/$(NGINX)/CHANGES.ru: docs/xml/nginx/changes.xml \
docs/xslt/changes.xslt
mkdir -p $(TEMP)/$(NGINX)
test -d $(TEMP)/$(NGINX) || mkdir -p $(TEMP)/$(NGINX)
xmllint --noout --valid docs/xml/nginx/changes.xml
xsltproc --stringparam lang ru \
-o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml
xsltproc --param lang "'ru'" \
-o $(TEMP)/$(NGINX)/CHANGES.ru \
docs/xslt/changes.xslt docs/xml/nginx/changes.xml
$(TEMP)/$(NGINX)/CHANGES: docs/dtd/changes.dtd \
docs/xml/nginx/changes.xml \
docs/xml/change_log_conf.xml \
$(TEMP)/$(NGINX)/CHANGES: docs/xml/nginx/changes.xml \
docs/xslt/changes.xslt
mkdir -p $(TEMP)/$(NGINX)
test -d $(TEMP)/$(NGINX) || mkdir - p$(TEMP)/$(NGINX)
xmllint --noout --valid docs/xml/nginx/changes.xml
xsltproc --stringparam lang en \
-o $@ docs/xslt/changes.xslt docs/xml/nginx/changes.xml
xsltproc --param lang "'en'" \
-o $(TEMP)/$(NGINX)/CHANGES \
docs/xslt/changes.xslt docs/xml/nginx/changes.xml
docs/xslt/changes.xslt: docs/xsls/changes.xsls
$(XSLS) -o $@ $<
$(call XSLScript, docs/xsls/changes.xsls, $@)

View File

@ -12,10 +12,10 @@
>
<!ELEMENT change (para)* >
<!ATTLIST change type (bugfix | feature | change | security | workaround) #IMPLIED >
<!ATTLIST change type (bugfix | feature | change | workaround) #IMPLIED >
<!ELEMENT para (#PCDATA | at | br | nobr)* >
<!ATTLIST para lang (ru | en) #REQUIRED >
<!ATTLIST para lang (ru | en) #IMPLIED >
<!ELEMENT at EMPTY >
<!ELEMENT br EMPTY >

View File

@ -1,19 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<title>The page is temporarily unavailable</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
body { font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the error log for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
<body bgcolor="white" text="black">
<table width="100%" height="100%">
<tr>
<td align="center" valign="middle">
The page you are looking for is temporarily unavailable.<br/>
Please try again later.
</td>
</tr>
</table>
</body>
</html>

View File

@ -1,23 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
<body bgcolor="white" text="black">
<center><h1>Welcome to nginx!</h1></center>
</body>
</html>

View File

@ -1,214 +0,0 @@
.\"
.\" Copyright (C) 2010, 2019 Sergey A. Osokin
.\" Copyright (C) Nginx, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"
.Dd November 5, 2020
.Dt NGINX 8
.Os
.Sh NAME
.Nm nginx
.Nd "HTTP and reverse proxy server, mail proxy server"
.Sh SYNOPSIS
.Nm
.Op Fl ?hqTtVv
.Op Fl c Ar file
.Op Fl e Ar file
.Op Fl g Ar directives
.Op Fl p Ar prefix
.Op Fl s Ar signal
.Sh DESCRIPTION
.Nm
(pronounced
.Dq engine x )
is an HTTP and reverse proxy server, a mail proxy server, and a generic
TCP/UDP proxy server.
It is known for its high performance, stability, rich feature set, simple
configuration, and low resource consumption.
.Pp
The options are as follows:
.Bl -tag -width ".Fl d Ar directives"
.It Fl ?\& , h
Print help.
.It Fl c Ar file
Use an alternative configuration
.Ar file .
.It Fl e Ar file
Use an alternative error log
.Ar file .
Special value
.Cm stderr
indicates that the standard error output should be used.
.It Fl g Ar directives
Set global configuration directives.
See
.Sx EXAMPLES
for details.
.It Fl p Ar prefix
Set the prefix path.
The default value is
.Pa %%PREFIX%% .
.It Fl q
Suppress non-error messages during configuration testing.
.It Fl s Ar signal
Send a signal to the master process.
The argument
.Ar signal
can be one of:
.Cm stop , quit , reopen , reload .
The following table shows the corresponding system signals:
.Pp
.Bl -tag -width ".Cm reopen" -compact
.It Cm stop
.Dv SIGTERM
.It Cm quit
.Dv SIGQUIT
.It Cm reopen
.Dv SIGUSR1
.It Cm reload
.Dv SIGHUP
.El
.It Fl T
Same as
.Fl t ,
but additionally dump configuration files to standard output.
.It Fl t
Do not run, just test the configuration file.
.Nm
checks the configuration file syntax and then tries to open files
referenced in the configuration file.
.It Fl V
Print the
.Nm
version, compiler version, and
.Pa configure
script parameters.
.It Fl v
Print the
.Nm
version.
.El
.Sh SIGNALS
The master process of
.Nm
can handle the following signals:
.Pp
.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
.It Dv SIGINT , SIGTERM
Shut down quickly.
.It Dv SIGHUP
Reload configuration, start the new worker process with a new
configuration, and gracefully shut down old worker processes.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.It Dv SIGUSR2
Upgrade the
.Nm
executable on the fly.
.It Dv SIGWINCH
Shut down worker processes gracefully.
.El
.Pp
While there is no need to explicitly control worker processes normally,
they support some signals too:
.Pp
.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
.It Dv SIGTERM
Shut down quickly.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.El
.Sh DEBUGGING LOG
To enable a debugging log, reconfigure
.Nm
to build with debugging:
.Pp
.Dl "./configure --with-debug ..."
.Pp
and then set the
.Cm debug
level of the
.Va error_log :
.Pp
.Dl "error_log /path/to/log debug;"
.Pp
It is also possible to enable the debugging for a particular IP address:
.Bd -literal -offset indent
events {
debug_connection 127.0.0.1;
}
.Ed
.Sh ENVIRONMENT
The
.Ev NGINX
environment variable is used internally by
.Nm
and should not be set directly by the user.
.Sh FILES
.Bl -tag -width indent
.It Pa %%PID_PATH%%
Contains the process ID of
.Nm .
The contents of this file are not sensitive, so it can be world-readable.
.It Pa %%CONF_PATH%%
The main configuration file.
.It Pa %%ERROR_LOG_PATH%%
Error log file.
.El
.Sh EXIT STATUS
Exit status is 0 on success, or 1 if the command fails.
.Sh EXAMPLES
Test configuration file
.Pa ~/mynginx.conf
with global directives for PID and quantity of worker processes:
.Bd -literal -offset indent
nginx -t -c ~/mynginx.conf \e
-g "pid /var/run/mynginx.pid; worker_processes 2;"
.Ed
.Sh SEE ALSO
.\"Xr nginx.conf 5
.\"Pp
Documentation at
.Pa http://nginx.org/en/docs/ .
.Pp
For questions and technical support, please refer to
.Pa http://nginx.org/en/support.html .
.Sh HISTORY
Development of
.Nm
started in 2002, with the first public release on October 4, 2004.
.Sh AUTHORS
.An -nosplit
.An Igor Sysoev Aq Mt igor@sysoev.ru .
.Pp
This manual page was originally written by
.An Sergey A. Osokin Aq Mt osa@FreeBSD.org.ru
as a result of compiling many
.Nm
documents from all over the world.

Some files were not shown because too many files have changed in this diff Show More