icc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. # Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
  4. NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
  5. | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
  6. echo " + icc version: $NGX_ICC_VER"
  7. have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
  8. # optimizations
  9. CFLAGS="$CFLAGS -O"
  10. CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
  11. case $CPU in
  12. pentium)
  13. # optimize for Pentium and Athlon
  14. CPU_OPT="-march=pentium"
  15. ;;
  16. pentiumpro)
  17. # optimize for Pentium Pro, Pentium II and Pentium III
  18. CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
  19. ;;
  20. pentium4)
  21. # optimize for Pentium 4, default
  22. CPU_OPT="-march=pentium4"
  23. ;;
  24. esac
  25. CFLAGS="$CFLAGS $CPU_OPT"
  26. if [ ".$PCRE_OPT" = "." ]; then
  27. PCRE_OPT="-O $CPU_OPT"
  28. fi
  29. if [ ".$ZLIB_OPT" = "." ]; then
  30. ZLIB_OPT="-O $CPU_OPT"
  31. fi
  32. # warnings
  33. CFLAGS="$CFLAGS -w2"
  34. # disable some warnings
  35. # invalid type conversion: "int" to "char *"
  36. CFLAGS="$CFLAGS -wd171"
  37. # argument is incompatible with corresponding format string conversion
  38. CFLAGS="$CFLAGS -wd181"
  39. # zero used for undefined preprocessing identifier
  40. CFLAGS="$CFLAGS -wd193"
  41. # the format string ends before this argument
  42. CFLAGS="$CFLAGS -wd268"
  43. # invalid format string conversion
  44. CFLAGS="$CFLAGS -wd269"
  45. # conversion from "long long" to "size_t" may lose significant bits
  46. CFLAGS="$CFLAGS -wd810"
  47. # parameter was never referenced
  48. CFLAGS="$CFLAGS -wd869"
  49. # attribute "unused" is only allowed in a function definition, warning on pTHX_
  50. CFLAGS="$CFLAGS -wd1301"
  51. # STUB
  52. # enumerated type mixed with another type
  53. CFLAGS="$CFLAGS -wd188"
  54. # controlling expression is constant
  55. CFLAGS="$CFLAGS -wd279"
  56. # operands are evaluated in unspecified order
  57. CFLAGS="$CFLAGS -wd981"
  58. # external definition with no prior declaration
  59. CFLAGS="$CFLAGS -wd1418"
  60. # external declaration in primary source file
  61. CFLAGS="$CFLAGS -wd1419"
  62. case "$NGX_ICC_VER" in
  63. 9.*)
  64. # "cc" clobber ignored, warnings for Linux's htonl()/htons()
  65. CFLAGS="$CFLAGS -wd1469"
  66. # explicit conversion of a 64-bit integral type to a smaller
  67. # integral type
  68. CFLAGS="$CFLAGS -wd1683"
  69. # conversion from pointer to same-sized integral type,
  70. # warning on offsetof()
  71. CFLAGS="$CFLAGS -wd1684"
  72. # floating-point equality and inequality comparisons are unreliable,
  73. # warning on SvTRUE()
  74. CFLAGS="$CFLAGS -wd1572"
  75. ;;
  76. 8.*)
  77. # "cc" clobber ignored, warnings for Linux's htonl()/htons()
  78. CFLAGS="$CFLAGS -wd1469"
  79. # floating-point equality and inequality comparisons are unreliable,
  80. # warning on SvTRUE()
  81. CFLAGS="$CFLAGS -wd1572"
  82. ;;
  83. *)
  84. ;;
  85. esac
  86. # stop on warning
  87. CFLAGS="$CFLAGS -Werror"
  88. # debug
  89. CFLAGS="$CFLAGS -g"