lemon: add free() to avoid mem leak (CID 1309088)
[metze/wireshark/wip.git] / config.nmake
index 6ea447544eb1a0827e0edef26a2370b209924958..67457e75945c00382b9e0e2843cf4654e50dca19 100644 (file)
@@ -2,10 +2,10 @@
 # the file README.windows and the Developer's Guide (available online).
 
 ##### Program name #####
-# Changing the name is experimental and may break the installer/unistaller and possibly other stuff.
-# Application data will still be under the same dir as Wireshark so perference files profiles etc
+# Changing the name is experimental and may break the installer/uninstaller and possibly other stuff.
+# Application data will still be under the same dir as Wireshark so preference files, profiles, and etc
 # will be shared with a "normal" Wireshark installation.
-# Note that suport libararies needs to be in PROGRAM_NAME-libs...
+# Note that support libraries need to be in PROGRAM_NAME-libs...
 
 !IFNDEF PROGRAM_NAME
 PROGRAM_NAME=Wireshark
@@ -14,9 +14,9 @@ PROGRAM_NAME=Wireshark
 ##### Target platform #####
 
 # Pick up the value from the environment, VS2012 onwards sets PLATFORM via
-#  vcvarsall.bat (it appears for X64 only).
+# vcvarsall.bat (it appears for X64 only).
 # For VS2010 and earlier you'll have to set the value yourself
-!IF "$(PLATFORM)" == "X64"
+!IF "$(PLATFORM)" == "x64" || "$(PLATFORM)" == "X64"
 WIRESHARK_TARGET_PLATFORM=win64
 !ENDIF
 
@@ -28,15 +28,15 @@ WIRESHARK_TARGET_PLATFORM=win32
 
 ##### Versions #####
 
-# The Git description of our build. Updated by make-version.pl
-GIT_REVISION=0
+# The VCS's description of our build. Updated by make-version.pl
+VCS_REVISION=0
 
 # The current Wireshark version. Recommended: Leave unchanged.
 # Updated by make-version.pl
-VERSION_MAJOR=1
-VERSION_MINOR=99
+VERSION_MAJOR=2
+VERSION_MINOR=1
 VERSION_MICRO=0
-VERSION_BUILD=$(GIT_REVISION)
+VERSION_BUILD=$(VCS_REVISION)
 
 # Local build information. Recommended: Unique string for your
 # environment, e.g. "-JackStackBarbecue". Updated by make-version.pl
@@ -44,16 +44,18 @@ VERSION_BUILD=$(GIT_REVISION)
 
 VERSION_EXTRA=$(WIRESHARK_VERSION_EXTRA)
 
+# Banner shown at top right of Qt welcome screen.
+!IFDEF WIRESHARK_VERSION_FLAVOR
+VERSION_FLAVOR=$(WIRESHARK_VERSION_FLAVOR)
+!ELSE
+VERSION_FLAVOR=Development Build
+!ENDIF
+
 # The version of the wiretap library. Recommended: Leave unchanged.
 WTAP_VERSION_MAJOR=$(VERSION_MAJOR)
 WTAP_VERSION_MINOR=$(VERSION_MINOR)
 WTAP_VERSION_MICRO=0
 
-# The version of the filetap library. Recommended: Leave unchanged.
-FTAP_VERSION_MAJOR=$(VERSION_MAJOR)
-FTAP_VERSION_MINOR=$(VERSION_MINOR)
-FTAP_VERSION_MICRO=0
-
 ##### Directories #####
 
 #
@@ -77,8 +79,7 @@ PROGRAM_FILES=$(PROGRAMFILES)
 PROGRAM_FILES_W6432=$(PROGRAMW6432)
 
 #
-# Location of the "tools" directory. This affects HTML2TXT below and should
-# be overridden by makefiles in any subdirectories that use HTML2TXT.
+# Location of the "tools" directory. This affects the path to textify.ps1
 !IFNDEF TOOLS_DIR
 TOOLS_DIR=tools
 !ENDIF
@@ -114,6 +115,8 @@ MSVC_VARIANT=MSVC2010
 MSVC_VARIANT=MSVC2012
 !ELSE IF "$(VISUALSTUDIOVERSION)" == "12.0"
 MSVC_VARIANT=MSVC2013
+!ELSE IF "$(VISUALSTUDIOVERSION)" == "14.0"
+MSVC_VARIANT=MSVC2015
 !ENDIF
 
 # For the different Studios, see: http://en.wikipedia.org/wiki/Microsoft_Visual_Studio
@@ -146,7 +149,7 @@ MSVC_VARIANT=MSVC2013
 ##         when vcvarsall.bat is called to set up the build environment.
 ##        [*]One possibility: download the Windows 7 Platform SDK and copy
 ##         win32.mak from ...\Microsoft SDKs\Windows\v7.[something]\include
-##         See: http://ask.wireshark.org/questions/14343/setting-development-project-under-visual-studio-2012
+##         See: https://ask.wireshark.org/questions/14343/setting-development-project-under-visual-studio-2012
 ##    2. Dec 28,2012: "VS2012 Update 1" is required to use VS 2012 to build an .exe which
 ##        will run on Windows XP (as well as on later versions of Windows).
 ##        ToDo: It appears that some special setup is required to to do this.
