msvc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # Copyright (C) Igor Sysoev
  2. # Copyright (C) Nginx, Inc.
  3. # MSVC 6.0 SP2 cl 12.00
  4. # MSVC Toolkit 2003 (7.1) cl 13.10
  5. # MSVC 2005 Express Edition SP1 (8.0) cl 14.00
  6. # MSVC 2008 Express Edition (9.0) cl 15.00
  7. # MSVC 2010 (10.0) cl 16.00
  8. # MSVC 2015 (14.0) cl 19.00
  9. NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'Compiler Version' 2>&1 \
  10. | sed -e 's/^.* Version \(.*\)/\1/'`
  11. echo " + cl version: $NGX_MSVC_VER"
  12. have=NGX_COMPILER value="\"cl $NGX_MSVC_VER\"" . auto/define
  13. ngx_msvc_ver=`echo $NGX_MSVC_VER | sed -e 's/^\([0-9]*\).*/\1/'`
  14. # optimizations
  15. # maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy
  16. CFLAGS="$CFLAGS -O2"
  17. # enable global optimization
  18. #CFLAGS="$CFLAGS -Og"
  19. # enable intrinsic functions
  20. #CFLAGS="$CFLAGS -Oi"
  21. # disable inline expansion
  22. #CFLAGS="$CFLAGS -Ob0"
  23. # explicit inline expansion
  24. #CFLAGS="$CFLAGS -Ob1"
  25. # explicit and implicit inline expansion
  26. #CFLAGS="$CFLAGS -Ob2"
  27. # enable frame pointer omission
  28. #CFLAGS="$CFLAGS -Oy"
  29. # disable stack checking calls
  30. #CFLAGS="$CFLAGS -Gs"
  31. # pools strings as read/write
  32. #CFLAGS="$CFLAGS -Gf"
  33. # pools strings as read-only
  34. #CFLAGS="$CFLAGS -GF"
  35. case $CPU in
  36. pentium)
  37. # optimize for Pentium and Athlon
  38. CPU_OPT="-G5"
  39. ;;
  40. pentiumpro)
  41. # optimize for Pentium Pro, Pentium II and Pentium III
  42. CPU_OPT="-G6"
  43. ;;
  44. pentium4)
  45. # optimize for Pentium 4, MSVC 7
  46. CPU_OPT="-G7"
  47. ;;
  48. esac
  49. # __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
  50. #CPU_OPT="$CPU_OPT -Gd"
  51. # __stdcall
  52. #CPU_OPT="$CPU_OPT -Gz"
  53. # __fastcall
  54. #CPU_OPT="$CPU_OPT -Gr"
  55. CFLAGS="$CFLAGS $CPU_OPT"
  56. # warnings
  57. CFLAGS="$CFLAGS -W4"
  58. # stop on warning
  59. CFLAGS="$CFLAGS -WX"
  60. # disable logo
  61. CFLAGS="$CFLAGS -nologo"
  62. # the link flags
  63. CORE_LINK="$CORE_LINK -link -verbose:lib"
  64. # link with libcmt.lib, multithreaded
  65. LIBC="-MT"
  66. # link with msvcrt.dll
  67. # however, MSVC Toolkit 2003 has no MSVCRT.LIB
  68. #LIBC="-MD"
  69. CFLAGS="$CFLAGS $LIBC"
  70. CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
  71. # Win32 GUI mode application
  72. #CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
  73. # debug
  74. # msvc under Wine issues
  75. # C1902: Program database manager mismatch; please check your installation
  76. if [ -z "$NGX_WINE" ]; then
  77. CFLAGS="$CFLAGS -Zi -Fd$NGX_OBJS/nginx.pdb"
  78. CORE_LINK="$CORE_LINK -debug"
  79. fi
  80. # MSVC 2005 supports C99 variadic macros
  81. if [ "$ngx_msvc_ver" -ge 14 ]; then
  82. have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
  83. fi
  84. # precompiled headers
  85. CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
  86. CORE_LINK="$CORE_LINK $NGX_OBJS/ngx_pch.obj"
  87. NGX_PCH="$NGX_OBJS/ngx_config.pch"
  88. NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
  89. NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
  90. # the resource file
  91. NGX_RES="$NGX_OBJS/nginx.res"
  92. NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
  93. CORE_LINK="$NGX_RES $CORE_LINK"
  94. # dynamic modules
  95. #MAIN_LINK="-link -def:$NGX_OBJS/nginx.def"
  96. #MODULE_LINK="-LD $NGX_OBJS/nginx.lib"
  97. ngx_pic_opt=
  98. ngx_objout="-Fo"
  99. ngx_binout="-Fe"
  100. ngx_objext="obj"
  101. ngx_long_start='@<<
  102. '
  103. ngx_long_end='<<'
  104. ngx_long_regex_cont=' \
  105. '
  106. ngx_long_cont='
  107. '
  108. # MSVC understand / in path
  109. #ngx_regex_dirsep='\\'
  110. #ngx_dirsep="\\"