comparison auto/cc @ 0:f0b350454894 NGINX_0_1_0

nginx 0.1.0 *) The first public version.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Oct 2004 00:00:00 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0b350454894
1
2 # Copyright (C) Igor Sysoev
3
4
5 CFLAGS="$CFLAGS $CC_OPT"
6
7 case $CC in
8
9 *gcc*)
10 # gcc 2.7.2.3, 2.8.1, 2.95.4,
11 # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4
12
13 # optimizations
14 #CFLAGS="$CFLAGS -O2 -fomit-frame-pointer"
15
16 case $CPU in
17 pentium)
18 # optimize for Pentium and Athlon
19 CPU_OPT="-march=pentium"
20 ;;
21
22 pentiumpro)
23 # optimize for Pentium Pro, Pentium II and Pentium III
24 CPU_OPT="-march=pentiumpro"
25 ;;
26
27 pentium4)
28 # optimize for Pentium 4, gcc 3.x
29 CPU_OPT="-march=pentium4"
30 ;;
31 esac
32
33 # STUB for batch builds
34 if [ $CC = gcc27 ]; then CPU_OPT=; fi
35
36 CFLAGS="$CFLAGS $PIPE $CPU_OPT"
37
38 if [ ".$PCRE_OPT" = "." ]; then
39 PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
40 else
41 PCRE_OPT="$PCRE_OPT $PIPE"
42 fi
43
44 if [ ".$MD5_OPT" = "." ]; then
45 MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
46 else
47 MD5_OPT="$MD5_OPT $PIPE"
48 fi
49
50 if [ ".$ZLIB_OPT" = "." ]; then
51 ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
52 else
53 ZLIB_OPT="$ZLIB_OPT $PIPE"
54 fi
55
56 # warnings
57 CFLAGS="$CFLAGS -O -W"
58 CFLAGS="$CFLAGS -Wall -Wpointer-arith"
59 #CFLAGS="$CFLAGS -Wconversion"
60 #CFLAGS="$CFLAGS -Winline"
61
62 # we have a lot of the unused function arguments
63 CFLAGS="$CFLAGS -Wno-unused"
64
65 # stop on warning
66 CFLAGS="$CFLAGS -Werror"
67
68 # ANSI C warnings
69 #CFLAGS="$CFLAGS -pedantic"
70
71 # debug
72 CFLAGS="$CFLAGS -g"
73
74 # DragonFly's gcc3 generates DWARF
75 #CFLAGS="$CFLAGS -g -gstabs"
76
77 have=HAVE_GCC_VARIADIC_MACROS . auto/have
78
79 if [ ".$CPP" = "." ]; then
80 CPP="$CC -E"
81 fi
82
83 LINK="\$(CC)"
84
85 INCOPT="-I "
86 COMPOPT="-c"
87 OBJOUT="-o "
88 BINOUT="-o "
89 OBJEXT="o"
90
91 CC_STRONG="$CC -Wall -Werror"
92 ;;
93
94
95 *icc)
96 # Intel C++ compiler 7.1, 8.0
97
98 # optimizations
99 CFLAGS="$CFLAGS -O"
100 # inline functions declared with __inline
101 #CFLAGS="$CFLAGS -Ob1"
102 # inline any function, at the compiler's discretion
103 CFLAGS="$CFLAGS -Ob2"
104
105 # single-file IP optimizations
106 #IPO="-ip"
107 # multi-file IP optimizations
108 IPO="-ipo -ipo_obj"
109 CFLAGS="$CFLAGS $IPO"
110 CORE_LINK="$CORE_LINK $IPO"
111 CORE_LINK="$CORE_LINK -opt_report_file=$OBJS/opt_report_file"
112
113 case $CPU in
114 pentium)
115 # optimize for Pentium and Athlon
116 CPU_OPT="-march=pentium"
117 ;;
118
119 pentiumpro)
120 # optimize for Pentium Pro, Pentium II and Pentium III
121 CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
122 ;;
123
124 pentium4)
125 # optimize for Pentium 4, default
126 CPU_OPT="-march=pentium4"
127 ;;
128 esac
129
130 CFLAGS="$CFLAGS $CPU_OPT"
131
132 if [ ".$PCRE_OPT" = "." ]; then
133 PCRE_OPT="-O $IPO $CPU_OPT"
134 fi
135
136 if [ ".$MD5_OPT" = "." ]; then
137 MD5_OPT="-O $IPO $CPU_OPT"
138 fi
139
140 if [ ".$ZLIB_OPT" = "." ]; then
141 ZLIB_OPT="-O $IPO $CPU_OPT"
142 fi
143
144 # warnings
145 CFLAGS="$CFLAGS -w1"
146 #CFLAGS="$CFLAGS -w2"
147
148 # stop on warning
149 CFLAGS="$CFLAGS -Werror"
150
151 # debug
152 CFLAGS="$CFLAGS -g"
153
154 have=HAVE_C99_VARIADIC_MACROS . auto/have
155
156 LINK="\$(CC)"
157
158 INCOPT="-I "
159 COMPOPT="-c"
160 OBJOUT="-o "
161 BINOUT="-o "
162 OBJEXT="o"
163
164 CC_STRONG="$CC -w1 -Werror"
165 ;;
166
167
168 cl)
169 # MSVC 6.0 SP2
170
171 # optimizations
172
173 # maximize speed
174 CFLAGS="$CFLAGS -O2"
175 # enable global optimization
176 CFLAGS="$CFLAGS -Og"
177 # enable intrinsic functions
178 CFLAGS="$CFLAGS -Oi"
179 # inline expansion
180 CFLAGS="$CFLAGS -Ob1"
181 # enable frame pointer omission
182 CFLAGS="$CFLAGS -Oy"
183 # disable stack checking calls
184 CFLAGS="$CFLAGS -Gs"
185
186 case $CPU in
187 pentium)
188 # optimize for Pentium and Athlon
189 CPU_OPT="-G5"
190 ;;
191
192 pentiumpro)
193 # optimize for Pentium Pro, Pentium II and Pentium III
194 CPU_OPT="-G6"
195 ;;
196
197 pentium4)
198 # optimize for Pentium 4
199 #CPU_OPT="-G7"
200 ;;
201 esac
202
203 CFLAGS="$CFLAGS $CPU_OPT"
204
205 # warnings
206 #CFLAGS="$CFLAGS -W3"
207 CFLAGS="$CFLAGS -W4"
208
209 # stop on warning
210 CFLAGS="$CFLAGS -WX"
211
212 # link with libcmt.lib, multithreaded
213 #LIBC="-MT"
214 # link with msvcrt.dll
215 LIBC="-MD"
216
217 CFLAGS="$CFLAGS $LIBC"
218
219 # disable logo
220 CFLAGS="$CFLAGS -nologo"
221
222 LINK="\$(CC)"
223
224 # link flags
225 CORE_LINK="$CORE_LINK -link -verbose:lib"
226
227 # debug
228 CFLAGS="$CFLAGS -Yd"
229 CORE_LINK="$CORE_LINK -debug -debugtype:coff"
230
231 # precompiled headers
232 CORE_DEPS="$CORE_DEPS ngx_config.pch"
233 PCH="ngx_config.pch"
234 BUILDPCH="-Ycngx_config.h"
235 USEPCH="-Yungx_config.h"
236
237 INCOPT="-I "
238 COMPOPT="-c"
239 OBJOUT="-Fo"
240 BINOUT="-Fe"
241 OBJEXT="obj"
242 BINEXT=".exe"
243 #DIRSEP='\\'
244 ;;
245
246
247 wcl386)
248 # Open Watcom C 1.0, 1.2
249
250 # optimizations
251
252 # maximize speed
253 CFLAGS="$CFLAGS -ot"
254 # reorder instructions for best pipeline usage
255 CFLAGS="$CFLAGS -op"
256 # inline intrinsic functions
257 CFLAGS="$CFLAGS -oi"
258 # inline expansion
259 CFLAGS="$CFLAGS -oe"
260 # disable stack checking calls
261 CFLAGS="$CFLAGS -s"
262
263 case $CPU in
264 pentium)
265 # optimize for Pentium and Athlon
266 # register-based arguments passing conventions
267 CPU_OPT="-5r"
268 # stack-based arguments passing conventions
269 #CPU_OPT="-5s"
270 ;;
271
272 pentiumpro)
273 # optimize for Pentium Pro, Pentium II and Pentium III
274 # register-based arguments passing conventions
275 CPU_OPT="-6r"
276 # stack-based arguments passing conventions
277 #CPU_OPT="-6s"
278 ;;
279 esac
280
281 CFLAGS="$CFLAGS $CPU_OPT"
282
283 # warnings
284 #CFLAGS="$CFLAGS -w3"
285 CFLAGS="$CFLAGS -wx"
286
287 # stop on warning
288 CFLAGS="$CFLAGS -we"
289
290 # built target is NT
291 CFLAGS="$CFLAGS -bt=nt"
292
293 # multithreaded
294 CFLAGS="$CFLAGS -bm"
295
296 # debug
297 CFLAGS="$CFLAGS -d2"
298
299 # quiet
300 CFLAGS="$CFLAGS -zq"
301
302 # Open Watcom C 1.2
303 #have=HAVE_C99_VARIADIC_MACROS . auto/have
304
305 # precompiled headers
306 CORE_DEPS="$CORE_DEPS $OBJS\\ngx_config.pch"
307 PCH="$OBJS\\ngx_config.pch"
308 BUILDPCH="-fhq=$OBJS\\ngx_config.pch"
309 USEPCH="-fh=$OBJS\\ngx_config.pch"
310
311 LINK="\$(CC)"
312
313 # link flags
314 CORE_LINK="$CORE_LINK -l=nt"
315
316 INCOPT="-i="
317 COMPOPT="-c"
318 OBJOUT="-fo"
319 BINOUT="-fe="
320 OBJEXT="obj"
321 BINEXT=".exe"
322 DIRSEP='\\'
323
324 MAKE_SL=YES
325 ;;
326
327
328 bcc32)
329 # Borland C++ 5.5
330
331 # optimizations
332
333 # maximize speed
334 CFLAGS="$CFLAGS -O2"
335
336 case $CPU in
337 pentium)
338 # optimize for Pentium and Athlon
339 CPU_OPT="-5"
340 ;;
341
342 pentiumpro)
343 # optimize for Pentium Pro, Pentium II and Pentium III
344 CPU_OPT="-6"
345 ;;
346 esac
347
348 CFLAGS="$CFLAGS $CPU_OPT"
349
350 # multithreaded
351 CFLAGS="$CFLAGS -tWM"
352
353 # stop on warning
354 CFLAGS="$CFLAGS -w!"
355
356 # disable logo
357 CFLAGS="$CFLAGS -q"
358
359 # precompiled headers
360 CORE_DEPS="$CORE_DEPS $OBJS\\ngx_config.csm"
361 PCH="$OBJS\\ngx_config.csm"
362 BUILDPCH="-H=$OBJS\\ngx_config.csm"
363 USEPCH="-Hu -H=$OBJS\\ngx_config.csm"
364
365 LINK="\$(CC)"
366
367 INCOPT="-I"
368 COMPOPT="-c"
369 OBJOUT="-o"
370 BINOUT="-e"
371 OBJEXT="obj"
372 BINEXT=".exe"
373 DIRSEP='\\'
374 ;;
375
376 esac