Mercurial > hg > nginx
comparison auto/cc/msvc @ 6397:78f8ac479735
Win32: simplified and improved handling of MSVC versions.
Now we always set NGX_CC_NAME to "msvc", and additionally test compiler
version as reported by "cl" in auto/cc/msvc (the same version is also
available via the _MSC_VER define). In particular, this approach allows
to properly check for C99 variadic macros support, which previously was
not used with MSVC versions not explicitly recognized.
Now unneeded wildcards in NGX_CC_NAME tests for msvc removed accordingly,
as well as unused wildcards for owc and icc.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 13 Feb 2016 06:47:34 +0300 |
parents | 85dea406e18f |
children | b7b7f3a0cc28 |
comparison
equal
deleted
inserted
replaced
6396:dcfe355dfda4 | 6397:78f8ac479735 |
---|---|
1 | 1 |
2 # Copyright (C) Igor Sysoev | 2 # Copyright (C) Igor Sysoev |
3 # Copyright (C) Nginx, Inc. | 3 # Copyright (C) Nginx, Inc. |
4 | 4 |
5 | 5 |
6 # MSVC 6.0 SP2 | 6 # MSVC 6.0 SP2 cl 12.00 |
7 # MSVC Toolkit 2003 (7.1) | 7 # MSVC Toolkit 2003 (7.1) cl 13.10 |
8 # MSVC 2005 Express Edition SP1 (8.0) | 8 # MSVC 2005 Express Edition SP1 (8.0) cl 14.00 |
9 # MSVC 2008 Express Edition (9.0) cl 15.00 | |
10 # MSVC 2010 (10.0) cl 16.00 | |
11 # MSVC 2015 (14.0) cl 19.00 | |
12 | |
13 | |
14 NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'Compiler Version' 2>&1 \ | |
15 | sed -e 's/^.* Version \(.*\)/\1/'` | |
16 | |
17 echo " + cl version: $NGX_MSVC_VER" | |
18 | |
19 have=NGX_COMPILER value="\"cl $NGX_MSVC_VER\"" . auto/define | |
20 | |
21 | |
22 ngx_msvc_ver=`echo $NGX_MSVC_VER | sed -e 's/^\([0-9]*\).*/\1/'` | |
23 | |
9 | 24 |
10 # optimizations | 25 # optimizations |
11 | 26 |
12 # maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy | 27 # maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy |
13 CFLAGS="$CFLAGS -O2" | 28 CFLAGS="$CFLAGS -O2" |
88 | 103 |
89 # Win32 GUI mode application | 104 # Win32 GUI mode application |
90 #CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup" | 105 #CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup" |
91 | 106 |
92 # debug | 107 # debug |
93 # msvc8 under Wine issues | 108 # msvc under Wine issues |
94 # Program database manager mismatch; please check your installation | 109 # C1902: Program database manager mismatch; please check your installation |
95 if [ $NGX_CC_NAME != msvc8 ]; then | 110 if [ -z "$NGX_WINE" ]; then |
96 CFLAGS="$CFLAGS -Zi" | 111 CFLAGS="$CFLAGS -Zi" |
97 CORE_LINK="$CORE_LINK -debug" | 112 CORE_LINK="$CORE_LINK -debug" |
98 fi | 113 fi |
99 | 114 |
100 | 115 |
101 # MSVC 2005 supports C99 variadic macros | 116 # MSVC 2005 supports C99 variadic macros |
102 if [ $NGX_CC_NAME = msvc8 ]; then | 117 if [ "$ngx_msvc_ver" -ge 14 ]; then |
103 have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have | 118 have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have |
104 fi | 119 fi |
105 | 120 |
106 | 121 |
107 # precompiled headers | 122 # precompiled headers |
108 CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch" | 123 CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch" |