summaryrefslogtreecommitdiff
path: root/auto
diff options
context:
space:
mode:
authorNGINX team <nginx@nginx.org>2012-07-31 13:06:43 +0000
committerJon Kolb <jon@b0g.us>2012-07-31 13:06:43 +0000
commitc5f35ac53731b0475f8ec5a73ee6b9a9d8d3550d (patch)
treef039d046073909b1aff446135bf99b22310f0618 /auto
parent2c96fd00bd0883a74d888dae3c90112cf6f02395 (diff)
downloadnginx-c5f35ac53731b0475f8ec5a73ee6b9a9d8d3550d.tar.gz
Changes with nginx 1.3.4 31 Jul 2012v1.3.4
*) Change: the "ipv6only" parameter is now turned on by default for listening IPv6 sockets. *) Feature: the Clang compiler support. *) Bugfix: extra listening sockets might be created. Thanks to Roman Odaisky. *) Bugfix: nginx/Windows might hog CPU if a worker process failed to start. Thanks to Ricardo Villalobos Guevara. *) Bugfix: the "proxy_pass_header", "fastcgi_pass_header", "scgi_pass_header", "uwsgi_pass_header", "proxy_hide_header", "fastcgi_hide_header", "scgi_hide_header", and "uwsgi_hide_header" directives might be inherited incorrectly. _______________________________________________ nginx-announce mailing list nginx-announce@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx-announce
Diffstat (limited to 'auto')
-rw-r--r--auto/cc/clang98
-rw-r--r--auto/cc/conf6
-rw-r--r--auto/cc/gcc4
-rw-r--r--auto/cc/name40
4 files changed, 119 insertions, 29 deletions
diff --git a/auto/cc/clang b/auto/cc/clang
new file mode 100644
index 000000000..9f60d7b3a
--- /dev/null
+++ b/auto/cc/clang
@@ -0,0 +1,98 @@
+
+# Copyright (C) Nginx, Inc.
+
+
+# clang
+
+
+NGX_CLANG_VER=`$CC -v 2>&1 | grep 'clang version' 2>&1 \
+ | sed -e 's/^.*clang version \(.*\)/\1/'`
+
+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 [ ".$MD5_OPT" = "." ]; then
+ MD5_OPT="-O2 -pipe $CPU_OPT"
+else
+ MD5_OPT="$MD5_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 -Wmissing-prototypes"
+
+# we have a lot of unused function arguments
+CFLAGS="$CFLAGS -Wno-unused-parameter"
+
+# stop on warning
+#CFLAGS="$CFLAGS -Werror"
+
+# debug
+CFLAGS="$CFLAGS -g"
+
+if [ ".$CPP" = "." ]; then
+ CPP="$CC -E"
+fi
diff --git a/auto/cc/conf b/auto/cc/conf
index c9118f2fd..8027b9805 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -56,6 +56,12 @@ else
. auto/cc/gcc
;;
+ clang)
+ # Clang C compiler
+
+ . auto/cc/clang
+ ;;
+
icc)
# Intel C++ compiler 7.1, 8.0, 8.1
diff --git a/auto/cc/gcc b/auto/cc/gcc
index de666a34c..c27d857e3 100644
--- a/auto/cc/gcc
+++ b/auto/cc/gcc
@@ -149,15 +149,13 @@ 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
3.* | 4.* )
# we have a lot of the unused function arguments
CFLAGS="$CFLAGS -Wno-unused-parameter"
- CFLAGS="$CFLAGS -Wunused-function"
- CFLAGS="$CFLAGS -Wunused-variable"
- CFLAGS="$CFLAGS -Wunused-value"
# 4.2.1 shows the warning in wrong places
#CFLAGS="$CFLAGS -Wunreachable-code"
;;
diff --git a/auto/cc/name b/auto/cc/name
index 7860c69e2..7a5656c64 100644
--- a/auto/cc/name
+++ b/auto/cc/name
@@ -32,14 +32,14 @@ if [ "$CC" = cl ]; then
NGX_CC_NAME=msvc10
echo " + using Microsoft Visual C++ 10 compiler"
- else if `$NGX_WINE $CC -v 2>&1 \
+ elif `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
>/dev/null 2>&1`; then
NGX_CC_NAME=msvc8
echo " + using Microsoft Visual C++ 8 compiler"
- else if `$NGX_WINE $CC -v 2>&1 \
+ elif `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
>/dev/null 2>&1`; then
@@ -50,52 +50,40 @@ if [ "$CC" = cl ]; then
NGX_CC_NAME=msvc
echo " + using Microsoft Visual C++ compiler"
fi
- fi
- fi
-else
-if [ "$CC" = wcl386 ]; then
+elif [ "$CC" = wcl386 ]; then
NGX_CC_NAME=owc
echo " + using Open Watcom C compiler"
-else
-if [ "$CC" = bcc32 ]; then
+elif [ "$CC" = bcc32 ]; then
NGX_CC_NAME=bcc
echo " + using Borland C++ compiler"
-else
-if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
+elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
NGX_CC_NAME=icc
echo " + using Intel C++ compiler"
-else
-if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
+elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
NGX_CC_NAME=gcc
echo " + using GNU C compiler"
-else
-if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
+elif `$CC -v 2>&1 | grep 'clang 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
NGX_CC_NAME=sunc
echo " + using Sun C compiler"
-else
-if `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
+elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
NGX_CC_NAME=ccc
echo " + using Compaq C compiler"
-else
-if `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
+elif `$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 # acc
-fi # ccc
-fi # sunc
-fi # icc
-fi # gcc
-fi # bcc
-fi # owc
-fi # msvc
+fi