Commit Graph

484 Commits

Author SHA1 Message Date
Maxim Dounin
74b7a91013 Win32: Borland C compatibility fixes.
Several false positive warnings silenced, notably W8012 "Comparing
signed and unsigned" (due to u_short values promoted to int), and
W8072 "Suspicious pointer arithmetic" (due to large type values added
to pointers).

With this patch, it's now again possible to compile nginx using bcc32,
with options we normally compile on win32 minus ipv6 and ssl.
2013-09-04 20:48:23 +04:00
Maxim Dounin
5b37852323 Win32: Open Watcom C compatibility fixes.
Precompiled headers are disabled as they lead to internal compiler errors
with long configure lines.  Couple of false positive warnings silenced.
Various win32 typedefs are adjusted to work with Open Watcom C 1.9 headers.

With this patch, it's now again possible to compile nginx using owc386,
with options we normally compile on win32 minus ipv6 and ssl.
2013-09-04 20:48:22 +04:00
Valentin Bartenev
7b37384140 Disable symlinks: use O_PATH to open path components.
It was introduced in Linux 2.6.39, glibc 2.14 and allows to obtain
file descriptors without actually opening files.  Thus made it possible
to traverse path with openat() syscalls without the need to have read
permissions for path components.  It is effectively emulates O_SEARCH
which is missing on Linux.

O_PATH is used in combination with O_RDONLY.  The last one is ignored
if O_PATH is used, but it allows nginx to not fail when it was built on
modern system (i.e. glibc 2.14+) and run with a kernel older than 2.6.39.
Then O_PATH is unknown to the kernel and ignored, while O_RDONLY is used.

Sadly, fstat() is not working with O_PATH descriptors till Linux 3.6.
As a workaround we fallback to fstatat() with the AT_EMPTY_PATH flag
that was introduced at the same time as O_PATH.
2013-09-02 08:07:59 +04:00
Maxim Dounin
d5591e914e Updated PCRE used for win32 builds.
As of PCRE 8.33, config.h.generic no longer contains boolean macros.  Two
of them (SUPPORT_PCRE8 and HAVE_MEMMOVE) were added to appropriate makefiles.
This allows PCRE 8.33 to compile and don't change anything for previous
versions.
2013-08-23 22:54:08 +04:00
Maxim Dounin
4ef185789e Configure: pcre.lib dependencies fix.
Previously, an attempt to build pcre.lib on win32 before anything else
failed due to no pcre.h.
2013-08-23 22:53:54 +04:00
Maxim Dounin
4c53a38fb5 Auth request module import. 2013-08-21 19:19:47 +04:00
Ruslan Ermilov
3693daa20f Core: guard use of AI_ADDRCONFIG.
Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support.

Reported by Piotr Sikora.
2013-08-05 13:44:56 +04:00
Ruslan Ermilov
7c6971cff3 Core: only resolve address families configured on the local system.
This is done by passing AI_ADDRCONFIG to getaddrinfo().

On Linux, setting net.ipv6.conf.all.disable_ipv6 to 1 will now be
respected.

