Initialize 2.1.
[metze/wireshark/wip.git] / config.nmake
index e25c554d283cf0fd4ff314e18ad01d059e578fb7..42f2cb5907023a9a89ee5233dae2b92dfcb7e7b7 100644 (file)
@@ -1,19 +1,25 @@
-# $Id$
-
 # Some more information about the settings in this file can be found in
 # 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
 !ENDIF
 
 ##### Target platform #####
+
+# Pick up the value from the environment, VS2012 onwards sets PLATFORM via
+# vcvarsall.bat (it appears for X64 only).
+# For VS2010 and earlier you'll have to set the value yourself
+!IF "$(PLATFORM)" == "x64" || "$(PLATFORM)" == "X64"
+WIRESHARK_TARGET_PLATFORM=win64
+!ENDIF
+
 # Only "win32" and "win64" are valid (for now).
 # This can be defined in the system environment.
 !IFNDEF WIRESHARK_TARGET_PLATFORM
@@ -22,31 +28,34 @@ WIRESHARK_TARGET_PLATFORM=win32
 
 ##### Versions #####
 
-# The SVN revision of our build. Updated by make-version.pl
-SVN_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=11
-VERSION_MICRO=3
-VERSION_BUILD=$(SVN_REVISION)
+VERSION_MAJOR=2
+VERSION_MINOR=1
+VERSION_MICRO=0
+VERSION_BUILD=$(VCS_REVISION)
 
 # Local build information. Recommended: Unique string for your
 # environment, e.g. "-JackStackBarbecue". Updated by make-version.pl
+# Defaults to the environment variable WIRESHARK_VERSION_EXTRA
 
-VERSION_EXTRA=
+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 #####
 
 #
@@ -70,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
@@ -97,6 +105,20 @@ PROCESSOR_ARCHITECTURE=amd64
 
 
 ##### Microsoft Visual C / Studio Variant #####
+
+# Pick up the value from the environment, VS2012 onwards sets this via vcvarsall.bat
+# For VS2010 and earlier you'll have to set the value yourself
+# Assume that the lack of detection of Express editions doesn't matter
+!IF "$(VISUALSTUDIOVERSION)" == "10.0"
+MSVC_VARIANT=MSVC2010
+!ELSE IF "$(VISUALSTUDIOVERSION)" == "11.0"
+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
 # Only one of the following MSVC_VARIANT settings should be used
 
@@ -119,20 +141,19 @@ PROCESSOR_ARCHITECTURE=amd64
 # "Microsoft Visual C++ 2012 Express Edition"
 # Visual C++ 11.0, _MSC_VER 1700, msvcr110.dll
 ## Notes:
-##    1. Sep 20,2012: *Beta*: Build with VC11 (2012) succeeds; Seems OK: Minimally tested;
-##        win32.mak is apparently not part of the MS 2012EE install;
-##        To build Windows Wireshark, win32.mak must be obtained*
+##    1.  win32.mak is apparently not part of the MS 2012EE install;
+##        To build Windows Wireshark, win32.mak must be obtained [*]
 ##        and copied to a dir specified in the Windows Environment
 ##        variable 'include' (or to a dir added to the list in 'include').
-##        *One possibility: download the Windows 7 Platform SDK and copy
+##        Note that the 'include' environment variable is initialized
+##         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.
 ##          https://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx
-##    3. Feb 07,2013: [WMeier] I've noted no problems to date with Wireshark built with VS2012
-##        based upon a fair amount of use while doing Wireshark testing and debugging.
 ##
 #MSVC_VARIANT=MSVC2012EE
 
@@ -146,6 +167,16 @@ PROCESSOR_ARCHITECTURE=amd64
 
 # "Microsoft Visual Studio 2013 Express Edition"
 # Visual C++ 12.0, _MSC_VER 1800, msvcr120.dll
