blob: 1d83ed37a03e505e8e633ee3792d83a6d8f75280 [file] [log] [blame]
Igor Sysoevc0edbcc2004-10-21 15:34:38 +00001
2# Copyright (C) Igor Sysoev
Maxim Konovalovf8d59e32012-01-18 15:07:43 +00003# Copyright (C) Nginx, Inc.
Igor Sysoevc0edbcc2004-10-21 15:34:38 +00004
5
Maxim Konovalovf08ba922011-12-29 15:36:07 +00006# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
Igor Sysoevc0edbcc2004-10-21 15:34:38 +00007
Igor Sysoev7b190b42005-06-07 15:56:31 +00008NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
Igor Sysoevdb390ac2007-04-19 17:48:49 +00009 | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
Igor Sysoev7b190b42005-06-07 15:56:31 +000010
11echo " + icc version: $NGX_ICC_VER"
12
Igor Sysoev208eed22005-10-07 13:30:52 +000013have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
14
Igor Sysoev7b190b42005-06-07 15:56:31 +000015
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000016# optimizations
17
18CFLAGS="$CFLAGS -O"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000019
Igor Sysoevf6906042004-11-25 16:17:31 +000020CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000021
Igor Sysoev09c684b2005-11-09 17:25:55 +000022
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000023case $CPU in
24 pentium)
25 # optimize for Pentium and Athlon
26 CPU_OPT="-march=pentium"
27 ;;
28
29 pentiumpro)
30 # optimize for Pentium Pro, Pentium II and Pentium III
31 CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
32 ;;
33
34 pentium4)
35 # optimize for Pentium 4, default
36 CPU_OPT="-march=pentium4"
37 ;;
38esac
39
40CFLAGS="$CFLAGS $CPU_OPT"
41
42if [ ".$PCRE_OPT" = "." ]; then
Maxim Konovalovf08ba922011-12-29 15:36:07 +000043 PCRE_OPT="-O $CPU_OPT"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000044fi
45
46if [ ".$MD5_OPT" = "." ]; then
Maxim Konovalovf08ba922011-12-29 15:36:07 +000047 MD5_OPT="-O $CPU_OPT"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000048fi
49
50if [ ".$ZLIB_OPT" = "." ]; then
Maxim Konovalovf08ba922011-12-29 15:36:07 +000051 ZLIB_OPT="-O $CPU_OPT"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000052fi
53
54
55# warnings
56
Igor Sysoevc1571722005-03-19 12:38:37 +000057CFLAGS="$CFLAGS -w2"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000058
Igor Sysoevc1571722005-03-19 12:38:37 +000059# disable some warnings
60
61# invalid type conversion: "int" to "char *"
62CFLAGS="$CFLAGS -wd171"
63# argument is incompatible with corresponding format string conversion
64CFLAGS="$CFLAGS -wd181"
65# zero used for undefined preprocessing identifier
66CFLAGS="$CFLAGS -wd193"
Igor Sysoevc2068d02005-10-19 12:33:58 +000067# the format string ends before this argument
Igor Sysoev403d2442005-05-26 18:12:40 +000068CFLAGS="$CFLAGS -wd268"
Igor Sysoevc1571722005-03-19 12:38:37 +000069# invalid format string conversion
70CFLAGS="$CFLAGS -wd269"
71# conversion from "long long" to "size_t" may lose significant bits
72CFLAGS="$CFLAGS -wd810"
73# parameter was never referenced
74CFLAGS="$CFLAGS -wd869"
Igor Sysoevda173ab2006-08-30 10:39:17 +000075# attribute "unused" is only allowed in a function definition, warning on pTHX_
76CFLAGS="$CFLAGS -wd1301"
Igor Sysoevc1571722005-03-19 12:38:37 +000077
78# STUB
79# enumerated type mixed with another type
80CFLAGS="$CFLAGS -wd188"
81# controlling expression is constant
82CFLAGS="$CFLAGS -wd279"
83# operands are evaluated in unspecified order
84CFLAGS="$CFLAGS -wd981"
85# external definition with no prior declaration
86CFLAGS="$CFLAGS -wd1418"
87# external declaration in primary source file
88CFLAGS="$CFLAGS -wd1419"
Igor Sysoev7b190b42005-06-07 15:56:31 +000089
90case "$NGX_ICC_VER" in
Igor Sysoev09c684b2005-11-09 17:25:55 +000091 9.*)
Igor Sysoev0e5dc5c2005-11-15 13:30:52 +000092 # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
Igor Sysoev7b190b42005-06-07 15:56:31 +000093 CFLAGS="$CFLAGS -wd1469"
Igor Sysoevc2068d02005-10-19 12:33:58 +000094 # explicit conversion of a 64-bit integral type to a smaller
95 # integral type
96 CFLAGS="$CFLAGS -wd1683"
97 # conversion from pointer to same-sized integral type,
98 # warning on offsetof()
99 CFLAGS="$CFLAGS -wd1684"
Igor Sysoev3ca233e2005-12-28 14:23:52 +0000100 # floating-point equality and inequality comparisons are unreliable,
101 # warning on SvTRUE()
102 CFLAGS="$CFLAGS -wd1572"
Igor Sysoev7b190b42005-06-07 15:56:31 +0000103 ;;
104
Igor Sysoev09c684b2005-11-09 17:25:55 +0000105 8.*)
Igor Sysoev0e5dc5c2005-11-15 13:30:52 +0000106 # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
Igor Sysoev09c684b2005-11-09 17:25:55 +0000107 CFLAGS="$CFLAGS -wd1469"
Igor Sysoev3ca233e2005-12-28 14:23:52 +0000108 # floating-point equality and inequality comparisons are unreliable,
109 # warning on SvTRUE()
110 CFLAGS="$CFLAGS -wd1572"
Igor Sysoev09c684b2005-11-09 17:25:55 +0000111 ;;
112
Igor Sysoev7b190b42005-06-07 15:56:31 +0000113 *)
114 ;;
115esac
Igor Sysoev02025fd2005-01-18 13:03:58 +0000116
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000117# stop on warning
118CFLAGS="$CFLAGS -Werror"
119
120# debug
121CFLAGS="$CFLAGS -g"