Mercurial > hg > nginx-quic
annotate auto/cc/sunc @ 6866:0a268ae349ab
Version bump.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 10 Jan 2017 17:13:01 +0300 |
parents | e3faa5fb7772 |
children | d8e8ced78e77 |
rev | line source |
---|---|
561 | 1 |
2 # Copyright (C) Igor Sysoev | |
4412 | 3 # Copyright (C) Nginx, Inc. |
561 | 4 |
5 | |
1309 | 6 # Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10 |
7 # Sun C 5.8 2005/10/13 Sun Studio 11 | |
8 # Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12 | |
9 # Sun C 5.9 SunOS_sparc 2007/05/03 | |
4004
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
10 # Sun C 5.10 SunOS_i386 2009/06/03 Sun Studio 12.1 |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
11 # Sun C 5.11 SunOS_i386 2010/08/13 Sun Studio 12.2 |
561 | 12 |
13 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
|
14 | sed -e 's/^.* Sun C \(.*\)/\1/'` |
561 | 15 |
16 echo " + Sun C version: $NGX_SUNC_VER" | |
17 | |
18 have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define | |
19 | |
20 | |
1309 | 21 cat << END > $NGX_AUTOTEST.c |
22 | |
6624
e3faa5fb7772
Configure: fix build with -Werror=old-style-definition.
Piotr Sikora <piotrsikora@google.com>
parents:
6603
diff
changeset
|
23 int main(void) { |
e3faa5fb7772
Configure: fix build with -Werror=old-style-definition.
Piotr Sikora <piotrsikora@google.com>
parents:
6603
diff
changeset
|
24 printf("%d", __SUNPRO_C); |
e3faa5fb7772
Configure: fix build with -Werror=old-style-definition.
Piotr Sikora <piotrsikora@google.com>
parents:
6603
diff
changeset
|
25 return 0; |
e3faa5fb7772
Configure: fix build with -Werror=old-style-definition.
Piotr Sikora <piotrsikora@google.com>
parents:
6603
diff
changeset
|
26 } |
1309 | 27 |
28 END | |
29 | |
30 eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" | |
31 | |
32 if [ -x $NGX_AUTOTEST ]; then | |
33 ngx_sunc_ver=`$NGX_AUTOTEST` | |
34 fi | |
35 | |
5309
434548349838
Configure: fixed autotest cleanup commands.
Sergey Kandaurov <pluknet@nginx.com>
parents:
4412
diff
changeset
|
36 rm -rf $NGX_AUTOTEST* |
1309 | 37 |
38 # 1424 == 0x590, Sun Studio 12 | |
39 | |
40 if [ "$ngx_sunc_ver" -ge 1424 ]; then | |
41 ngx_sparc32="-m32" | |
42 ngx_sparc64="-m64" | |
43 ngx_amd64="-m64" | |
44 | |
45 else | |
46 ngx_sparc32="-xarch=v8plus" | |
47 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
|
48 ngx_amd64="-xarch=amd64" |
1309 | 49 fi |
50 | |
744 | 51 case "$NGX_MACHINE" in |
561 | 52 |
744 | 53 i86pc) |
561 | 54 NGX_AUX=" src/os/unix/ngx_sunpro_x86.il" |
55 ;; | |
56 | |
744 | 57 sun4u | sun4v) |
561 | 58 NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il" |
59 ;; | |
60 | |
61 esac | |
62 | |
6383 | 63 MAIN_LINK= |
64 MODULE_LINK="-G" | |
65 | |
561 | 66 |
67 # optimizations | |
68 | |
4004
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
69 # 20736 == 0x5100, Sun Studio 12.1 |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
70 |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
71 if [ "$ngx_sunc_ver" -ge 20736 ]; then |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
72 ngx_fast="-fast" |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
73 |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
74 else |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
75 # older versions had problems with bit-fields |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
76 ngx_fast="-fast -xalias_level=any" |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
77 fi |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
78 |
1309 | 79 IPO=-xipo |
4004
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
80 CFLAGS="$CFLAGS $ngx_fast $IPO" |
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
81 CORE_LINK="$CORE_LINK $ngx_fast $IPO" |
561 | 82 |
83 | |
84 case $CPU in | |
85 pentium) | |
86 # optimize for Pentium and Athlon | |
87 CPU_OPT="-xchip=pentium" | |
88 ;; | |
89 | |
90 pentiumpro) | |
91 # optimize for Pentium Pro, Pentium II | |
92 CPU_OPT="-xchip=pentium_pro" | |
93 ;; | |
94 | |
95 pentium3) | |
96 # optimize for Pentium III | |
97 CPU_OPT="-xchip=pentium3" | |
98 #CPU_OPT="$CPU_OPT -xarch=sse" | |
99 CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4" | |
100 ;; | |
101 | |
102 pentium4) | |
103 # optimize for Pentium 4 | |
104 CPU_OPT="-xchip=pentium4" | |
105 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
106 CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8" | |
107 ;; | |
108 | |
109 opteron) | |
110 # optimize for Opteron | |
111 CPU_OPT="-xchip=opteron" | |
112 #CPU_OPT="$CPU_OPT -xarch=sse2" | |
113 CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16" | |
114 ;; | |
115 | |
1308
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
116 sparc32) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
117 # build 32-bit UltraSparc binary |
1309 | 118 CPU_OPT="$ngx_sparc32" |
119 CORE_LINK="$CORE_LINK $ngx_sparc32" | |
120 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
|
121 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
122 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
123 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
124 sparc64) |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
125 # build 64-bit UltraSparc binary |
1309 | 126 CPU_OPT="$ngx_sparc64" |
127 CORE_LINK="$CORE_LINK $ngx_sparc64" | |
128 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
|
129 NGX_CPU_CACHE_LINE=64 |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
130 ;; |
63fa39cf8bd0
--with-cpu-opt=sparc32 and --with-cpu-opt=sparc64
Igor Sysoev <igor@sysoev.ru>
parents:
1307
diff
changeset
|
131 |
561 | 132 amd64) |
133 # build 64-bit amd64 binary | |
1309 | 134 CPU_OPT="$ngx_amd64" |
135 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
|
136 CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64" |
561 | 137 NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il" |
1309 | 138 NGX_CPU_CACHE_LINE=64 |
561 | 139 ;; |
140 | |
141 esac | |
142 | |
143 | |
144 CFLAGS="$CFLAGS $CPU_OPT" | |
145 | |
146 | |
147 if [ ".$PCRE_OPT" = "." ]; then | |
4004
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
148 PCRE_OPT="$ngx_fast $IPO $CPU_OPT" |
561 | 149 fi |
150 | |
151 if [ ".$ZLIB_OPT" = "." ]; then | |
4004
84bd993b8cd3
Lower optimization level for Sun Studio before 12.1.
Maxim Dounin <mdounin@mdounin.ru>
parents:
2818
diff
changeset
|
152 ZLIB_OPT="$ngx_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" |