+##    Notes:
+##    1.  win32.mak is apparently not part of the MS 2013EE install;
+##        To build Windows Wireshark, win32.mak must be obtained [*]
+##        and copied to a dir specified in the Windows Environment
+##        variable 'include' (or to a dir added to the list in 'include').
+##        Note that the 'include' environment variable is initialized
+##         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: 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
@@ -167,31 +198,7 @@ MSVC_VARIANT=MSVC2010EE
 NASM=$(WIRESHARK_LIB_DIR)\nasm-2.09.08\nasm.exe
 
 #
-# Optional: the Python library enables scripting support.
-#
-# If you don't have the Python library, comment this line out, so that
-# PYTHON_EMBED isn't defined.
-#
-# NOTE: The Python library must have been compiled with the same
-# compiler (MSVC_VARIANT) as Wireshark. Known python.org Python
-# CRT versions:
-#
-# Python version    CRT (32-bit)    CRT (64-bit)
-# 2.4.4             7.1             ?
-# 2.6.1             9.0             ?
-# 2.6.2             ?               9.0
-# 2.7.1             9.0             9.0
-# 3.2.2             9.0             9.0
-#
-# If you versions of Python and Visual C++ use different CRTs
-# comment this out.
-#
-# XXX The DLL path in epan/wspython/wspy_libws.py likely needs to
-# be fixed before this is enabled by default.
-#PYTHON_EMBED=1
-
-#
-# 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
@@ -210,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
@@ -230,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
 
@@ -238,6 +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=2015-08-31
 ##### Win32 Libraries #####
 #
 # Mandatory: GLib settings
@@ -254,22 +270,24 @@ GLIB_VERSION=2.0
 # If you want building with GTK+, set GTK_DIR to the pathname of the
 # directory in which the "include" and "lib" directories reside.
 #
-# Set the name to gtk2 if you want to use gtk2
-GTK_NAME=gtk3
+# Set the name to gtk3 if you want to use gtk3
+GTK_NAME=gtk2
 GTK_DIR=$(WIRESHARK_LIB_DIR)\$(GTK_NAME)
 
 
 # These macros are used by the nsis installer script and by the install target.
 #EXPAT_DLL=libexpat-1.dll
-FFI_DLL=libffi-5.dll
+FFI_DLL=libffi-6.dll
 FONTCONFIG_DLL=libfontconfig-1.dll
 FREETYPE_DLL=libfreetype-6.dll
 INTL_DLL=libintl-8.dll
+HARFBUZZ_DLL=libharfbuzz-0.dll
 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
+SJLJ_DLL=libgcc_s_sjlj-1.dll
 TIFF_DLL=libtiff-5.dll
 XML_DLL=libxml2-2.dll
 
@@ -278,7 +296,7 @@ XML_DLL=libxml2-2.dll
 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.14-1.1
+GTK_PKG=2.24.23-1.1
 PKG_SUFIX=ws
 !ELSE
 GDK_DLL=libgdk-3-0.dll
@@ -311,6 +329,8 @@ GTK_INST_VERSION=3.4
 # installation directory:
 # http://stackoverflow.com/questions/913642/qmake-and-qt-install-prefix-how-can-i-select-a-new-location-for-qt-library
 #
+# NOTE> the qmake command given below returns a path with forward slashes,
+#      which will need to be changed to backslashes for things to work properly
 #QT5_BASE_DIR=output of "qmake -query QT_INSTALL_PREFIX"
 !IF !DEFINED(QT5_BASE_DIR)
 # Wireshark custom
@@ -319,6 +339,17 @@ QT5_BASE_DIR=C:\Qt\Qt-5.1.1-MSVC2010-$(WIRESHARK_TARGET_PLATFORM)-ws
 # Digia official
 !ELSE IF EXIST(C:\Qt\Qt5.1.1\5.1.1\msvc2010)
 QT5_BASE_DIR=C:\Qt\Qt5.1.1\5.1.1\msvc2010
