Mercurial > hg > nginx
annotate auto/cc/sunc @ 1316:f5bb5521d02c
bump version
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 17 Jul 2007 10:15:07 +0000 |
parents | 08c6ee7a1b11 |
children | d01f9856e3a0 |
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" | |
42 ngx_amd64="-amd64" | |
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" | |
561 | 77 |
78 | |
79 case $CPU in | |
80 pentium) | |
81 # optimize for Pentium and Athlon | |
82 CPU_OPT="-xchip=pentium" | |
83 ;; | |
84 | |
85 pentiumpro) | |
86 # optimize for Pentium Pro, Pentium II | |
87 CPU_OPT="-xchip=pentium_pro" | |
88 ;; | |
89 | |
90 pentium3) | |
91 # optimize for Pentium III | |
92 CPU_OPT="-xchip=pentium3" | |
93 #CPU_OPT="$CPU_OPT -xarch=sse" | |
94 CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4" | |
95 ;; | |
96 | |
97 pentium4) | |
98 # optimize for Pentium 4 | |
99 CPU_OPT="-xchip=pentium4" | |
100 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
101 CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8" | |
102 ;; | |
103 | |
104 opteron) | |
105 # optimize for Opteron | |
106 CPU_OPT="-xchip=opteron" | |
107 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
108 CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16" | |
109 ;; | |
110 | |
1308
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
111 sparc32) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
112 # build 32-bit UltraSparc binary |
1309 | 113 CPU_OPT="$ngx_sparc32" |
114 CORE_LINK="$CORE_LINK $ngx_sparc32" | |
115 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
|
116 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
117 ;; |
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 sparc64) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
120 # build 64-bit UltraSparc binary |
1309 | 121 CPU_OPT="$ngx_sparc64" |
122 CORE_LINK="$CORE_LINK $ngx_sparc64" | |
123 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
|
124 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
125 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
126 |
561 | 127 amd64) |
128 # build 64-bit amd64 binary | |
1309 | 129 CPU_OPT="$ngx_amd64" |
130 CORE_LINK="$CORE_LINK $ngx_amd64" | |
131 CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd4" | |
561 | 132 NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il" |
1309 | 133 NGX_CPU_CACHE_LINE=64 |
561 | 134 ;; |
135 | |
136 esac | |
137 | |
138 | |
139 CFLAGS="$CFLAGS $CPU_OPT" | |
140 | |
141 | |
142 if [ ".$PCRE_OPT" = "." ]; then | |
1309 | 143 PCRE_OPT="-fast $IPO $CPU_OPT" |
561 | 144 fi |
145 | |
146 if [ ".$MD5_OPT" = "." ]; then | |
1309 | 147 MD5_OPT="-fast $IPO $CPU_OPT" |
561 | 148 fi |
149 | |
150 if [ ".$ZLIB_OPT" = "." ]; then | |
1309 | 151 ZLIB_OPT="-fast $IPO $CPU_OPT" |
561 | 152 fi |
153 | |
154 | |
155 # stop on warning | |
156 CFLAGS="$CFLAGS -errwarn=%all" |