blob: 91dd95ecfd1a94b88428c298bce057e63e67b914 [file] [log] [blame]
Igor Sysoevc0edbcc2004-10-21 15:34:38 +00001
2# Copyright (C) Igor Sysoev
3
4
Igor Sysoev24025022005-12-16 15:07:08 +00005# Intel C++ compiler 7.1, 8.0, 8.1, 9.0
Igor Sysoevc0edbcc2004-10-21 15:34:38 +00006
Igor Sysoev7b190b42005-06-07 15:56:31 +00007NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
Igor Sysoevdb390ac2007-04-19 17:48:49 +00008 | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
Igor Sysoev7b190b42005-06-07 15:56:31 +00009
10echo " + icc version: $NGX_ICC_VER"
11
Igor Sysoev208eed22005-10-07 13:30:52 +000012have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
13
Igor Sysoev7b190b42005-06-07 15:56:31 +000014
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000015# optimizations
16
17CFLAGS="$CFLAGS -O"
Igor Sysoevc1571722005-03-19 12:38:37 +000018# inline the functions declared with __inline
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000019#CFLAGS="$CFLAGS -Ob1"
20# inline any function, at the compiler's discretion
21CFLAGS="$CFLAGS -Ob2"
22
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000023# multi-file IP optimizations
Igor Sysoevc2068d02005-10-19 12:33:58 +000024case "$NGX_ICC_VER" in
25 9.*)
26 IPO="-ipo"
27 ;;
28
Igor Sysoevad490862007-04-19 17:49:24 +000029 # 8.1.38 under FreeBSD can not link -ipo
30 8.1)
31 IPO="-ip"
32 ;;
33
Igor Sysoevc2068d02005-10-19 12:33:58 +000034 *)
35 IPO="-ipo -ipo_obj"
36 ;;
37esac
38
Igor Sysoevae33d012006-01-17 20:04:32 +000039# single-file IP optimizations
40#IPO="-ip"
41
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000042CFLAGS="$CFLAGS $IPO"
43CORE_LINK="$CORE_LINK $IPO"
Igor Sysoevf6906042004-11-25 16:17:31 +000044CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000045
Igor Sysoev09c684b2005-11-09 17:25:55 +000046
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000047case $CPU in
48 pentium)
49 # optimize for Pentium and Athlon
50 CPU_OPT="-march=pentium"
51 ;;
52
53 pentiumpro)
54 # optimize for Pentium Pro, Pentium II and Pentium III
55 CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
56 ;;
57
58 pentium4)
59 # optimize for Pentium 4, default
60 CPU_OPT="-march=pentium4"
61 ;;
62esac
63
64CFLAGS="$CFLAGS $CPU_OPT"
65
66if [ ".$PCRE_OPT" = "." ]; then
67 PCRE_OPT="-O $IPO $CPU_OPT"
68fi
69
70if [ ".$MD5_OPT" = "." ]; then
71 MD5_OPT="-O $IPO $CPU_OPT"
72fi
73
74if [ ".$ZLIB_OPT" = "." ]; then
75 ZLIB_OPT="-O $IPO $CPU_OPT"
76fi
77
78
79# warnings
80
Igor Sysoevc1571722005-03-19 12:38:37 +000081CFLAGS="$CFLAGS -w2"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000082
Igor Sysoevc1571722005-03-19 12:38:37 +000083# disable some warnings
84
85# invalid type conversion: "int" to "char *"
86CFLAGS="$CFLAGS -wd171"
87# argument is incompatible with corresponding format string conversion
88CFLAGS="$CFLAGS -wd181"
89# zero used for undefined preprocessing identifier
90CFLAGS="$CFLAGS -wd193"
Igor Sysoevc2068d02005-10-19 12:33:58 +000091# the format string ends before this argument
Igor Sysoev403d2442005-05-26 18:12:40 +000092CFLAGS="$CFLAGS -wd268"
Igor Sysoevc1571722005-03-19 12:38:37 +000093# invalid format string conversion
94CFLAGS="$CFLAGS -wd269"
95# conversion from "long long" to "size_t" may lose significant bits
96CFLAGS="$CFLAGS -wd810"
97# parameter was never referenced
98CFLAGS="$CFLAGS -wd869"
Igor Sysoevda173ab2006-08-30 10:39:17 +000099# attribute "unused" is only allowed in a function definition, warning on pTHX_
100CFLAGS="$CFLAGS -wd1301"
Igor Sysoevc1571722005-03-19 12:38:37 +0000101
102# STUB
103# enumerated type mixed with another type
104CFLAGS="$CFLAGS -wd188"
105# controlling expression is constant
106CFLAGS="$CFLAGS -wd279"
107# operands are evaluated in unspecified order
108CFLAGS="$CFLAGS -wd981"
109# external definition with no prior declaration
110CFLAGS="$CFLAGS -wd1418"
111# external declaration in primary source file
112CFLAGS="$CFLAGS -wd1419"
Igor Sysoev7b190b42005-06-07 15:56:31 +0000113
114case "$NGX_ICC_VER" in
Igor Sysoev09c684b2005-11-09 17:25:55 +0000115 9.*)
Igor Sysoev0e5dc5c2005-11-15 13:30:52 +0000116 # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
Igor Sysoev7b190b42005-06-07 15:56:31 +0000117 CFLAGS="$CFLAGS -wd1469"
Igor Sysoevc2068d02005-10-19 12:33:58 +0000118 # explicit conversion of a 64-bit integral type to a smaller
119 # integral type
120 CFLAGS="$CFLAGS -wd1683"
121 # conversion from pointer to same-sized integral type,
122 # warning on offsetof()
123 CFLAGS="$CFLAGS -wd1684"
Igor Sysoev3ca233e2005-12-28 14:23:52 +0000124 # floating-point equality and inequality comparisons are unreliable,
125 # warning on SvTRUE()
126 CFLAGS="$CFLAGS -wd1572"
Igor Sysoev7b190b42005-06-07 15:56:31 +0000127 ;;
128
Igor Sysoev09c684b2005-11-09 17:25:55 +0000129 8.*)
Igor Sysoev0e5dc5c2005-11-15 13:30:52 +0000130 # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
Igor Sysoev09c684b2005-11-09 17:25:55 +0000131 CFLAGS="$CFLAGS -wd1469"
Igor Sysoev3ca233e2005-12-28 14:23:52 +0000132 # floating-point equality and inequality comparisons are unreliable,
133 # warning on SvTRUE()
134 CFLAGS="$CFLAGS -wd1572"
Igor Sysoev09c684b2005-11-09 17:25:55 +0000135 ;;
136
Igor Sysoev7b190b42005-06-07 15:56:31 +0000137 *)
138 ;;
139esac
Igor Sysoev02025fd2005-01-18 13:03:58 +0000140
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000141# stop on warning
142CFLAGS="$CFLAGS -Werror"
143
144# debug
145CFLAGS="$CFLAGS -g"