+# Qt 5.2.1 web installer default paths
+!ELSE IF EXIST(C:\Qt\5.2.1\msvc2010)
+QT5_BASE_DIR=C:\Qt\5.2.1\msvc2010
+!ELSE IF EXIST(C:\Qt\5.2.1\msvc2012)
+QT5_BASE_DIR=C:\Qt\5.2.1\msvc2012
+!ELSE IF EXIST(C:\Qt\5.2.1\msvc2012_64)
+QT5_BASE_DIR=C:\Qt\5.2.1\msvc2012_64
+!ELSE IF EXIST(C:\Qt\Qt5.3.0\5.3\msvc2013)
+QT5_BASE_DIR=C:\Qt\Qt5.3.0\5.3\msvc2013
+!ELSE IF EXIST(C:\Qt\5.3\msvc2013)
+QT5_BASE_DIR=C:\Qt\5.3\msvc2013
 # Digia official, installed in $(WIRESHARK_LIB_DIR)
 !ELSE IF EXIST($(WIRESHARK_LIB_DIR)\Qt5.1.1\5.1.1\msvc2010)
 QT5_BASE_DIR=$(WIRESHARK_LIB_DIR)\Qt5.1.1\5.1.1\msvc2010
@@ -335,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
 
@@ -354,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
@@ -396,7 +427,9 @@ C_ARES_PKG=1.9.1-1
 # isn't defined.
 #
 # Platform SDK conflicts with openssl.h header
-GNUTLS_PKG=2.12.18-1.2
+GNUTLS_PKG=3.2.15-2.7
+GPGERROR_DLL=libgpg-error-0.dll
+GCC_DLL=libgcc_s_sjlj-1.dll
 
 #
 # Optional: the KFW library enables kerberos/sasl/dcerpc decryption.
@@ -408,19 +441,10 @@ GNUTLS_PKG=2.12.18-1.2
 # 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 Nettle library enables ??? decryption.
-#
-# If you have the Nettle encryption library, set this to the
-# directory in which the nettle package is stored.
-#
-# If you don't have Nettle, comment this line out, so that NETTLE_DIR
-# isn't defined.
-#
-# NETTLE_DIR=$(WIRESHARK_LIB_DIR)\nettle-1.10
-
-#
 # Optional: the LUA library enables scripting support.
 #
 # If you have the LUA library, set this to the directory in which
@@ -429,8 +453,16 @@ 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.
 #
-LUA_DIST=5_1_4_Win32_dll6
-LUA_DIR=$(WIRESHARK_LIB_DIR)\lua5.1.4
+!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
+!ELSE
+LUA_DIST=-5.2.3_Win32_dll10
+!ENDIF
+LUA_DIR=$(WIRESHARK_LIB_DIR)\lua5.2.3
 
 #
 # Optional: the PORTAUDIO library enables audio output for RTP streams.
@@ -473,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
@@ -484,6 +515,7 @@ GEOIP_PKG=1.5.1-2
 WINSPARKLE_PKG=0.3-44-g2c8d9d3-win32ws
 
 !else
+DOWNLOAD_TAG=2015-08-31
 ##### Win64 Libraries #####
 #
 # Mandatory: GLib settings
@@ -507,15 +539,17 @@ GTK_DIR=$(WIRESHARK_LIB_DIR)\$(GTK_NAME)
 
 # These macros are used by the nsis installer script and by the install target.
 #EXPAT_DLL=libexpat-1.dll
-FFI_DLL=libffi-5.dll
+FFI_DLL=libffi-6.dll
 FONTCONFIG_DLL=libfontconfig-1.dll
 FREETYPE_DLL=libfreetype-6.dll
 INTL_DLL=libintl-8.dll
+HARFBUZZ_DLL=libharfbuzz-0.dll
 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
+PNG_DLL=libpng16-16.dll
+#SEH_DLL=libgcc_s_seh-1.dll
 TIFF_DLL=libtiff-5.dll
 XML_DLL=libxml2-2.dll
 
@@ -523,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.14-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
@@ -566,6 +600,8 @@ QT5_BASE_DIR=C:\Qt\Qt-5.1.1-MSVC2010-$(WIRESHARK_TARGET_PLATFORM)-ws
 # Digia official
 !ELSE IF EXIST(C:\Qt\Qt5.1.1\5.1.1\msvc2010)
 QT5_BASE_DIR=C:\Qt\Qt5.1.1\5.1.1\msvc2010
