Mercurial > hg > nginx
annotate auto/cc/gcc @ 3484:81457372d938
chunked_transfer_encoding
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 01 Apr 2010 10:18:00 +0000 |
parents | 7660f0221cf1 |
children | d620f497c50f |
rev | line source |
---|---|
455 | 1 |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
501 | 5 # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2 |
497 | 6 # 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 | 7 # 4.0.0, 4.0.1, 4.1.0 |
501 | 8 |
9 | |
10 NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \ | |
11 | sed -e 's/^.* version \(.*\)/\1/'` | |
12 | |
13 echo " + gcc version: $NGX_GCC_VER" | |
455 | 14 |
557 | 15 have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define |
16 | |
455 | 17 |
18 # Solaris 7's /usr/ccs/bin/as does not support "-pipe" | |
19 | |
20 CC_TEST_FLAGS="-pipe" | |
21 | |
577 | 22 ngx_feature="gcc -pipe switch" |
455 | 23 ngx_feature_name= |
24 ngx_feature_run=no | |
25 ngx_feature_incs= | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
743
diff
changeset
|
26 ngx_feature_path= |
455 | 27 ngx_feature_libs= |
28 ngx_feature_test= | |
29 . auto/feature | |
30 | |
31 CC_TEST_FLAGS= | |
32 | |
33 if [ $ngx_found = yes ]; then | |
34 PIPE="-pipe" | |
35 fi | |
36 | |
561 | 37 |
581 | 38 case "$NGX_MACHINE" in |
561 | 39 |
743 | 40 sun4u | sun4v | sparc | sparc64 ) |
563 | 41 # "-mcpu=v9" enables the "casa" assembler instruction |
561 | 42 CFLAGS="$CFLAGS -mcpu=v9" |
43 ;; | |
44 | |
45 esac | |
46 | |
47 | |
455 | 48 # optimizations |
49 | |
487 | 50 #NGX_GCC_OPT="-O2" |
51 #NGX_GCC_OPT="-Os" | |
52 NGX_GCC_OPT="-O" | |
53 | |
54 #CFLAGS="$CFLAGS -fomit-frame-pointer" | |
455 | 55 |
56 case $CPU in | |
57 pentium) | |
58 # optimize for Pentium and Athlon | |
59 CPU_OPT="-march=pentium" | |
589 | 60 NGX_CPU_CACHE_LINE=32 |
455 | 61 ;; |
62 | |
561 | 63 pentiumpro | pentium3) |
455 | 64 # optimize for Pentium Pro, Pentium II and Pentium III |
65 CPU_OPT="-march=pentiumpro" | |
589 | 66 NGX_CPU_CACHE_LINE=32 |
455 | 67 ;; |
68 | |
69 pentium4) | |
70 # optimize for Pentium 4, gcc 3.x | |
71 CPU_OPT="-march=pentium4" | |
589 | 72 NGX_CPU_CACHE_LINE=128 |
455 | 73 ;; |
74 | |
521 | 75 athlon) |
76 # optimize for Athlon, gcc 3.x | |
77 CPU_OPT="-march=athlon" | |
589 | 78 NGX_CPU_CACHE_LINE=64 |
521 | 79 ;; |
80 | |
509 | 81 opteron) |
82 # optimize for Opteron, gcc 3.x | |
83 CPU_OPT="-march=opteron" | |
589 | 84 NGX_CPU_CACHE_LINE=64 |
509 | 85 ;; |
86 | |
581 | 87 sparc32) |
88 # build 32-bit UltraSparc binary | |
89 CPU_OPT="-m32" | |
90 CORE_LINK="$CORE_LINK -m32" | |
589 | 91 NGX_CPU_CACHE_LINE=64 |
581 | 92 ;; |
93 | |
455 | 94 sparc64) |
95 # build 64-bit UltraSparc binary | |
96 CPU_OPT="-m64" | |
97 CORE_LINK="$CORE_LINK -m64" | |
589 | 98 NGX_CPU_CACHE_LINE=64 |
455 | 99 ;; |
100 | |
613 | 101 ppc64) |
102 # build 64-bit PowerPC binary | |
103 CPU_OPT="-m64" | |
104 CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32" | |
105 CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32" | |
106 CORE_LINK="$CORE_LINK -m64" | |
107 NGX_CPU_CACHE_LINE=128 | |
108 ;; | |
109 | |
455 | 110 esac |
111 | |
3362
b57a4a704f3c
GCC 4.1 builtin atomic operations
Igor Sysoev <igor@sysoev.ru>
parents:
2751
diff
changeset
|
112 CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT" |
455 | 113 |
501 | 114 case "$NGX_GCC_VER" in |
115 2.7*) | |
116 # batch build | |
117 CPU_OPT= | |
118 ;; | |
119 esac | |
455 | 120 |
121 | |
122 CFLAGS="$CFLAGS $PIPE $CPU_OPT" | |
123 | |
124 if [ ".$PCRE_OPT" = "." ]; then | |
125 PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT" | |
126 else | |
127 PCRE_OPT="$PCRE_OPT $PIPE" | |
128 fi | |
129 | |
130 if [ ".$MD5_OPT" = "." ]; then | |
131 MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT" | |
132 else | |
133 MD5_OPT="$MD5_OPT $PIPE" | |
134 fi | |
135 | |
136 if [ ".$ZLIB_OPT" = "." ]; then | |
137 ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT" | |
138 else | |
139 ZLIB_OPT="$ZLIB_OPT $PIPE" | |
140 fi | |
141 | |
142 | |
143 # warnings | |
144 | |
487 | 145 # -W requires at least -O |
1010 | 146 CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W" |
487 | 147 |
455 | 148 CFLAGS="$CFLAGS -Wall -Wpointer-arith" |
577 | 149 #CFLAGS="$CFLAGS -Wconversion" |
455 | 150 #CFLAGS="$CFLAGS -Winline" |
151 | |
501 | 152 |
153 case "$NGX_GCC_VER" in | |
154 3.* | 4.* ) | |
155 # we have a lot of the unused function arguments | |
156 CFLAGS="$CFLAGS -Wno-unused-parameter" | |
2751 | 157 CFLAGS="$CFLAGS -Wunused-function" |
563 | 158 CFLAGS="$CFLAGS -Wunused-variable" |
159 CFLAGS="$CFLAGS -Wunused-value" | |
2751 | 160 # 4.2.1 shows the warning in wrong places |
501 | 161 #CFLAGS="$CFLAGS -Wunreachable-code" |
162 ;; | |
163 | |
164 *) | |
165 # we have a lot of the unused function arguments | |
166 CFLAGS="$CFLAGS -Wno-unused" | |
167 ;; | |
168 esac | |
169 | |
455 | 170 |
171 # stop on warning | |
172 CFLAGS="$CFLAGS -Werror" | |
173 | |
174 # debug | |
175 CFLAGS="$CFLAGS -g" | |
176 | |
177 # DragonFly's gcc3 generates DWARF | |
178 #CFLAGS="$CFLAGS -g -gstabs" | |
179 | |
180 if [ ".$CPP" = "." ]; then | |
181 CPP="$CC -E" | |
182 fi |