Mercurial > hg > nginx
annotate auto/cc/sunc @ 2638:a3f062177dba stable-0.6
r2336, r2337, r2339, r2390 merge:
bugfixes in error logging:
*) ngx_strerror_r() style and size == 0 bug fix
*) increase ngx_conf_log_error() buffer
*) always log an error code
*) fix segfault on close error
*) compact win32 errno logging
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 01 Apr 2009 15:47:12 +0000 |
parents | 8d7120543619 |
children | 7e02df612521 |
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) |
702
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
48 ngx_feature="PAUSE hardware capability bug" |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
49 ngx_feature_name= |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
50 ngx_feature_run=bug |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
51 ngx_feature_incs= |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
744
diff
changeset
|
52 ngx_feature_path= |
702
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
53 ngx_feature_libs= |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
54 ngx_feature_test='__asm ("pause")' |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
55 |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
56 . auto/feature |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
57 |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
58 if [ $ngx_found = yes ]; then |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
59 # disable [ PAUSE ] hwcap for Sun Studio 11 |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
60 CORE_LINK="$CORE_LINK -Msrc/os/unix/ngx_sunpro_x86.map" |
67deba330372
auto/configure [ PAUSE ] hwcap bug
Igor Sysoev <igor@sysoev.ru>
parents:
697
diff
changeset
|
61 fi |
697
36c51f8f0f4d
disable [ PAUSE ] hwcap for Sun Studio 11
Igor Sysoev <igor@sysoev.ru>
parents:
561
diff
changeset
|
62 |
561 | 63 NGX_AUX=" src/os/unix/ngx_sunpro_x86.il" |
64 ;; | |
65 | |
744 | 66 sun4u | sun4v) |
561 | 67 NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il" |
68 ;; | |
69 | |
70 esac | |
71 | |
72 | |
73 # optimizations | |
74 | |
1309 | 75 IPO=-xipo |
76 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
|
77 CORE_LINK="$CORE_LINK -fast $IPO" |
561 | 78 |
79 | |
80 case $CPU in | |
81 pentium) | |
82 # optimize for Pentium and Athlon | |
83 CPU_OPT="-xchip=pentium" | |
84 ;; | |
85 | |
86 pentiumpro) | |
87 # optimize for Pentium Pro, Pentium II | |
88 CPU_OPT="-xchip=pentium_pro" | |
89 ;; | |
90 | |
91 pentium3) | |
92 # optimize for Pentium III | |
93 CPU_OPT="-xchip=pentium3" | |
94 #CPU_OPT="$CPU_OPT -xarch=sse" | |
95 CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4" | |
96 ;; | |
97 | |
98 pentium4) | |
99 # optimize for Pentium 4 | |
100 CPU_OPT="-xchip=pentium4" | |
101 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
102 CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8" | |
103 ;; | |
104 | |
105 opteron) | |
106 # optimize for Opteron | |
107 CPU_OPT="-xchip=opteron" | |
108 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
109 CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16" | |
110 ;; | |
111 | |
1308
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
112 sparc32) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
113 # build 32-bit UltraSparc binary |
1309 | 114 CPU_OPT="$ngx_sparc32" |
115 CORE_LINK="$CORE_LINK $ngx_sparc32" | |
116 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
|
117 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
118 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
119 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
120 sparc64) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
121 # build 64-bit UltraSparc binary |
1309 | 122 CPU_OPT="$ngx_sparc64" |
123 CORE_LINK="$CORE_LINK $ngx_sparc64" | |
124 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
|
125 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
126 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
127 |
561 | 128 amd64) |
129 # build 64-bit amd64 binary | |
1309 | 130 CPU_OPT="$ngx_amd64" |
131 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
|
132 CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64" |
561 | 133 NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il" |
1309 | 134 NGX_CPU_CACHE_LINE=64 |
561 | 135 ;; |
136 | |
137 esac | |
138 | |
139 | |
140 CFLAGS="$CFLAGS $CPU_OPT" | |
141 | |
142 | |
143 if [ ".$PCRE_OPT" = "." ]; then | |
1309 | 144 PCRE_OPT="-fast $IPO $CPU_OPT" |
561 | 145 fi |
146 | |
147 if [ ".$MD5_OPT" = "." ]; then | |
1309 | 148 MD5_OPT="-fast $IPO $CPU_OPT" |
561 | 149 fi |
150 | |
151 if [ ".$ZLIB_OPT" = "." ]; then | |
1309 | 152 ZLIB_OPT="-fast $IPO $CPU_OPT" |
561 | 153 fi |
154 | |
155 | |
156 # stop on warning | |
157 CFLAGS="$CFLAGS -errwarn=%all" | |
1375
8d7120543619
add debug info for Sun Studio
Igor Sysoev <igor@sysoev.ru>
parents:
1343
diff
changeset
|
158 |
8d7120543619
add debug info for Sun Studio
Igor Sysoev <igor@sysoev.ru>
parents:
1343
diff
changeset
|
159 # debug |
8d7120543619
add debug info for Sun Studio
Igor Sysoev <igor@sysoev.ru>
parents:
1343
diff
changeset
|
160 CFLAGS="$CFLAGS -g" |