+!ELSE IF EXIST(C:\Qt\5.3\msvc2013_64)
+QT5_BASE_DIR=C:\Qt\5.3\msvc2013_64
 # Digia official, installed in $(WIRESHARK_LIB_DIR)
 !ELSE IF EXIST($(WIRESHARK_LIB_DIR)\Qt5.1.1\5.1.1\msvc2010)
 QT5_BASE_DIR=$(WIRESHARK_LIB_DIR)\Qt5.1.1\5.1.1\msvc2010
@@ -582,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
 
@@ -602,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
@@ -643,7 +680,9 @@ C_ARES_PKG=1.9.1-1
 # isn't defined.
 #
 # Platform SDK conflicts with openssl.h header
-GNUTLS_PKG=2.12.18-1.2-1
+GNUTLS_PKG=3.2.15-2.9
+GPGERROR_DLL=libgpg-error6-0.dll
+GCC_DLL=libgcc_s_seh-1.dll
 
 #
 # Optional: the KFW library enables kerberos/sasl/dcerpc decryption.
@@ -654,18 +693,10 @@ GNUTLS_PKG=2.12.18-1.2-1
 # 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
-
-#
-# Optional: the Nettle library enables ??? decryption.
-#
-# If you have the Nettle encryption library, set this to the
-# directory in which the nettle package is stored.
-#
-# If you don't have Nettle, comment this line out, so that NETTLE_DIR
-# isn't defined.
-#
-# NETTLE_DIR=$(WIRESHARK_LIB_DIR)\nettle-1.10
+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.
@@ -676,8 +707,16 @@ GNUTLS_PKG=2.12.18-1.2-1
 # If you don't have LUA, comment this line out, so that LUA_DIR
 # isn't defined.
 #
-LUA_DIST=-5.1.4_Win64_dll10
-LUA_DIR=$(WIRESHARK_LIB_DIR)\lua5.1.4
+!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
+!ELSE
+LUA_DIST=-5.2.3_Win64_dll10
+!ENDIF
+LUA_DIR=$(WIRESHARK_LIB_DIR)\lua5.2.3
 
 #
 # Optional: the PORTAUDIO library enables audio output for RTP streams.
@@ -721,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
@@ -747,16 +786,29 @@ GTK_SCHEMAS_DIR=\share\glib-2.0\schemas
 ##### Tools #####
 
 # Set the following mandatory commands to find the tools.
-# The easiest way is to use the corresponding packages from cygwin.
-
-# Set up the path to the cygwin binaries
-CYGWIN_PATH=c:\cygwin\bin
+# The easiest way is to use the corresponding packages from Cygwin.
+
+# 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($(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
 
 # command for a shell (cygwin's bash package recommended)
 SH_PROG=bash
 
 # bash versions after 3.1.6 need the 'igncr' shell option to be able to
-#  process scripts in windows 'native format' (dos crlf format).
+#  process scripts in Windows 'native format' (dos crlf format).
 # The following !IF results in the option being used only if it is available
 #  since using it on bash version 3.1.6 (or earlier) is not required and
 #  will cause an error message.
@@ -766,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
@@ -778,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.
@@ -821,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.
@@ -860,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.
 #
@@ -875,11 +948,6 @@ UPX=$(WIRESHARK_LIB_DIR)\upx303w\upx.exe
 
 ##### Flags, PATHs and Miscellaneous #####
 
-# Santity check: Python embedding requires a valid PYTHON_DIR
-!IF DEFINED(PYTHON_EMBED) && !DEFINED(PYTHON_DIR)
-!ERROR PYTHON_EMBED requires that PYTHON_DIR is defined
-!ENDIF
-
 # "convert" the MSVC variant into the required MSC compiler version
 !IF "$(MSVC_VARIANT)" == "MSVC2005" || "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20"
 MSC_VER_REQUIRED=1400