@@ -173,7 +176,7 @@ MSVC_VARIANT=MSVC2013
 ##         when vcvarsall.bat is called to set up the build environment.
 ##        [*]One possibility: download the Windows 7 Platform SDK and copy
 ##         win32.mak from ...\Microsoft SDKs\Windows\v7.[something]\include
-##         See: http://ask.wireshark.org/questions/14343/setting-development-project-under-visual-studio-2012
+##         See: https://ask.wireshark.org/questions/14343/setting-development-project-under-visual-studio-2012
 #MSVC_VARIANT=MSVC2013EE
 
 # The default if we haven't set a system environment variable or
@@ -195,7 +198,7 @@ MSVC_VARIANT=MSVC2010EE
 NASM=$(WIRESHARK_LIB_DIR)\nasm-2.09.08\nasm.exe
 
 #
-# Optional: the Python interpreter is used as part of the buildsystem
+# The Python interpreter is used as part of the buildsystem
 #
 # This will override the automatic detection below.
 #PYTHON_VER=27
@@ -214,7 +217,10 @@ NASM=$(WIRESHARK_LIB_DIR)\nasm-2.09.08\nasm.exe
 
 # Find native Python automatically if PYTHON(_DIR) wasn't defined
 !IF !DEFINED(PYTHON) && !DEFINED(PYTHON_DIR)
-!IF EXIST(c:\Python27\python.exe)
+!IF EXIST(c:\tools\python2\python.exe)
+# Chocolatey default
+PYTHON_DIR=C:\tools\python2
+!ELSE IF EXIST(c:\Python27\python.exe)
 PYTHON_VER=27
 !ELSE IF EXIST(c:\Python26\python.exe)
 PYTHON_VER=26
@@ -234,6 +240,11 @@ PYTHON="$(PYTHON_DIR)\python.exe"
 PATH=$(PYTHON_DIR);$(PATH)
 !ENDIF
 
+# If all else fails, try to find it on the PATH
+!IF !DEFINED(PYTHON)
+PYTHON=python
+!ENDIF
+
 #### Save files as pcap-ng by default. Comment out to use pcap instead. ####
 PCAP_NG_DEFAULT=^#define PCAP_NG_DEFAULT 1
 
@@ -242,7 +253,7 @@ PCAP_NG_DEFAULT=^#define PCAP_NG_DEFAULT 1
 WANT_PACKET_EDITOR=^#define WANT_PACKET_EDITOR 1
 
 !if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
-DOWNLOAD_TAG=2014-07-27
+DOWNLOAD_TAG=2015-10-07
 ##### Win32 Libraries #####
 #
 # Mandatory: GLib settings
@@ -355,7 +366,8 @@ QT5_BASE_DIR=$(WIRESHARK_LIB_DIR)\Qt5.1.1\5.1.1\msvc2010
 # PCAP_DIR isn't defined.
 #
 PCAP_DIR=$(WIRESHARK_LIB_DIR)\WPdpack
-# This macro is used by the nsis installer script, by the u3/portable apps and by the setup target.
+# This macro is used by the NSIS installer script, PortableApps, and by the
+# setup target.
 WINPCAP_VERSION=4_1_3
 WPD_VERSION=4_1_2
 
@@ -374,8 +386,7 @@ PCAP_REMOTE=1
 #
 # If you don't have Zlib, comment this line out, so that ZLIB_DIR isn't
 # defined.
-# EXperimental only use zlib 1.2.5 on win32 for now
-ZLIB_DIR=$(WIRESHARK_LIB_DIR)\zlib125
+ZLIB_DIR=$(WIRESHARK_LIB_DIR)\zlib-1.2.8-ws
 
 #
 # Optional: the ADNS library enables asynchronous (nonblocking) DNS
@@ -416,7 +427,7 @@ C_ARES_PKG=1.9.1-1
 # isn't defined.
 #
 # Platform SDK conflicts with openssl.h header
-GNUTLS_PKG=3.1.22-2.3
+GNUTLS_PKG=3.2.15-2.7
 GPGERROR_DLL=libgpg-error-0.dll
 GCC_DLL=libgcc_s_sjlj-1.dll
 
@@ -430,6 +441,9 @@ GCC_DLL=libgcc_s_sjlj-1.dll
 # isn't defined.
 #
 KFW_DIR=$(WIRESHARK_LIB_DIR)\kfw-3-2-2-i386-ws-vc6
+COMERR_DLL=comerr32.dll
+KRB5_DLL=krb5_32.dll
+K5SPRT_DLL=k5sprt32.dll
 
 # Optional: the LUA library enables scripting support.
 #
@@ -439,7 +453,9 @@ KFW_DIR=$(WIRESHARK_LIB_DIR)\kfw-3-2-2-i386-ws-vc6
 # If you don't have LUA, comment this line out, so that LUA_DIR
 # isn't defined.
 #
