2 # Copyright (C) Nginx, Inc.
8 NGX_CLANG_VER=`$CC -v 2>&1 | grep '\(clang\|LLVM\) version' 2>&1 \
9 | sed -e 's/^.* version \(.*\)/\1/'`
11 echo " + clang version: $NGX_CLANG_VER"
13 have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
27 # optimize for Pentium
28 CPU_OPT="-march=pentium"
32 pentiumpro | pentium3)
33 # optimize for Pentium Pro, Pentium II and Pentium III
34 CPU_OPT="-march=pentiumpro"
39 # optimize for Pentium 4
40 CPU_OPT="-march=pentium4"
41 NGX_CPU_CACHE_LINE=128
46 CPU_OPT="-march=athlon"
51 # optimize for Opteron
52 CPU_OPT="-march=opteron"
58 CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
61 CFLAGS="$CFLAGS -pipe $CPU_OPT"
63 if [ ".$PCRE_OPT" = "." ]; then
64 PCRE_OPT="-O2 -pipe $CPU_OPT"
66 PCRE_OPT="$PCRE_OPT -pipe"
69 if [ ".$MD5_OPT" = "." ]; then
70 MD5_OPT="-O2 -pipe $CPU_OPT"
72 MD5_OPT="$MD5_OPT -pipe"
75 if [ ".$ZLIB_OPT" = "." ]; then
76 ZLIB_OPT="-O2 -pipe $CPU_OPT"
78 ZLIB_OPT="$ZLIB_OPT -pipe"
84 CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
85 CFLAGS="$CFLAGS -Wconditional-uninitialized"
86 #CFLAGS="$CFLAGS -Wmissing-prototypes"
88 # we have a lot of unused function arguments
89 CFLAGS="$CFLAGS -Wno-unused-parameter"
92 CFLAGS="$CFLAGS -Werror"
97 if [ ".$CPP" = "." ]; then