@@ -891,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
@@ -901,10 +971,10 @@ MSC_VER_REQUIRED=1800
 MANIFEST_INFO_REQUIRED=1
 !ENDIF
 
-## VS2012 (VC11): configure subsystem version
+## VS2012 (VC11) and later: configure subsystem version
 ## See: https://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx
 ## (APPVER used in win32.mak to set subsystem version)
-!IF ($(MSC_VER_REQUIRED) == 1700)
+!IF ($(MSC_VER_REQUIRED) >= 1700)
 !if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
 APPVER=5.01
 !else
@@ -915,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
@@ -932,17 +996,35 @@ APPVER=5.02
 # /DWIN32_LEAN_AND_MEAN             Don't include unnecessary Windows include files (see windows.h).
 # /MANIFEST:no                      Don't create a SxS manifest. Makes sure our plugins don't load
 #                                     a second copy of the CRT.
-# -DPSAPI_VERSION=1                 Programs that must run on earlier versions of Windows as well as Windows 7 and later 
-#                                   versions should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols, 
-#                                   add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. 
-#                                   To use run-time dynamic linking, load Psapi.dll.
+# -DPSAPI_VERSION=1                 Programs that must run on earlier versions of Windows as well as Windows 7 and later
+#                                   versions should always call this function as GetProcessMemoryInfo. To ensure correct
+#                                   resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program
+#                                   with -DPSAPI_VERSION=1.To use run-time dynamic linking, load Psapi.dll.
 #                                   http://msdn.microsoft.com/en-us/library/windows/desktop/ms683219(v=vs.85).aspx
-# -DBUILD_WINDOWS                   Starting from VS2103, GetVersionEx is deprecated and we are recommended to use
+# -DBUILD_WINDOWS                   Starting from VS2013, GetVersionEx is deprecated and we are recommended to use
 #                                   VerifyVersionInfo instead
 #                                   http://msdn.microsoft.com/en-us/library/windows/desktop/ms724429(v=vs.85).aspx
 #                                   http://msdn.microsoft.com/en-us/library/windows/desktop/ms725491(v=vs.85).aspx
 #                                   To continue to use GetVersionEx, we can define BUILD_WINDOWS
-#
+# -D_ALLOW_KEYWORD_MACROS           For VS2012 onwards the, C++ STL does not permit macro redefinitions of keywords
+#                                   (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
+# /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)
+#                                   /Oi (Generate Intrinsic Functions)
+#                                   /Ot (Favor Fast Code)
+#                                   /Oy (Frame-Pointer Omission)
+#                                   /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
 !IF "$(MSVC_VARIANT)" == "MSVC2005"   || \
@@ -955,13 +1037,26 @@ APPVER=5.02
         "$(MSVC_VARIANT)" == "MSVC2012"   || \
         "$(MSVC_VARIANT)" == "MSVC2012EE" || \
         "$(MSVC_VARIANT)" == "MSVC2013"   || \
-        "$(MSVC_VARIANT)" == "MSVC2013EE"
-LOCAL_CFLAGS=/Zi /W3 /MD /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=$(MSC_VER_REQUIRED) \
+        "$(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)" == "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"
@@ -971,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
@@ -997,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
 
@@ -1008,14 +1106,11 @@ LOCAL_CFLAGS= $(LOCAL_CFLAGS) /MP
 LOCAL_CFLAGS= $(LOCAL_CFLAGS) /analyze:WX-
 !ENDIF
 
+## Do *not* redefine LOCAL_CFLAGS below this point !!
+
 #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
 
@@ -1024,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
@@ -1034,7 +1130,6 @@ DLL_LDFLAGS = /MANIFEST:no
 # Enable Safe Exception Handler.
 # http://msdn.microsoft.com/en-us/magazine/cc337897.aspx
 !IF $(MSC_VER_REQUIRED) >= 1300
-LOCAL_CFLAGS= $(LOCAL_CFLAGS) /GS
 !IF "$(WIRESHARK_TARGET_PLATFORM)" != "win64"
 LOCAL_LDFLAGS= $(LOCAL_LDFLAGS) /SafeSEH
 !ENDIF