-!IF "$(MSVC_VARIANT)" == "MSVC2013" ||  "$(MSVC_VARIANT)" == "MSVC2013EE"
+!IF "$(MSVC_VARIANT)" == "MSVC2015" ||  "$(MSVC_VARIANT)" == "MSVC2015CE"
+LUA_DIST=-5.2.3_Win32_dll14
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2013" ||  "$(MSVC_VARIANT)" == "MSVC2013EE"
 LUA_DIST=-5.2.3_Win32_dll12
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2012" ||  "$(MSVC_VARIANT)" == "MSVC2012EE"
 LUA_DIST=-5.2.3_Win32_dll11
@@ -489,8 +505,7 @@ SMI_PKG=svn-40773
 # Optional: GeoIP, IP address database lookups
 #
 # Used to map IP addresses to MaxMind GeoIP database entries
-#
-GEOIP_PKG=1.5.1-2
+GEOIP_PKG=1.6.6
 
 #
 # Optional: WinSparkle, software updates
@@ -500,7 +515,7 @@ GEOIP_PKG=1.5.1-2
 WINSPARKLE_PKG=0.3-44-g2c8d9d3-win32ws
 
 !else
-DOWNLOAD_TAG=2014-07-27
+DOWNLOAD_TAG=2015-10-07
 ##### Win64 Libraries #####
 #
 # Mandatory: GLib settings
@@ -533,8 +548,8 @@ JASPER_DLL=libjasper-1.dll
 JPEG_DLL=libjpeg-8.dll
 LZMA_DLL=liblzma-5.dll
 PIXMAN_DLL=libpixman-1-0.dll
-PNG_DLL=libpng15-15.dll
-SEH_DLL=libgcc_s_seh-1.dll
+PNG_DLL=libpng16-16.dll
+#SEH_DLL=libgcc_s_seh-1.dll
 TIFF_DLL=libtiff-5.dll
 XML_DLL=libxml2-2.dll
 
@@ -542,8 +557,8 @@ XML_DLL=libxml2-2.dll
 !IF "$(GTK_NAME)" == "gtk2"
 GDK_DLL=libgdk-win32-2.0-0.dll
 GTK_DLL=libgtk-win32-2.0-0.dll
-#GTK_PKG=2.24.10-2.7
-GTK_PKG=2.24.23-1.1
+GTK_PKG=2.24.23-3.39
+#GTK_PKG=2.24.23-1.1
 PKG_SUFIX=ws
 !ELSE
 GDK_DLL=libgdk-3-0.dll
@@ -603,7 +618,8 @@ QT5_BASE_DIR=$(WIRESHARK_LIB_DIR)\Qt5.1.1\5.1.1\msvc2010
 # PCAP_DIR isn't defined.
 #
 PCAP_DIR=$(WIRESHARK_LIB_DIR)\WPdpack
-# This macro is used by the nsis installer script, by the u3/portable apps and by the setup target.
+# This macro is used by the NSIS installer script, PortableApps, and by the
+# setup target.
 WINPCAP_VERSION=4_1_3
 WPD_VERSION=4_1_2
 
@@ -623,7 +639,7 @@ PCAP_REMOTE=1
 # If you don't have Zlib, comment this line out, so that ZLIB_DIR isn't
 # defined.
 #
-ZLIB_DIR=$(WIRESHARK_LIB_DIR)\zlib125
+ZLIB_DIR=$(WIRESHARK_LIB_DIR)\zlib-1.2.8-ws
 
 #
 # Optional: the ADNS library enables asynchronous (nonblocking) DNS
@@ -664,7 +680,7 @@ C_ARES_PKG=1.9.1-1
 # isn't defined.
 #
 # Platform SDK conflicts with openssl.h header
-GNUTLS_PKG=3.1.22-2.3
+GNUTLS_PKG=3.2.15-2.9
 GPGERROR_DLL=libgpg-error6-0.dll
 GCC_DLL=libgcc_s_seh-1.dll
 
@@ -677,7 +693,10 @@ GCC_DLL=libgcc_s_seh-1.dll
 # If you don't have KFW, comment this line out, so that KFW_DIR
 # isn't defined.
 #
-#KFW_DIR=$(WIRESHARK_LIB_DIR)\kfw-3.2.2-ws1
+KFW_DIR=$(WIRESHARK_LIB_DIR)\kfw-3-2-2-x64-ws
+COMERR_DLL=comerr64.dll
+KRB5_DLL=krb5_64.dll
+K5SPRT_DLL=k5sprt64.dll
 
 #
 # Optional: the LUA library enables scripting support.
@@ -688,7 +707,9 @@ GCC_DLL=libgcc_s_seh-1.dll
 # If you don't have LUA, comment this line out, so that LUA_DIR
 # isn't defined.
 #
-!IF "$(MSVC_VARIANT)" == "MSVC2013" ||  "$(MSVC_VARIANT)" == "MSVC2013EE"
+!IF "$(MSVC_VARIANT)" == "MSVC2015" ||  "$(MSVC_VARIANT)" == "MSVC2015CE"
+LUA_DIST=-5.2.3_Win64_dll14
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2013" ||  "$(MSVC_VARIANT)" == "MSVC2013EE"
 LUA_DIST=-5.2.3_Win64_dll12
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2012" ||  "$(MSVC_VARIANT)" == "MSVC2012EE"
 LUA_DIST=-5.2.3_Win64_dll11
