2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
# Copyright (C) Igor Sysoev
|
2012-01-18 23:07:43 +08:00
|
|
|
# Copyright (C) Nginx, Inc.
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
|
2005-03-01 23:20:36 +08:00
|
|
|
# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
|
2005-06-07 23:56:31 +08:00
|
|
|
# 4.0.0, 4.0.1, 4.1.0
|
2005-03-19 20:38:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
|
|
|
|
| sed -e 's/^.* version \(.*\)/\1/'`
|
|
|
|
|
|
|
|
echo " + gcc version: $NGX_GCC_VER"
|
2004-10-21 23:34:38 +08:00
|
|
|
|
2005-10-07 21:30:52 +08:00
|
|
|
have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
# Solaris 7's /usr/ccs/bin/as does not support "-pipe"
|
|
|
|
|
|
|
|
CC_TEST_FLAGS="-pipe"
|
|
|
|
|
2005-11-15 21:30:52 +08:00
|
|
|
ngx_feature="gcc -pipe switch"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_name=
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
2006-11-27 19:07:09 +08:00
|
|
|
ngx_feature_path=
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test=
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
CC_TEST_FLAGS=
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
PIPE="-pipe"
|
|
|
|
fi
|
|
|
|
|
2005-10-12 21:50:36 +08:00
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
case "$NGX_MACHINE" in
|
2005-10-12 21:50:36 +08:00
|
|
|
|
2006-10-06 04:03:34 +08:00
|
|
|
sun4u | sun4v | sparc | sparc64 )
|
2005-10-19 20:33:58 +08:00
|
|
|
# "-mcpu=v9" enables the "casa" assembler instruction
|
2005-10-12 21:50:36 +08:00
|
|
|
CFLAGS="$CFLAGS -mcpu=v9"
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
# optimizations
|
|
|
|
|
2005-02-09 22:31:07 +08:00
|
|
|
#NGX_GCC_OPT="-O2"
|
|
|
|
#NGX_GCC_OPT="-Os"
|
|
|
|
NGX_GCC_OPT="-O"
|
|
|
|
|
|
|
|
#CFLAGS="$CFLAGS -fomit-frame-pointer"
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
case $CPU in
|
|
|
|
pentium)
|
|
|
|
# optimize for Pentium and Athlon
|
|
|
|
CPU_OPT="-march=pentium"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=32
|
2004-10-21 23:34:38 +08:00
|
|
|
;;
|
|
|
|
|
2005-10-12 21:50:36 +08:00
|
|
|
pentiumpro | pentium3)
|
2004-10-21 23:34:38 +08:00
|
|
|
# optimize for Pentium Pro, Pentium II and Pentium III
|
|
|
|
CPU_OPT="-march=pentiumpro"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=32
|
2004-10-21 23:34:38 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
pentium4)
|
|
|
|
# optimize for Pentium 4, gcc 3.x
|
|
|
|
CPU_OPT="-march=pentium4"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=128
|
2004-10-21 23:34:38 +08:00
|
|
|
;;
|
|
|
|
|
2005-06-07 23:56:31 +08:00
|
|
|
athlon)
|
|
|
|
# optimize for Athlon, gcc 3.x
|
|
|
|
CPU_OPT="-march=athlon"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=64
|
2005-06-07 23:56:31 +08:00
|
|
|
;;
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 22:58:06 +08:00
|
|
|
opteron)
|
|
|
|
# optimize for Opteron, gcc 3.x
|
|
|
|
CPU_OPT="-march=opteron"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=64
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 22:58:06 +08:00
|
|
|
;;
|
|
|
|
|
2005-11-26 18:11:11 +08:00
|
|
|
sparc32)
|
|
|
|
# build 32-bit UltraSparc binary
|
|
|
|
CPU_OPT="-m32"
|
|
|
|
CORE_LINK="$CORE_LINK -m32"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=64
|
2005-11-26 18:11:11 +08:00
|
|
|
;;
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
sparc64)
|
|
|
|
# build 64-bit UltraSparc binary
|
|
|
|
CPU_OPT="-m64"
|
|
|
|
CORE_LINK="$CORE_LINK -m64"
|
2005-12-16 23:07:08 +08:00
|
|
|
NGX_CPU_CACHE_LINE=64
|
2004-10-21 23:34:38 +08:00
|
|
|
;;
|
|
|
|
|
2006-02-16 23:26:46 +08:00
|
|
|
ppc64)
|
|
|
|
# build 64-bit PowerPC binary
|
|
|
|
CPU_OPT="-m64"
|
|
|
|
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"
|
|
|
|
NGX_CPU_CACHE_LINE=128
|
|
|
|
;;
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
esac
|
|
|
|
|
2009-11-26 01:34:35 +08:00
|
|
|
CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
|
2004-10-21 23:34:38 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
case "$NGX_GCC_VER" in
|
|
|
|
2.7*)
|
|
|
|
# batch build
|
|
|
|
CPU_OPT=
|
|
|
|
;;
|
|
|
|
esac
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
CFLAGS="$CFLAGS $PIPE $CPU_OPT"
|
|
|
|
|
|
|
|
if [ ".$PCRE_OPT" = "." ]; then
|
|
|
|
PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
|
|
|
|
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
|
|
|
|
ZLIB_OPT="$ZLIB_OPT $PIPE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# warnings
|
|
|
|
|
2005-02-09 22:31:07 +08:00
|
|
|
# -W requires at least -O
|
2007-01-12 00:20:18 +08:00
|
|
|
CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
|
2005-02-09 22:31:07 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
CFLAGS="$CFLAGS -Wall -Wpointer-arith"
|
2005-11-15 21:30:52 +08:00
|
|
|
#CFLAGS="$CFLAGS -Wconversion"
|
2004-10-21 23:34:38 +08:00
|
|
|
#CFLAGS="$CFLAGS -Winline"
|
2012-07-24 23:13:34 +08:00
|
|
|
#CFLAGS="$CFLAGS -Wmissing-prototypes"
|
2004-10-21 23:34:38 +08:00
|
|
|
|
2005-03-19 20:38:37 +08:00
|
|
|
|
|
|
|
case "$NGX_GCC_VER" in
|
|
|
|
3.* | 4.* )
|
|
|
|
# we have a lot of the unused function arguments
|
|
|
|
CFLAGS="$CFLAGS -Wno-unused-parameter"
|
2009-04-24 23:31:13 +08:00
|
|
|
# 4.2.1 shows the warning in wrong places
|
2005-03-19 20:38:37 +08:00
|
|
|
#CFLAGS="$CFLAGS -Wunreachable-code"
|
2014-05-28 21:41:44 +08:00
|
|
|
|
|
|
|
# deprecated system OpenSSL library on OS X
|
|
|
|
if [ "$NGX_SYSTEM" = "Darwin" ]; then
|
|
|
|
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
|
|
|
|
fi
|
2005-03-19 20:38:37 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
# we have a lot of the unused function arguments
|
|
|
|
CFLAGS="$CFLAGS -Wno-unused"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
# stop on warning
|
|
|
|
CFLAGS="$CFLAGS -Werror"
|
|
|
|
|
|
|
|
# debug
|
|
|
|
CFLAGS="$CFLAGS -g"
|
|
|
|
|
|
|
|
# DragonFly's gcc3 generates DWARF
|
|
|
|
#CFLAGS="$CFLAGS -g -gstabs"
|
|
|
|
|
|
|
|
if [ ".$CPP" = "." ]; then
|
|
|
|
CPP="$CC -E"
|
|
|
|
fi
|