@@ -1068,8 +1163,7 @@ ENABLE_LIBWIRESHARK=USE
 #
 # install (debug) directory for Wireshark (relative to your source dir)
 INSTALL_DIR=wireshark-gtk2
-
-
+INSTALL_DIR_QT=wireshark-qt-release
 
 ##### C-Runtime Redistributable #####
 #
@@ -1111,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"
 #
@@ -1135,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"
 #
@@ -1147,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++
@@ -1161,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
@@ -1178,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
@@ -1195,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
@@ -1224,31 +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 help compiler
-# Comment this out if you don't have hhc.exe or you don't want the docs in
-# .chm format.
-#
-# Beware: hhc.exe is NOT part of the MSVC packages in HHC_DIR mentioned above,
-# so you'll need to install the HTML Help Workshop for this.
-HHC_EXE="$(HHC_DIR)\hhc.exe"
-
-# 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"
 
@@ -1277,7 +1378,7 @@ LYNX=lynx
 # The RC_VERSION should be comma-separated, not dot-separated,
 # as per Graham Bloice's message in
 #
-#      http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html
+#      http://www.wireshark.org/lists/ethereal-dev/200303/msg00283.html
 #
 # "The RC_VERSION variable in config.nmake should be comma separated.
 # This allows the resources to be built correctly and the version
@@ -1302,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"
@@ -1330,34 +1431,42 @@ GTK_LIBS=$(GTK_DIR)\lib\gtk-win32-2.0.lib \
 
 GTK_LIB_DIR=2.10.0
 
-!IFDEF PNG_DLL
-NEED_PNG_DLL=USE
+!IFDEF HARFBUZZ_DLL
+NEED_HARFBUZZ_DLL=USE
 !ENDIF
 !IFDEF JPEG_DLL
 NEED_JPEG_DLL=USE
 !ENDIF
+!IFDEF PNG_DLL
+NEED_PNG_DLL=USE
+!ENDIF
+!IFDEF SEH_DLL
+NEED_SEH_DLL=USE
+!ENDIF
+!IFDEF SJLJ_DLL
+NEED_SJLJ_DLL=USE
+!ENDIF
 !IFDEF TIFF_DLL
 NEED_TIFF_DLL=USE
 !ENDIF
 NEED_CAIRO_DLL=USE
 # Pango >=1.24.5 Needs these:
-NEED_FREETYPE_DLL=USE
-NEED_FONTCONFIG_DLL=USE
 #NEED_EXPAT_DLL=USE
-NEED_XML_DLL=USE
-NEED_PIXMAN_DLL=USE
 NEED_FFI_DLL=USE
+NEED_FONTCONFIG_DLL=USE
+NEED_FREETYPE_DLL=USE
 NEED_JASPER_DLL=USE
 NEED_JPEG_DLL=USE
-NEED_TIFF_DLL=USE
 NEED_LZMA_DLL=USE
+NEED_PIXMAN_DLL=USE
+NEED_XML_DLL=USE
 
 !ELSEIF "$(GTK_INST_VERSION)" == "3.4" || "$(GTK_INST_VERSION)" == "3.6"
 
 # 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.
@@ -1400,6 +1509,9 @@ NEED_FONTCONFIG_DLL=USE
 !IFDEF FREETYPE_DLL
 NEED_FREETYPE_DLL=USE
 !ENDIF
+!IFDEF HARFBUZZ_DLL
+NEED_HARFBUZZ_DLL=USE
+!ENDIF
 !IFDEF JASPER_DLL
 NEED_JASPER_DLL=USE
 !ENDIF
@@ -1415,6 +1527,12 @@ NEED_PIXMAN_DLL=USE
 !IFDEF PNG_DLL
 NEED_PNG_DLL=USE
 !ENDIF
+!IFDEF SEH_DLL
+NEED_SEH_DLL=USE
+!ENDIF
+!IFDEF SJLJ_DLL
+NEED_SJLJ_DLL=USE
+!ENDIF
 !IFDEF TIFF_DLL
 NEED_TIFF_DLL=USE
 !ENDIF