@@ -739,7 +760,7 @@ SMI_PKG=svn-40773
 #
 # Used to map IP addresses to MaxMind GeoIP database entries
 #
-GEOIP_PKG=1.5.1-2
+GEOIP_PKG=1.6.6
 
 #
 # Optional: WinSparkle, software updates
@@ -770,10 +791,15 @@ GTK_SCHEMAS_DIR=\share\glib-2.0\schemas
 # Set up the path to the Cygwin binaries
 # First check whether a 32-bit Cygwin installation exists
 # If not, check for a 64-bit Cygwin installation
-!IF EXIST(C:\cygwin\bin)
+!IF EXIST($(CYGWIN_PATH))
+# Do nothing
+!ELSE IF EXIST(C:\cygwin\bin)
 CYGWIN_PATH=C:\cygwin\bin
 !ELSE IF EXIST(C:\cygwin64\bin)
 CYGWIN_PATH=C:\cygwin64\bin
+!ELSE IF EXIST(C:\tools\cygwin\bin)
+# Chocolatey default
+CYGWIN_PATH=C:\tools\cygwin\bin
 !ELSE
 !ERROR Could not locate Cygwin, please set CYGWIN_PATH explicitly in config.nmake
 !ENDIF
@@ -792,6 +818,11 @@ SH_FLAGS=-o igncr
 
 SH=$(SH_PROG) $(SH_FLAGS)
 
+# PowerShell
+# Compatibility testing (...or should we always force version 2?)
+#POWERSHELL=powershell -Version 2.0 -executionpolicy bypass -File
+# Normal
+POWERSHELL=powershell -executionpolicy bypass -File
 
 # command for perl (cygwin's perl package recommended)
 PERL=perl
@@ -804,30 +835,40 @@ POD2HTML=$(SH) pod2html
 # command for sed (cygwin's sed recommended)
 SED=sed
 
-# Command for lex/flexx. Cygwin's flex or Chocolatey's win_flex
+# Command for Flex. Cygwin's flex or Chocolatey's win_flex
 # recommended.
 # Absolute or relative paths must be Windows-style
 
-# Chocolatey's C:\Chocolatey\bin\win_flex and -\win_bison are
-# currently unusable without some manual adjustments to the
-# win_flex and win_bison wrapper scripts. Calling the executables
-# directly should work.
+#LEX=\custom\path\to\flex
 
-#LEX=win_flex
-#LEX=C:\Chocolatey\lib\winflexbison.2.4.1.20140103\tools\win_flex
+# Find flex automatically
+!IF !DEFINED(LEX)
+!IF DEFINED(CHOCOLATEYINSTALL) && EXIST("$(CHOCOLATEYINSTALL)\bin\win_flex.exe")
+LEX=$(CHOCOLATEYINSTALL)\bin\win_flex
+!ELSE IF EXIST("$(CYGWIN_PATH)\flex.exe")
+# We add Cygwin to PATH below.
 LEX=flex
+!ENDIF
+!ENDIF
 
-# Command for yacc/bison. Cygwin's bison or Chocolatey's win_bison
+# Command for Bison. Cygwin's bison or Chocolatey's win_bison
 # recommended.
 # Absolute or relative paths must be Windows-style
 
-#YACC=win_bison
-#YACC=C:\Chocolatey\lib\winflexbison.2.4.1.20140103\tools\win_bison
+#YACC=\custom\path\to\bison
+
+# Find bison automatically
+!IF !DEFINED(YACC)
+!IF DEFINED(CHOCOLATEYINSTALL) && EXIST("$(CHOCOLATEYINSTALL)\bin\win_bison.exe")
+YACC=$(CHOCOLATEYINSTALL)\bin\win_bison
+!ELSE IF EXIST("$(CYGWIN_PATH)\bison.exe")
+# We add Cygwin to PATH below.
 YACC=bison
+!ENDIF
+!ENDIF
 
-# Commands to convert UNIX line endings to DOS/Windows
-UNIX2DOS=u2d
-TEXTIFY=$(SH) $(TOOLS_DIR)/textify.sh
+# Make our text files Windows-native
+TEXTIFY=$(POWERSHELL) $(TOOLS_DIR)/textify.ps1
 
 #
 # Optional: Build the NSIS installer.
@@ -847,18 +888,23 @@ TEXTIFY=$(SH) $(TOOLS_DIR)/textify.sh
 MAKENSIS="$(PROGRAM_FILES)\NSIS\makensis.exe"
 !ELSE IF EXIST("$(PROGRAM_FILES_W6432)\NSIS\makensis.exe")
 MAKENSIS="$(PROGRAM_FILES_W6432)\NSIS\makensis.exe"
+!ELSE IF EXIST("\Program Files (x86)\NSIS\makensis.exe")
+MAKENSIS="\Program Files (x86)\NSIS\makensis.exe"
 !ENDIF
 !ENDIF
 
 #