On FreeBSD, AI_ADDRCONFIG filtering is currently implemented by
attempting to create a datagram socket for the corresponding family,
which succeeds even if the system doesn't in fact have any addresses
of that family configured.  That is, if the system with IPv6 support
in the kernel doesn't have IPv6 addresses configured, AI_ADDRCONFIG
will filter out IPv6 only inside a jail without IPv6 addresses or
with IPv6 disabled.
2013-08-05 10:55:59 +04:00
Sergey Kandaurov
ce36edfdd9 Configure: fixed autotest cleanup commands.
Previously, if configured with --with-cc="clang -g", the autotest.dSYM
directories were left unremoved.
2013-07-31 18:16:40 +04:00
Maxim Dounin
4ef36b38a1 Configure: perl Makefile rebuild after configure.
The $NGX_AUTO_CONFIG_H added to perl module Makefile dependencies to
make sure it's always rebuild after a configure.  It is needed as we
expand various variables used for Makefile generation during configure
(in particular, nginx version).
2013-07-11 20:34:02 +04:00
Ruslan Ermilov
c4a044cc50 Configure: fixed test of OS X atomic(3). 2013-05-23 10:23:21 +04:00
Ruslan Ermilov
e565dbc6e0 Configure: fixed detection of newer Apple clang compilers. 2013-04-29 18:07:22 +04:00
Maxim Dounin
9d4e3c3612 Configure: fixed perl Makefile generation (ticket #334).
Dependancy tracking introduced in r5169 were not handled absolute path
names properly.  Absolute names might appear in CORE_DEPS if --with-openssl
or --with-pcre configure arguments are used to build OpenSSL/PCRE
libraries.

Additionally, revert part of r5169 to set NGX_INCS from Makefile
variables.  Makefile variables have $ngx_include_opt in them, which
might result in wrong include paths being used.  As a side effect,
this also restores build with --with-http_perl_module and --without-http
at the same time.
2013-04-19 12:19:57 +00:00
Ruslan Ermilov
4352782879 Configure: uniformly refer to libs when searching for md5 and sha1. 2013-04-18 14:26:08 +00:00
Maxim Dounin
c63b826d8b Configure: fixed nginx.so rebuild (broken by r5145).
To avoid further breaks it's now done properly, all the dependencies
are now passed to Makefile.PL.  While here, fixed include list passed to
Makefile.PL to use Makefile variables rather than a list expanded during
configure.
2013-04-10 17:07:44 +00:00
Ruslan Ermilov
a861b0dbb1 Simplified nginx version maintenance.
It's no longer necessary to update src/http/modules/perl/nginx.pm
when version is bumped, as it's now derived from src/core/nginx.h.
2013-03-28 08:47:06 +00:00
Ruslan Ermilov
50be2f3f45 Configure: fixed perl module make rules.
Filename extension used for dynamically loaded perl modules isn't
necessarily ".so" (e.g., it's ".bundle" on Mac OS X).

This fixes "make" after "make" unnecessarily rebuilding perl module.
2013-03-28 08:46:42 +00:00
Ruslan Ermilov
514ad4d6c6 Configure: improved make dependencies for perl module.
Added missing dependencies for perl module's Makefile.

Simplified dependencies for perl module nginx.so: it depends
on Makefile that in turn depends on other perl bits.
2013-03-28 08:46:12 +00:00
Ruslan Ermilov
860a7c3bce Configure: improved layout of the generated makefile.
No functional changes.
2013-03-28 08:45:45 +00:00
Valentin Bartenev
2686cb4452 Preliminary experimental support for SPDY draft 2. 2013-03-20 10:36:57 +00:00
Gleb Smirnoff
35c17ea6f5 Configure: changed default compiler from "gcc" to "cc".
This allows to automatically pick the preferred system compiler on
systems with multiple compilers.

Reviewed by:	mdounin, ru
2013-02-18 11:35:28 +00:00
Maxim Dounin
7022bc28ea Configure: rebuild perl module nginx.so if headers are changed.
Note: the "-p" argument of cp(1) dropped intentionally, to force nginx.so
rebuild.  It is considered too boring to properly list all dependencies
in Makefile.PL.
2013-02-15 16:50:22 +00:00
Ruslan Ermilov
db5e48d9b8 GeoIP: IPv6 support.
When using IPv6 databases, IPv4 addresses are looked up as IPv4-mapped
IPv6 addresses.

Mostly based on a patch by Gregor Kališnik (ticket #250).
2013-01-24 16:15:51 +00:00
Ruslan Ermilov
6aa684c3c3 Configure: fixed GeoIP library detection. 2013-01-24 16:15:07 +00:00
Ruslan Ermilov
9e334857a1 Configure: fixed style of include directories. 2013-01-24 16:14:12 +00:00
Sergey Budnevitch
f29eb0798b Removed redundant variable assignment. 2013-01-21 15:05:54 +00:00
Valentin Bartenev
e90df45519 Configure: added the NGX_ZLIB define.
This was introduced for conditional compilation of the code that requires
the zlib library.
2012-12-23 16:04:14 +00:00
Ruslan Ermilov
b8a90c6903 Implemented IPv6 support for URLs specified using domain names.
This includes "debug_connection", upstreams, "proxy_pass", etc.
(ticket #92)

To preserve compatibility, "listen" specified with a domain name
selects the first IPv4 address, if available.  If not available,
the first IPv6 address will be used (ticket #186).
2012-12-17 12:08:53 +00:00
Maxim Dounin
8ae9e7903f Configure: better check for PCRE JIT.
On Mac OS X system toolchain by default prefers include files
from /usr/local/include, but libraries from /usr/lib.  This might result in
various problems, in particular the one outlined below.

If the PCRE library is installed into /usr/local/, this results in pcre.h
being used from /usr/local/include (with PCRE_CONFIG_JIT defined), but
libpcre from /usr/lib (as shipped with the OS, without pcre_free_study()
symbol).  As a result build fails as we use pcre_free_study() function
if we try to compile with PCRE JIT support.

Obvious workaround is to the root cause is to ask compiler to prefer
library from /usr/local/lib via ./configure --with-ld-opt="-L/usr/local/lib".
On the other hand, in any case it would be good to check if the function
we are going to use is available, hence the change.

See thread here for details:
http://mailman.nginx.org/pipermail/nginx-devel/2012-December/003074.html

Prodded by Piotr Sikora.
2012-12-12 13:50:07 +00:00
Ruslan Ermilov
760c55a702 Fixed build with embedded perl in certain setups (ticket #48). 2012-12-03 16:00:26 +00:00
Maxim Dounin
85c920a0cd OCSP stapling: ssl_stapling_file support.
Very basic version without any OCSP responder query code, assuming valid
DER-encoded OCSP response is present in a ssl_stapling_file configured.

Such file might be produced with openssl like this:

openssl ocsp -issuer root.crt -cert domain.crt -respout domain.staple \
             -url http://ocsp.example.com
2012-10-01 12:41:08 +00:00
Andrey Belov
8be233c8f2 Correct plural form for "path" in the whole source base. 2012-09-28 13:49:26 +00:00
Andrey Belov
181d58f9c9 Configure: additional test for ExtUtils::Embed perl module presence.
Now perl configure will correctly fail if ExtUtils::Embed perl module
is not present in the system (found on Amazon Linux AMI, as of
release 2012.03).
2012-09-27 15:01:57 +00:00
Maxim Dounin
8a1a54b0d6 Configure: help updated to list upstream keepalive and least_conn.
Patch by Joshua Zhu.
2012-09-26 16:39:38 +00:00
Maxim Dounin
27b9435343 Configure: fixed make macros to use parentheses instead of braces.
Parentheses are more portable, in particular they are understood by nmake
while braces aren't.
2012-09-11 12:43:59 +00:00
Maxim Dounin
8522a2a707 Configure: provide inflate() when building zlib on win32.
It is now needed for gunzip filter.
2012-09-11 12:35:30 +00:00
Maxim Dounin
90bd33e8eb Gunzip filter import. 2012-09-10 16:52:47 +00:00
Ruslan Ermilov
7f3a352e5a Removed extraneous GCC warning flags. 2012-07-29 19:45:30 +00:00
Ruslan Ermilov
a6c9e09476 Added the Clang compiler support.
The -Werror is commented out to not break builds on Linux.
2012-07-24 15:17:03 +00:00
Ruslan Ermilov
9911ea4cd0 Made sure to run configure in a "C" locale.
Otherwise, we may fail to properly detect a version of compiler.
2012-07-24 15:16:09 +00:00
Ruslan Ermilov
2d60cd7efa Added a commented out -Wmissing-prototypes to CFLAGS.
It is commented out to not break builds with 3rd party modules.
2012-07-24 15:13:34 +00:00
Ruslan Ermilov
7e72000482 Replaced a number of "else if" with "elif". 2012-07-24 15:00:42 +00:00
Maxim Dounin
8aaf9d35b7 Configure: fixed "make" used instead of "${MAKE}". 2012-07-07 09:35:30 +00:00
Ruslan Ermilov
835ad6b98b Added code to look up Google perftools in /opt/local/, for MacPorts. 2012-06-26 08:15:40 +00:00
Ruslan Ermilov
42444811b9 Fixed compile-time conditionals used to detect if X-Forwarded-For support
is needed.
2012-06-21 11:02:22 +00:00
Maxim Dounin
97f7bf25c9 Fixed "sendmsg() failed" alerts on HP-UX.
HP-UX needs _HPUX_ALT_XOPEN_SOCKET_API to be defined to be able to
use various POSIX versions of networking functions.  Notably sendmsg()
resulted in "sendmsg() failed (9: Bad file number)" alerts without it.

See xopen_networking(7) for more details.
2012-06-18 14:11:29 +00:00
Maxim Dounin
c45bd10b1c Changed default alignment to 16.
This fixes alignment problems observerd on ARMs, and likely also needed
for MIPSes.  Unless we know alignment is not required just assume we
need 16, which appears to be safe default for all architectures.

See here for details:
http://mailman.nginx.org/pipermail/nginx/2012-June/034139.html
2012-06-18 14:09:54 +00:00
Ruslan Ermilov
d4353c6fd3 Fixed spelling of "endianness", and called it "byte ordering" in the
user visible part.
2012-06-08 09:41:55 +00:00
Maxim Dounin
4cb4e8d179 Upstream: least_conn balancer module. 2012-06-03 23:21:26 +00:00
Valentin Bartenev
430ab81a72 Fixed building --with-cpp_test_module on some systems. 2012-05-17 15:12:45 +00:00