@@ -1483,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
@@ -1524,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
@@ -1533,28 +1655,21 @@ KFW_LIBS=
 KFW_CONFIG=
 !ENDIF
 
-!IFDEF NETTLE_DIR
-NETTLE_CFLAGS=/I$(NETTLE_DIR)
-NETTLE_LIBS=$(NETTLE_DIR)\libnettle.lib
-# Nmake uses carets to escape special characters
-NETTLE_CONFIG=^#define HAVE_LIBNETTLE 1
-!else
-NETTLE_CFLAGS=
-NETTLE_LIBS=
-NETTLE_CONFIG=
-!ENDIF
-
 !IFDEF GNUTLS_PKG
 GNUTLS_DIR=$(WIRESHARK_LIB_DIR)\gnutls-$(GNUTLS_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws
 GNUTLS_PATH=$(GNUTLS_DIR)
 # /DNOCRYPT avoids inclusion of Wincrypt.h, avoiding a X509_NAME define clash
 GNUTLS_CFLAGS=/I$(GNUTLS_DIR)\include /DNOCRYPT /DIMPORT_LIGNUTLSDLL
-GCRYPT_LIBS = $(GNUTLS_DIR)\bin\libgcrypt-11.lib
+GCRYPT_LIBS = $(GNUTLS_DIR)\bin\libgcrypt-20.lib
 GNUTLS_LIBS=\
-       $(GNUTLS_DIR)\bin\libtasn1-3.lib        \
+       $(GNUTLS_DIR)\bin\libtasn1-6.lib        \
+!IF "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
        $(GNUTLS_DIR)\bin\libgpg-error-0.lib    \
+!ELSE
+       $(GNUTLS_DIR)\bin\libgpg-error6-0.lib   \
+!ENDIF
        $(GCRYPT_LIBS) \
-       $(GNUTLS_DIR)\bin\libgnutls-26.lib
+       $(GNUTLS_DIR)\bin\libgnutls-28.lib
 # Nmake uses carets to escape special characters
 GNUTLS_CONFIG=^#define HAVE_LIBGNUTLS 1
 LIBGCRYPT_CONFIG=^#define HAVE_LIBGCRYPT 1
@@ -1567,7 +1682,7 @@ LIBGCRYPT_CONFIG=
 
 !IFDEF LUA_DIR
 LUA_CFLAGS=/I$(LUA_DIR)\include
-LUA_LIBS=$(LUA_DIR)\lua5.1.lib
+LUA_LIBS=$(LUA_DIR)\lua52.lib
 # Nmake uses carets to escape special characters
 LUA_CONFIG=^#define HAVE_LUA 1
 LUA_VERSION=^#define HAVE_LUA 1
@@ -1577,17 +1692,6 @@ LUA_LIBS=
 LUA_CONFIG=
 !ENDIF
 
-!IF DEFINED(PYTHON_EMBED)
-PYTHON_CFLAGS=/I$(PYTHON_DIR)\include
-PYTHON_LIBS=$(PYTHON_DIR)\libs\python$(PYTHON_VER).lib
-# Nmake uses carets to escape special characters
-PYTHON_CONFIG=^#define HAVE_PYTHON 1
-!else
-PYTHON_CFLAGS=
-PYTHON_LIBS=
-PYTHON_CONFIG=
-!ENDIF
-
 !IFDEF PORTAUDIO_DIR
 # Nmake uses carets to escape special characters
 PORTAUDIO_CONFIG=^#define HAVE_LIBPORTAUDIO 1
@@ -1604,6 +1708,8 @@ PORTAUDIO_CONFIG=
 !ENDIF
 
 !IFDEF HHC_DIR
+PATH=$(PATH);$(HHC_DIR)
+HHC_EXE=hhc.exe
 HHC_CFLAGS=-DHHC_DIR
 HHC_LIBS=htmlhelp.lib
 !ELSE
@@ -1616,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
@@ -1629,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
@@ -1642,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