-# Optional: To build the NSIS PortableApps installer.
+# Optional: Build the PortableApps package (WiresharkPortable).
 #
-# If you have the NSIS Unicode package, set this to the NSIS Unicode executable.
+# If you have the PortableApps.com Platform installed set this to the main
+# PortableApps directory. In order to build packages you need to install
+# "PortableApps.com Launcher" and "NSIS Portable (Unicode)" *within* the
+# PortableApps environment.
 #
-# If you don't have NSIS Unicode, comment this line out, so that
-# MAKENSIS_UNICODE isn't defined.
+# If you don't have the PortableApps.com Platform installed comment this line
+# out.
 #
-MAKENSIS_UNICODE="$(PROGRAM_FILES)\NSIS\Unicode\makensis.exe"
+PORTABLEAPPS_DIR="C:\PortableApps"
 
 #
 # Optional: To build the developers API documentation with doxygen and dot.
@@ -886,7 +932,8 @@ MAKENSIS_UNICODE="$(PROGRAM_FILES)\NSIS\Unicode\makensis.exe"
 HHC_DIR=$(PROGRAM_FILES)\HTML Help Workshop
 
 #
-# Optional: To reduce the size of dlls and exes, which is especially useful for USB device distributions (U3, PortableApps)
+# Optional: To reduce the size of dlls and exes, which is especially useful for
+# USB device distributions (PortableApps)
 #
 # If you have the UPX package, set this to the upx.exe executable.
 #
@@ -912,6 +959,8 @@ MSC_VER_REQUIRED=1600
 MSC_VER_REQUIRED=1700
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2013" ||  "$(MSVC_VARIANT)" == "MSVC2013EE"
 MSC_VER_REQUIRED=1800
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2015" ||  "$(MSVC_VARIANT)" == "MSVC2015CE"
+MSC_VER_REQUIRED=1900
 !ELSE
 !ERROR MSVC_VARIANT unknown
 !ENDIF
@@ -936,12 +985,6 @@ APPVER=5.02
 # Compiler flags:
 # /W3                               Warning level 3 (0 less - 4 most, 1 default).
 # /Zi                               Create .pdb file for debugging.
-# /FR                               Create .sbr file with complete symbolic information.
-#                                   add to standard CFLAGS if you want to build the .sbr files
-#                                     for Wireshark compiles.
-#                                     Warning: using /FR for Wireshark requires ~1Gig of additional disk space
-#                                     XXX: provides less functionality for VC8, ... than for previous compilers ?
-#                                     XXX: .bsc files not usable (not supported ?) with VC10 (Visual Studio 2010) ?
 # /MD                               Use "multithread- and DLL-specific version" of run-time libraries.
 #                                    msvc documentation states that /MD causes _MT and _DLL to be defined
 #                                    See: http://msdn.microsoft.com/en-us/library/2kzt1wy3%28v=VS.90%29.aspx
@@ -967,10 +1010,7 @@ APPVER=5.02
 #                                   (see http://msdn.microsoft.com/en-us/library/bb531344(v=vs.110).aspx)
 #                                   This definition prevents the complaint about the redefinition of inline by WinPCap
 #                                   in pcap-stdinc.h when compiling CPP files, e.g. the QT UI
-#
-# -GS                               Stack-Based Buffer Overrun Detection: On by default for MSVC 2003 and later
-#                                    (See # http://msdn.microsoft.com/en-us/magazine/cc337897.aspx)
-# -O2                               http://msdn.microsoft.com/en-us/library/8f8h5cxt.aspx
+# /O2                               http://msdn.microsoft.com/en-us/library/8f8h5cxt.aspx
 #                                   Specifying the /O2 compiler option is the same as using the following options:
 #                                   /Ob (Inline Function Expansion), where the option parameter is 2 (/Ob2)
 #                                   /Og (Global Optimizations)
@@ -980,6 +1020,10 @@ APPVER=5.02
 #                                   /Gs (Control Stack Checking Calls))
 #                                   /GF (Eliminate Duplicate Strings)
 #                                   /Gy (Enable Function-Level Linking)
+# /Zo                               Output debug info allowing debuggers to display local values and trace into inline
+#                                   functions.  For VS2013 Update 3.  Assume all VS2013 builds are at least Update 3.
+#                                   See http://msdn.microsoft.com/en-us/library/dn785163.aspx
+#                                   VS2015: On by default when /Zi or /Z7 used.
 
 ##Note: LOCAL_CFLAGS are flags used for *all* compilations
 ##      STANDARD_CFLAGS (see below) are flags used just for *Wireshark* compilations
@@ -993,20 +1037,26 @@ APPVER=5.02
         "$(MSVC_VARIANT)" == "MSVC2012"   || \
         "$(MSVC_VARIANT)" == "MSVC2012EE" || \
         "$(MSVC_VARIANT)" == "MSVC2013"   || \
