annotate auto/cc/clang @ 5059:0419c3321bf2 stable-1.2

Merge of r5012: configure: removed redundant variable assignment.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 11 Feb 2013 15:28:50 +0000
parents 24f2b8495f7d
children f1daa0356a1d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4799
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2 # Copyright (C) Nginx, Inc.
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
3
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
4
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
5 # clang
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
6
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
7
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
8 NGX_CLANG_VER=`$CC -v 2>&1 | grep 'clang version' 2>&1 \
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
9 | sed -e 's/^.*clang version \(.*\)/\1/'`
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
10
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
11 echo " + clang version: $NGX_CLANG_VER"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
12
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
13 have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
14
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
15
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
16 CC_TEST_FLAGS="-pipe"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
17
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
18
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
19 # optimizations
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
20
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
21 #NGX_CLANG_OPT="-O2"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
22 #NGX_CLANG_OPT="-Oz"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
23 NGX_CLANG_OPT="-O"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
24
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
25 case $CPU in
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
26 pentium)
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
27 # optimize for Pentium
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
28 CPU_OPT="-march=pentium"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
29 NGX_CPU_CACHE_LINE=32
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
30 ;;
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
31
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
32 pentiumpro | pentium3)
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
33 # optimize for Pentium Pro, Pentium II and Pentium III
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
34 CPU_OPT="-march=pentiumpro"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
35 NGX_CPU_CACHE_LINE=32
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
36 ;;
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
37
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
38 pentium4)
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
39 # optimize for Pentium 4
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
40 CPU_OPT="-march=pentium4"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
41 NGX_CPU_CACHE_LINE=128
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
42 ;;
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
43
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
44 athlon)
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
45 # optimize for Athlon
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
46 CPU_OPT="-march=athlon"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
47 NGX_CPU_CACHE_LINE=64
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
48 ;;
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
49
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
50 opteron)
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
51 # optimize for Opteron
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
52 CPU_OPT="-march=opteron"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
53 NGX_CPU_CACHE_LINE=64
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
54 ;;
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
55
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
56 esac
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
57
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
58 CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
59
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
60
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
61 CFLAGS="$CFLAGS -pipe $CPU_OPT"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
62
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
63 if [ ".$PCRE_OPT" = "." ]; then
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
64 PCRE_OPT="-O2 -pipe $CPU_OPT"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
65 else
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
66 PCRE_OPT="$PCRE_OPT -pipe"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
67 fi
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
68
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
69 if [ ".$MD5_OPT" = "." ]; then
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
70 MD5_OPT="-O2 -pipe $CPU_OPT"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
71 else
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
72 MD5_OPT="$MD5_OPT -pipe"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
73 fi
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
74
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
75 if [ ".$ZLIB_OPT" = "." ]; then
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
76 ZLIB_OPT="-O2 -pipe $CPU_OPT"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
77 else
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
78 ZLIB_OPT="$ZLIB_OPT -pipe"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
79 fi
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
80
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
81
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
82 # warnings
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
83
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
84 CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
85 #CFLAGS="$CFLAGS -Wmissing-prototypes"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
86
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
87 # we have a lot of unused function arguments
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
88 CFLAGS="$CFLAGS -Wno-unused-parameter"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
89
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
90 # stop on warning
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
91 #CFLAGS="$CFLAGS -Werror"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
92
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
93 # debug
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
94 CFLAGS="$CFLAGS -g"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
95
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
96 if [ ".$CPP" = "." ]; then
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
97 CPP="$CC -E"
24f2b8495f7d Merge of r4763: added the Clang compiler support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
98 fi