summaryrefslogtreecommitdiffhomepage
path: root/auto/cc
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-02-13 06:47:34 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-02-13 06:47:34 +0300
commit4cfd9ba3c18932a47eca176a79da31455e444cc3 (patch)
tree62f3402c03581ee03d136d53aa31f8f9be0a0f43 /auto/cc
parent822fc91b093b85a94ca54fc8c7e2d85fc5a4daf8 (diff)
downloadnginx-4cfd9ba3c18932a47eca176a79da31455e444cc3.tar.gz
nginx-4cfd9ba3c18932a47eca176a79da31455e444cc3.tar.bz2
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.
Diffstat (limited to 'auto/cc')
-rw-r--r--auto/cc/msvc31
-rw-r--r--auto/cc/name27
2 files changed, 25 insertions, 33 deletions
diff --git a/auto/cc/msvc b/auto/cc/msvc
index e588c487f..4eef10105 100644
--- a/auto/cc/msvc
+++ b/auto/cc/msvc
@@ -3,9 +3,24 @@
# Copyright (C) Nginx, Inc.
-# MSVC 6.0 SP2
-# MSVC Toolkit 2003 (7.1)
-# MSVC 2005 Express Edition SP1 (8.0)
+# MSVC 6.0 SP2 cl 12.00
+# MSVC Toolkit 2003 (7.1) cl 13.10
+# MSVC 2005 Express Edition SP1 (8.0) cl 14.00
+# MSVC 2008 Express Edition (9.0) cl 15.00
+# MSVC 2010 (10.0) cl 16.00
+# MSVC 2015 (14.0) cl 19.00
+
+
+NGX_MSVC_VER=`$NGX_WINE $CC 2>&1 | grep 'Compiler Version' 2>&1 \
+ | sed -e 's/^.* Version \(.*\)/\1/'`
+
+echo " + cl version: $NGX_MSVC_VER"
+
+have=NGX_COMPILER value="\"cl $NGX_MSVC_VER\"" . auto/define
+
+
+ngx_msvc_ver=`echo $NGX_MSVC_VER | sed -e 's/^\([0-9]*\).*/\1/'`
+
# optimizations
@@ -90,17 +105,17 @@ CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
# debug
-# msvc8 under Wine issues
-# Program database manager mismatch; please check your installation
-if [ $NGX_CC_NAME != msvc8 ]; then
+# msvc under Wine issues
+# C1902: Program database manager mismatch; please check your installation
+if [ -z "$NGX_WINE" ]; then
CFLAGS="$CFLAGS -Zi"
CORE_LINK="$CORE_LINK -debug"
fi
# MSVC 2005 supports C99 variadic macros
-if [ $NGX_CC_NAME = msvc8 ]; then
- have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
+if [ "$ngx_msvc_ver" -ge 14 ]; then
+ have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
fi
diff --git a/auto/cc/name b/auto/cc/name
index 51a7ed92e..35d319e61 100644
--- a/auto/cc/name
+++ b/auto/cc/name
@@ -25,31 +25,8 @@ fi
if [ "$CC" = cl ]; then
- if `$NGX_WINE $CC -v 2>&1 \
- | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16' \
- >/dev/null 2>&1`; then
-
- NGX_CC_NAME=msvc10
- echo " + using Microsoft Visual C++ 10 compiler"
-
- elif `$NGX_WINE $CC -v 2>&1 \
- | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
- >/dev/null 2>&1`; then
-
- NGX_CC_NAME=msvc8
- echo " + using Microsoft Visual C++ 8 compiler"
-
- elif `$NGX_WINE $CC -v 2>&1 \
- | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
- >/dev/null 2>&1`; then
-
- NGX_CC_NAME=msvc7
- echo " + using Microsoft Visual C++ 7 compiler"
-
- else
- NGX_CC_NAME=msvc
- echo " + using Microsoft Visual C++ compiler"
- fi
+ NGX_CC_NAME=msvc
+ echo " + using Microsoft Visual C++ compiler"
elif [ "$CC" = wcl386 ]; then
NGX_CC_NAME=owc