-        "$(MSVC_VARIANT)" == "MSVC2013EE"
+        "$(MSVC_VARIANT)" == "MSVC2013EE" || \
+        "$(MSVC_VARIANT)" == "MSVC2015"   || \
+        "$(MSVC_VARIANT)" == "MSVC2015CE"
 LOCAL_CFLAGS=/Zi /W3 /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=$(MSC_VER_REQUIRED) \
             /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1
 
 !IF "$(MSVC_VARIANT)" == "MSVC2012"   || \
         "$(MSVC_VARIANT)" == "MSVC2012EE" || \
         "$(MSVC_VARIANT)" == "MSVC2013"   || \
-        "$(MSVC_VARIANT)" == "MSVC2013EE"
+        "$(MSVC_VARIANT)" == "MSVC2013EE" || \
+        "$(MSVC_VARIANT)" == "MSVC2015"   || \
+        "$(MSVC_VARIANT)" == "MSVC2015CE"
 LOCAL_CFLAGS=$(LOCAL_CFLAGS) /D_ALLOW_KEYWORD_MACROS
 !ENDIF
 
 !IF "$(MSVC_VARIANT)" == "MSVC2013"   || \
-        "$(MSVC_VARIANT)" == "MSVC2013EE"
-LOCAL_CFLAGS=$(LOCAL_CFLAGS) /DBUILD_WINDOWS
+        "$(MSVC_VARIANT)" == "MSVC2013EE" || \
+        "$(MSVC_VARIANT)" == "MSVC2015"   || \
+        "$(MSVC_VARIANT)" == "MSVC2015CE"
+LOCAL_CFLAGS=$(LOCAL_CFLAGS) /DBUILD_WINDOWS /Zo
 !ENDIF
 
 !IF "$(WIRESHARK_TARGET_PLATFORM)" != "win64"
@@ -1016,7 +1066,8 @@ LOCAL_CFLAGS=$(LOCAL_CFLAGS) /D_BIND_TO_CURRENT_CRT_VERSION=1
 # Additional compiler warnings to be treated as "Level 3"
 #  when compiling Wireshark sources. (Selected from "level 4" warnings).
 ## 4295: array is too small to include a terminating null character
-WARNINGS_CFLAGS=/w34295
+## 4189: local variable is initialized but not referenced
+WARNINGS_CFLAGS=/w34295 /w34189
 
 !ELSE
 !ERROR MSVC_VARIANT unknown
@@ -1042,7 +1093,9 @@ WARNINGS_CFLAGS=/w34295
         "$(MSVC_VARIANT)" == "MSVC2012"   || \
         "$(MSVC_VARIANT)" == "MSVC2012EE" || \
         "$(MSVC_VARIANT)" == "MSVC2013"   || \
-        "$(MSVC_VARIANT)" == "MSVC2013EE"
+        "$(MSVC_VARIANT)" == "MSVC2013EE" || \
+        "$(MSVC_VARIANT)" == "MSVC2015"   || \
+        "$(MSVC_VARIANT)" == "MSVC2015CE"
 LOCAL_CFLAGS= $(LOCAL_CFLAGS) /MP
 !ENDIF
 
@@ -1058,11 +1111,6 @@ LOCAL_CFLAGS= $(LOCAL_CFLAGS) /analyze:WX-
 #STANDARD_CFLAGS are flags used for *Wireshark* compiles (not stuff like lemon, etc)
 STANDARD_CFLAGS=/DWINPCAP_VERSION=$(WINPCAP_VERSION) $(LOCAL_CFLAGS) $(WARNINGS_CFLAGS)
 
-# Optional: Define WIRESHARK_GENERATE_BSC_FILE to generate .sbr files for input to bscmake
-!IFDEF WIRESHARK_GENERATE_BSC_FILE
-STANDARD_CFLAGS= $(STANDARD_CFLAGS) /FR
-!ENDIF
-
 #Comment out the following if warnings are not to be treated as errors
 WARNINGS_ARE_ERRORS=-WX
 
@@ -1071,8 +1119,9 @@ WARNINGS_ARE_ERRORS=-WX
 # /PROFILE generate map file(s) for profiling
 # /DEFAULTLIB:xxx use xxx as the standard C library
 # /NODEFAULTLIB:xxx don't use xxx as the standard C library
+# /RELEASE set the checksum in the header, stops debugger complaints
 #
-LOCAL_LDFLAGS=/DEBUG /MACHINE:$(TARGET_MACHINE)
+LOCAL_LDFLAGS=/DEBUG /MACHINE:$(TARGET_MACHINE) /RELEASE
 DLL_LDFLAGS =
 !IFDEF MANIFEST_INFO_REQUIRED
 DLL_LDFLAGS = /MANIFEST:no
@@ -1156,7 +1205,7 @@ VCREDIST_EXE=$(VCREDIST_DIR)\vcredist_$(TARGET_MACHINE).exe
 # a portable version work, as the C runtime doesn't have to be
 # installed on the target machine.
 #
-MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 8\VC\redist\$(PROCESSOR_ARCHITECTURE)\Microsoft.VC80.CRT\*.*
+MSVCR_DLL=$(VCINSTALLDIR)\redist\$(PROCESSOR_ARCHITECTURE)\Microsoft.VC80.CRT\*.*
 
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20" || "$(MSVC_VARIANT)" == "MSVC2008EE"
 #
