Mercurial > hg > nginx
annotate auto/cc/sunc @ 3484:81457372d938
chunked_transfer_encoding
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 01 Apr 2010 10:18:00 +0000 |
parents | 7e02df612521 |
children | 84bd993b8cd3 |
rev | line source |
---|---|
561 | 1 |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
1309 | 5 # Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10 |
6 # Sun C 5.8 2005/10/13 Sun Studio 11 | |
7 # Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12 | |
8 # Sun C 5.9 SunOS_sparc 2007/05/03 | |
561 | 9 |
10 NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \ | |
702
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
11 | sed -e 's/^.* Sun C \(.*\)/\1/'` |
561 | 12 |
13 echo " + Sun C version: $NGX_SUNC_VER" | |
14 | |
15 have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define | |
16 | |
17 | |
1309 | 18 cat << END > $NGX_AUTOTEST.c |
19 | |
20 int main() { printf("%d", __SUNPRO_C); } | |
21 | |
22 END | |
23 | |
24 eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" | |
25 | |
26 if [ -x $NGX_AUTOTEST ]; then | |
27 ngx_sunc_ver=`$NGX_AUTOTEST` | |
28 fi | |
29 | |
30 rm $NGX_AUTOTEST* | |
31 | |
32 # 1424 == 0x590, Sun Studio 12 | |
33 | |
34 if [ "$ngx_sunc_ver" -ge 1424 ]; then | |
35 ngx_sparc32="-m32" | |
36 ngx_sparc64="-m64" | |
37 ngx_amd64="-m64" | |
38 | |
39 else | |
40 ngx_sparc32="-xarch=v8plus" | |
41 ngx_sparc64="-xarch=v9" | |
1343
d77866cf2cc4
fix building on amd64 by Sun Studio 11 and more early versions
Igor Sysoev <igor@sysoev.ru>
parents:
1324
diff
changeset
|
42 ngx_amd64="-xarch=amd64" |
1309 | 43 fi |
44 | |
744 | 45 case "$NGX_MACHINE" in |
561 | 46 |
744 | 47 i86pc) |
561 | 48 NGX_AUX=" src/os/unix/ngx_sunpro_x86.il" |
49 ;; | |
50 | |
744 | 51 sun4u | sun4v) |
561 | 52 NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il" |
53 ;; | |
54 | |
55 esac | |
56 | |
57 | |
58 # optimizations | |
59 | |
1309 | 60 IPO=-xipo |
61 CFLAGS="$CFLAGS -fast $IPO" | |
1324
d01f9856e3a0
fix building on amd64 and add -xipo to the link stage
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
62 CORE_LINK="$CORE_LINK -fast $IPO" |
561 | 63 |
64 | |
65 case $CPU in | |
66 pentium) | |
67 # optimize for Pentium and Athlon | |
68 CPU_OPT="-xchip=pentium" | |
69 ;; | |
70 | |
71 pentiumpro) | |
72 # optimize for Pentium Pro, Pentium II | |
73 CPU_OPT="-xchip=pentium_pro" | |
74 ;; | |
75 | |
76 pentium3) | |
77 # optimize for Pentium III | |
78 CPU_OPT="-xchip=pentium3" | |
79 #CPU_OPT="$CPU_OPT -xarch=sse" | |
80 CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4" | |
81 ;; | |
82 | |
83 pentium4) | |
84 # optimize for Pentium 4 | |
85 CPU_OPT="-xchip=pentium4" | |
86 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
87 CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8" | |
88 ;; | |
89 | |
90 opteron) | |
91 # optimize for Opteron | |
92 CPU_OPT="-xchip=opteron" | |
93 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
94 CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16" | |
95 ;; | |
96 | |
1308
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
97 sparc32) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
98 # build 32-bit UltraSparc binary |
1309 | 99 CPU_OPT="$ngx_sparc32" |
100 CORE_LINK="$CORE_LINK $ngx_sparc32" | |
101 CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc32" | |
1308
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
102 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
103 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
104 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
105 sparc64) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
106 # build 64-bit UltraSparc binary |
1309 | 107 CPU_OPT="$ngx_sparc64" |
108 CORE_LINK="$CORE_LINK $ngx_sparc64" | |
109 CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc64" | |
1308
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
110 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
111 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
112 |
561 | 113 amd64) |
114 # build 64-bit amd64 binary | |
1309 | 115 CPU_OPT="$ngx_amd64" |
116 CORE_LINK="$CORE_LINK $ngx_amd64" | |
1324
d01f9856e3a0
fix building on amd64 and add -xipo to the link stage
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
117 CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64" |
561 | 118 NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il" |
1309 | 119 NGX_CPU_CACHE_LINE=64 |
561 | 120 ;; |
121 | |
122 esac | |
123 | |
124 | |
125 CFLAGS="$CFLAGS $CPU_OPT" | |
126 | |
127 | |
128 if [ ".$PCRE_OPT" = "." ]; then | |
1309 | 129 PCRE_OPT="-fast $IPO $CPU_OPT" |
561 | 130 fi |
131 | |
132 if [ ".$MD5_OPT" = "." ]; then | |
1309 | 133 MD5_OPT="-fast $IPO $CPU_OPT" |
561 | 134 fi |
135 | |
136 if [ ".$ZLIB_OPT" = "." ]; then | |
1309 | 137 ZLIB_OPT="-fast $IPO $CPU_OPT" |
561 | 138 fi |
139 | |
140 | |
141 # stop on warning | |
142 CFLAGS="$CFLAGS -errwarn=%all" | |
1375
8d7120543619
add debug info for Sun Studio
Igor Sysoev <igor@sysoev.ru>
parents:
1343
diff
changeset
|
143 |
8d7120543619
add debug info for Sun Studio
Igor Sysoev <igor@sysoev.ru>
parents:
1343
diff
changeset
|
144 # debug |
8d7120543619
add debug info for Sun Studio
Igor Sysoev <igor@sysoev.ru>
parents:
1343
diff
changeset
|
145 CFLAGS="$CFLAGS -g" |