annotate auto/cc/gcc @ 4569:1db899642518

Upstream: reject upstreams without normal servers. Such upstreams cause CPU hog later in the code as number of peers isn't expected to be 0. Currently this may happen either if there are only backup servers defined in an upstream block, or if server with ipv6 address used in an upstream block.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 02 Apr 2012 21:29:35 +0000
parents d620f497c50f
children d87b45d4a8a0 d1cea70248c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 # Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 3391
diff changeset
3 # Copyright (C) Nginx, Inc.
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
6 # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
497
d7c90bb5ce83 nginx-0.1.23-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 487
diff changeset
7 # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
521
6f00349b98e5 nginx-0.1.35-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
8 # 4.0.0, 4.0.1, 4.1.0
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
9
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
10
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
11 NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
12 | sed -e 's/^.* version \(.*\)/\1/'`
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
13
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
14 echo " + gcc version: $NGX_GCC_VER"
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15
557
ecd9c160f25b nginx-0.3.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 521
diff changeset
16 have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
ecd9c160f25b nginx-0.3.0-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 521
diff changeset
17
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 # Solaris 7's /usr/ccs/bin/as does not support "-pipe"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 CC_TEST_FLAGS="-pipe"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22
577
4d9ea73a627a nginx-0.3.10-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 563
diff changeset
23 ngx_feature="gcc -pipe switch"
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 ngx_feature_name=
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 ngx_feature_run=no
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 ngx_feature_incs=
875
7af8276b1c2f test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents: 743
diff changeset
27 ngx_feature_path=
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 ngx_feature_libs=
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 ngx_feature_test=
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 . auto/feature
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
32 CC_TEST_FLAGS=
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
33
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
34 if [ $ngx_found = yes ]; then
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
35 PIPE="-pipe"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
36 fi
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
37
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
38
581
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
39 case "$NGX_MACHINE" in
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
40
743
543434c675e9 add sun4v
Igor Sysoev <igor@sysoev.ru>
parents: 681
diff changeset
41 sun4u | sun4v | sparc | sparc64 )
563
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
42 # "-mcpu=v9" enables the "casa" assembler instruction
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
43 CFLAGS="$CFLAGS -mcpu=v9"
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
44 ;;
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
45
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
46 esac
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
47
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
48
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
49 # optimizations
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
50
487
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
51 #NGX_GCC_OPT="-O2"
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
52 #NGX_GCC_OPT="-Os"
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
53 NGX_GCC_OPT="-O"
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
54
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
55 #CFLAGS="$CFLAGS -fomit-frame-pointer"
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
56
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
57 case $CPU in
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
58 pentium)
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
59 # optimize for Pentium and Athlon
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
60 CPU_OPT="-march=pentium"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
61 NGX_CPU_CACHE_LINE=32
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
62 ;;
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
63
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 557
diff changeset
64 pentiumpro | pentium3)
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
65 # optimize for Pentium Pro, Pentium II and Pentium III
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
66 CPU_OPT="-march=pentiumpro"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
67 NGX_CPU_CACHE_LINE=32
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
68 ;;
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
69
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
70 pentium4)
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
71 # optimize for Pentium 4, gcc 3.x
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
72 CPU_OPT="-march=pentium4"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
73 NGX_CPU_CACHE_LINE=128
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
74 ;;
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
75
521
6f00349b98e5 nginx-0.1.35-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
76 athlon)
6f00349b98e5 nginx-0.1.35-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
77 # optimize for Athlon, gcc 3.x
6f00349b98e5 nginx-0.1.35-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
78 CPU_OPT="-march=athlon"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
79 NGX_CPU_CACHE_LINE=64
521
6f00349b98e5 nginx-0.1.35-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
80 ;;
6f00349b98e5 nginx-0.1.35-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 509
diff changeset
81
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
82 opteron)
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
83 # optimize for Opteron, gcc 3.x
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
84 CPU_OPT="-march=opteron"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
85 NGX_CPU_CACHE_LINE=64
509
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
86 ;;
9b8c906f6e63 nginx-0.1.29-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 501
diff changeset
87
581
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
88 sparc32)
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
89 # build 32-bit UltraSparc binary
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
90 CPU_OPT="-m32"
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
91 CORE_LINK="$CORE_LINK -m32"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
92 NGX_CPU_CACHE_LINE=64
581
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
93 ;;
326634fb9d47 nginx-0.3.12-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 577
diff changeset
94
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
95 sparc64)
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
96 # build 64-bit UltraSparc binary
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
97 CPU_OPT="-m64"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
98 CORE_LINK="$CORE_LINK -m64"
589
d4e858a5751a nginx-0.3.16-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 583
diff changeset
99 NGX_CPU_CACHE_LINE=64
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
100 ;;
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
101
613
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
102 ppc64)
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
103 # build 64-bit PowerPC binary
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
104 CPU_OPT="-m64"
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
105 CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
106 CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
107 CORE_LINK="$CORE_LINK -m64"
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
108 NGX_CPU_CACHE_LINE=128
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
109 ;;
c73c5c58c619 nginx-0.3.28-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 599
diff changeset
110
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
111 esac
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
112
3362
b57a4a704f3c GCC 4.1 builtin atomic operations
Igor Sysoev <igor@sysoev.ru>
parents: 2751
diff changeset
113 CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
114
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
115 case "$NGX_GCC_VER" in
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
116 2.7*)
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
117 # batch build
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
118 CPU_OPT=
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
119 ;;
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
120 esac
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
121
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
122
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
123 CFLAGS="$CFLAGS $PIPE $CPU_OPT"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
124
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
125 if [ ".$PCRE_OPT" = "." ]; then
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
126 PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
127 else
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
128 PCRE_OPT="$PCRE_OPT $PIPE"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
129 fi
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
130
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
131 if [ ".$MD5_OPT" = "." ]; then
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
132 MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
133 else
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
134 MD5_OPT="$MD5_OPT $PIPE"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
135 fi
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
136
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
137 if [ ".$ZLIB_OPT" = "." ]; then
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
138 ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
139 else
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
140 ZLIB_OPT="$ZLIB_OPT $PIPE"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
141 fi
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
142
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
143
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
144 # warnings
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
145
487
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
146 # -W requires at least -O
1010
d1792e17a559 fix default -O
Igor Sysoev <igor@sysoev.ru>
parents: 875
diff changeset
147 CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
487
31ff3e943e16 nginx-0.1.18-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 485
diff changeset
148
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
149 CFLAGS="$CFLAGS -Wall -Wpointer-arith"
577
4d9ea73a627a nginx-0.3.10-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 563
diff changeset
150 #CFLAGS="$CFLAGS -Wconversion"
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
151 #CFLAGS="$CFLAGS -Winline"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
152
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
153
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
154 case "$NGX_GCC_VER" in
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
155 3.* | 4.* )
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
156 # we have a lot of the unused function arguments
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
157 CFLAGS="$CFLAGS -Wno-unused-parameter"
2751
3b9b67bc0cdc update gcc warnings
Igor Sysoev <igor@sysoev.ru>
parents: 1010
diff changeset
158 CFLAGS="$CFLAGS -Wunused-function"
563
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
159 CFLAGS="$CFLAGS -Wunused-variable"
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
160 CFLAGS="$CFLAGS -Wunused-value"
2751
3b9b67bc0cdc update gcc warnings
Igor Sysoev <igor@sysoev.ru>
parents: 1010
diff changeset
161 # 4.2.1 shows the warning in wrong places
501
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
162 #CFLAGS="$CFLAGS -Wunreachable-code"
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
163 ;;
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
164
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
165 *)
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
166 # we have a lot of the unused function arguments
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
167 CFLAGS="$CFLAGS -Wno-unused"
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
168 ;;
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
169 esac
d4ea69372b94 nginx-0.1.25-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 497
diff changeset
170
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
171
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
172 # stop on warning
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
173 CFLAGS="$CFLAGS -Werror"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
174
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
175 # debug
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
176 CFLAGS="$CFLAGS -g"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
177
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
178 # DragonFly's gcc3 generates DWARF
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
179 #CFLAGS="$CFLAGS -g -gstabs"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
180
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
181 if [ ".$CPP" = "." ]; then
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
182 CPP="$CC -E"
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
183 fi