@@ -1180,7 +1229,7 @@ VCREDIST_EXE=$(VCREDIST_DIR)\vcredist_$(TARGET_MACHINE).exe
 # a portable version work, as the C runtime doesn't have to be
 # installed on the target machine.
 #
-MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 9.0\VC\redist\$(PROCESSOR_ARCHITECTURE)\Microsoft.VC90.CRT\*.*
+MSVCR_DLL=$(VCINSTALLDIR)\redist\$(PROCESSOR_ARCHITECTURE)\Microsoft.VC90.CRT\*.*
 
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2010EE"
 #
@@ -1192,6 +1241,7 @@ MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 9.0\VC\redist\$(PROCESSOR_ARC
 # vcredist_x86.exe or vcredist_x64.exe, from Microsoft first, and copy
 # it to the lib folder!!!
 VCREDIST_EXE=$(VCREDIST_DIR)\vcredist_$(TARGET_MACHINE).exe
+
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2010"
 #
 # For MSVC 2010 non-Express Edition, we "Install a particular Visual C++
@@ -1206,7 +1256,7 @@ VCREDIST_EXE=$(VCREDIST_DIR)\vcredist_$(TARGET_MACHINE).exe
 # C++ assembly as a private assembly for the application", starting
 # with Visual Studio 2010.
 #
-MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 10.0\VC\redist\$(TARGET_MACHINE)\Microsoft.VC100.CRT\*.*
+MSVCR_DLL=$(VCINSTALLDIR)\redist\$(TARGET_MACHINE)\Microsoft.VC100.CRT\*.*
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2012" || "$(MSVC_VARIANT)" == "MSVC2012EE"
 #
 # EE version added as per bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9227
@@ -1223,7 +1273,7 @@ MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 10.0\VC\redist\$(TARGET_MACHI
 # C++ assembly as a private assembly for the application", starting
 # with Visual Studio 2010.
 #
-MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 11.0\VC\redist\$(TARGET_MACHINE)\Microsoft.VC110.CRT\*.*
+MSVCR_DLL=$(VCINSTALLDIR)\redist\$(TARGET_MACHINE)\Microsoft.VC110.CRT\*.*
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2013" || "$(MSVC_VARIANT)" == "MSVC2013EE"
 #
 # EE version added as per bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9227
@@ -1240,7 +1290,22 @@ MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 11.0\VC\redist\$(TARGET_MACHI
 # C++ assembly as a private assembly for the application", starting
 # with Visual Studio 2010.
 #
-MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 12.0\VC\redist\$(TARGET_MACHINE)\Microsoft.VC120.CRT\*.*
+MSVCR_DLL=$(VCINSTALLDIR)\redist\$(TARGET_MACHINE)\Microsoft.VC120.CRT\*.*
+!ELSEIF "$(MSVC_VARIANT)" == "MSVC2015" || "$(MSVC_VARIANT)" == "MSVC2015CE"
+#
+# For MSVC 2015, we "Install a particular Visual C++
+# assembly as a private assembly for the application", by copying
+# the contents of the Microsoft.VC140.CRT folder to the target directory.
+# This is done to reduce the size of the installer; it also makes
+# a portable version work, as the C runtime doesn't have to be
+# installed on the target machine.
+#
+# Note: for what it's worth, Microsoft recommends "Using the Visual C++
+# Redistributable Package", rather than "Installing a particular Visual
+# C++ assembly as a private assembly for the application", starting
+# with Visual Studio 2010.
+#
+MSVCR_DLL=$(VCINSTALLDIR)\redist\$(TARGET_MACHINE)\Microsoft.VC140.CRT\*.*
 !ELSE
 !ERROR MSVC_VARIANT unknown
 !ENDIF
@@ -1269,23 +1334,22 @@ MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 12.0\VC\redist\$(TARGET_MACHI
 # You may want to install the FOP hyphenation patterns from
 # http://offo.sourceforge.net/hyphenation/
 !IFNDEF FOP
+
+!IF EXIST(docbook\fop-1.1\fop.bat)
+FOP=fop-1.1\fop.bat
+!ELSE IF EXIST($(WIRESHARK_LIB_DIR)\fop-1.1\fop.bat)
+FOP=$(WIRESHARK_LIB_DIR)\fop-1.1\fop.bat
+!ELSE IF EXIST(docbook\fop-1.0\fop.bat)
 FOP=fop-1.0\fop.bat
+!ELSE IF EXIST($(WIRESHARK_LIB_DIR)\fop-1.0\fop.bat)
+FOP=$(WIRESHARK_LIB_DIR)\fop-1.0\fop.bat
 !ENDIF
 
+!ENDIF FOP
+
 # Additional options to fop.
 FOP_OPTS=-Xmx256m
 
-# html to text converter for text version of release notes, e.g. elinks.
-# This could also be "lynx", or "true" if neither elinks nor lynx is installed
-# (cygwin: lynx works, elinks not available, links and true doesn't produce output)
-#HTML2TXT=elinks -dump -dump-width 72
-##HTML2TXT=links -dump -width 72 ## XXX: Fails: For links -dump requires 'url' (filename) arg.
-#HTML2TXT=lynx -dump -width=72 -nolist -stdin
-
-!IFNDEF HTML2TXT
-HTML2TXT=$(PYTHON) $(TOOLS_DIR)\html2text.py --width=72 --no-links
-!ENDIF
-
 # the XSL processor (part of cygwin's libxslt package)
 XSLTPROC="xsltproc"
 
@@ -1339,8 +1403,8 @@ GLIB_CFLAGS=/I$(GTK_DIR)\include\glib-$(GLIB_VERSION) \
 GLIB_LIBS=$(GTK_DIR)\lib\glib-$(GLIB_VERSION).lib \
        $(GTK_DIR)\lib\gmodule-$(GLIB_VERSION).lib \
        $(GTK_DIR)\lib\gobject-$(GLIB_VERSION).lib
-GTHREAD_LIBS=$(GTK_DIR)\lib\gthread-$(GLIB_VERSION).lib
 
+PROGRAM_NAME_GTK=$(PROGRAM_NAME)-gtk
 
 # 2.18 was no good(Theming problem)
 !IF "$(GTK_INST_VERSION)" == "2.24" || "$(GTK_INST_VERSION)" == "2.22" || "$(GTK_INST_VERSION)" == "2.16" || "$(GTK_INST_VERSION)" == "2.14"
@@ -1402,7 +1466,7 @@ NEED_XML_DLL=USE
 # GTK+
 ## Note: If Wireshark is ever to be built with Gtk >= 3.10
 ##        then -DGTK_DISABLE_DEPRECATED must be removed
-##        and -DGDK_DISABLE_DEPRECIATION_WARNINGS must
+##        and -DGDK_DISABLE_DEPRECATION_WARNINGS must
 ##        be added below.
 ##       Wireshark changes to handle Gtk 3.10 deprecated features
 ##        will not be done since Wireshark is moving to Qt.
@@ -1537,7 +1601,7 @@ PCAP_SETSAMPLING_CONFIG=
 
 !IFDEF ZLIB_DIR
 ZLIB_PATH=$(ZLIB_DIR)
-ZLIB_CFLAGS=/I$(ZLIB_DIR)\include
+ZLIB_CFLAGS=/I$(ZLIB_DIR)
 ZLIB_LIBS=$(ZLIB_DIR)\lib\zdll.lib
 ZLIB_DLL=$(ZLIB_DIR)\zlib1.dll
 # Nmake uses carets to escape special characters
@@ -1578,7 +1642,11 @@ ADNS_CONFIG=
 !IFDEF KFW_DIR
 KFW_PATH=$(KFW_DIR)\bin
 KFW_CFLAGS=/I$(KFW_DIR)\include
+!IF "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
 KFW_LIBS=$(KFW_DIR)\lib\krb5_32.lib
+!ELSE
+KFW_LIBS=$(KFW_DIR)\lib\krb5_64.lib
+!ENDIF
 # Nmake uses carets to escape special characters
 KFW_CONFIG=^#define HAVE_MIT_KERBEROS 1
 !else
@@ -1654,11 +1722,6 @@ SMI_DIR=$(WIRESHARK_LIB_DIR)\libsmi-$(SMI_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws
 SMI_CONFIG=^#define HAVE_LIBSMI 1
 SMI_CFLAGS=/I$(SMI_DIR)\include
 SMI_LIBS=$(SMI_DIR)\lib\libsmi-2.lib
-!ELSE
-SMI_DIR=
-SMI_LIBS=
-SMI_CFLAGS=
-SMI_CONFIG=
 !ENDIF
 
 !IFDEF GEOIP_PKG
@@ -1667,12 +1730,6 @@ GEOIP_CONFIG=^#define HAVE_GEOIP 1
 GEOIP_V6_CONFIG=^#define HAVE_GEOIP_V6 1
 GEOIP_CFLAGS=/I$(GEOIP_DIR)/include
 GEOIP_LIBS=$(GEOIP_DIR)\lib\libGeoIP-1.lib
-!ELSE
-GEOIP_DIR=
-GEOIP_LIBS=
-GEOIP_CFLAGS=
-GEOIP_CONFIG=
-GEOIP_V6_CONFIG=
 !ENDIF
 
 !IFDEF WINSPARKLE_PKG
@@ -1680,11 +1737,6 @@ WINSPARKLE_DIR=$(WIRESHARK_LIB_DIR)\WinSparkle-$(WINSPARKLE_PKG)
 WINSPARKLE_CONFIG=^#define HAVE_SOFTWARE_UPDATE 1
 WINSPARKLE_CFLAGS=/I$(WINSPARKLE_DIR)
 WINSPARKLE_LIBS=$(WINSPARKLE_DIR)\WinSparkle.lib
-!ELSE
-WINSPARKLE_DIR=
-WINSPARKLE_CONFIG=
-WINSPARKLE_CFLAGS=
-WINSPARKLE_LIBS=
 !ENDIF
 
 !IFDEF ENABLE_LIBWIRESHARK