wslua: Abort on out of memory
[metze/wireshark/wip.git] / config.nmake
index 9d8d45b88e091426e3bfa9a67fdc7a7db86a9967..df21f81eeece6aed38213904d17801e336f6a7be 100644 (file)
@@ -1,11 +1,24 @@
 # Some more information about the settings in this file can be found in
 # the file README.windows and the Developer's Guide (available online).
 
+##### Deprecation #####
+# Support for NMake and QMake will be removed in June 2016.
+# Uncomment the following line or pass YES_I_KNOW_ABOUT_THE_DEPRECATION=1
+# on the command line to override.
+
+#YES_I_KNOW_ABOUT_THE_DEPRECATION=1
+!IFNDEF YES_I_KNOW_ABOUT_THE_DEPRECATION
+!MESSAGE Nmake is being deprecated. Please consider using CMake instead.
+!MESSAGE See https://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html
+!MESSAGE for details.
+!ERROR Set YES_I_KNOW_ABOUT_THE_DEPRECATION to disable this message.
+!ENDIF
+
 ##### 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 +27,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 +41,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 +57,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 +92,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 +128,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 +162,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 +189,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 +211,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 +230,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 +253,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,6 +266,7 @@ PCAP_NG_DEFAULT=^#define PCAP_NG_DEFAULT 1
 WANT_PACKET_EDITOR=^#define WANT_PACKET_EDITOR 1
 
 !if "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
+DOWNLOAD_TAG=2016-04-07
 ##### Win32 Libraries #####
 #
 # Mandatory: GLib settings
@@ -317,6 +342,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
@@ -334,6 +361,8 @@ QT5_BASE_DIR=C:\Qt\5.2.1\msvc2012
 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
@@ -350,7 +379,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
 
@@ -369,30 +399,14 @@ 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
-
-#
-# Optional: the ADNS library enables asynchronous (nonblocking) DNS
-# name resolvings.
-#
-# If you have GNU ADNS, set this to the directory in which the GNU ADNS
-# .lib file is stored.
-#
-# If you don't have GNU ADNS, comment this line out, so that ADNS_DIR
-# isn't defined.
-#
-# If C_ARES_DIR is defined below, it will override this setting.
-#
-#ADNS_DIR=$(WIRESHARK_LIB_DIR)\adns-1.0-win32-05ws
+ZLIB_DIR=$(WIRESHARK_LIB_DIR)\zlib-1.2.8-ws
 
 #
 # Optional: the c-ares library enables asynchronous (nonblocking) DNS
 # name resolvings.
 #
 # If you have c-ares, set this to the directory in which the c-ares
-# .lib file is stored. Setting this will override ADNS_DIR above. You
-# can't have both.
+# .lib file is stored.
 #
 # If you're using Visual C++ 6.0, you'll have to use a platform SDK that
 # defines socklen_t, such as Windows Server 2003 PSDK.
@@ -411,10 +425,17 @@ 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
 
+# Optional: libssh library is required for sshdump and ciscodump support
+#
+# If you don't have libssh, comment this line out so that LIBSSH_DIR
+# isn't defined.
+#
+#LIBSSH_DIR=$(WIRESHARK_LIB_DIR)\libssh-0.7.2
+
 #
 # Optional: the KFW library enables kerberos/sasl/dcerpc decryption.
 #
@@ -425,6 +446,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.
 #
@@ -434,7 +458,11 @@ 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)" == "MSVC2012" ||  "$(MSVC_VARIANT)" == "MSVC2012EE"
+!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
@@ -482,8 +510,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
@@ -493,6 +520,7 @@ GEOIP_PKG=1.5.1-2
 WINSPARKLE_PKG=0.3-44-g2c8d9d3-win32ws
 
 !else
+DOWNLOAD_TAG=2016-04-07
 ##### Win64 Libraries #####
 #
 # Mandatory: GLib settings
@@ -525,8 +553,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
 
@@ -534,8 +562,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
@@ -577,6 +605,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
@@ -593,7 +623,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
 
@@ -613,29 +644,14 @@ 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
-
-#
-# Optional: the ADNS library enables asynchronous (nonblocking) DNS
-# name resolvings.
-#
-# If you have GNU ADNS, set this to the directory in which the GNU ADNS
-# .lib file is stored.
-#
-# If you don't have GNU ADNS, comment this line out, so that ADNS_DIR
-# isn't defined.
-#
-# If C_ARES_DIR is defined below, it will override this setting.
-#
-#ADNS_DIR=$(WIRESHARK_LIB_DIR)\adns-1.0-win32-05ws
+ZLIB_DIR=$(WIRESHARK_LIB_DIR)\zlib-1.2.8-ws
 
 #
 # Optional: the c-ares library enables asynchronous (nonblocking) DNS
 # name resolvings.
 #
 # If you have c-ares, set this to the directory in which the c-ares
-# .lib file is stored. Setting this will override ADNS_DIR above. You
-# can't have both.
+# .lib file is stored.
 #
 # If you're using Visual C++ 6.0, you'll have to use a platform SDK that
 # defines socklen_t, such as Windows Server 2003 PSDK.
@@ -654,7 +670,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
 
@@ -667,7 +683,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.
@@ -678,7 +697,11 @@ 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)" == "MSVC2012" ||  "$(MSVC_VARIANT)" == "MSVC2012EE"
+!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
@@ -727,7 +750,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
@@ -753,10 +776,23 @@ 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
@@ -772,6 +808,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
@@ -784,30 +825,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.
@@ -827,18 +878,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.
@@ -866,7 +922,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.
 #
@@ -892,6 +949,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
@@ -916,12 +975,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
@@ -947,17 +1000,26 @@ 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
-#
-# -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)
 #                                   /Oi (Generate Intrinsic Functions)
 #                                   /Ot (Favor Fast Code)
 #                                   /Oy (Frame-Pointer Omission)
-#                                   /Gs (Buffer Security Check)
+#                                   /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.
+
+!IF DEFINED(DEBUG)
+DEBUG_CFLAGS=/Od
+!ELSE
+DEBUG_CFLAGS=/O2
+!ENDIF
 
 ##Note: LOCAL_CFLAGS are flags used for *all* compilations
 ##      STANDARD_CFLAGS (see below) are flags used just for *Wireshark* compilations
@@ -971,20 +1033,26 @@ APPVER=5.02
         "$(MSVC_VARIANT)" == "MSVC2012"   || \
         "$(MSVC_VARIANT)" == "MSVC2012EE" || \
         "$(MSVC_VARIANT)" == "MSVC2013"   || \
-        "$(MSVC_VARIANT)" == "MSVC2013EE"
-LOCAL_CFLAGS=/Zi /W3 /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=$(MSC_VER_REQUIRED) \
+        "$(MSVC_VARIANT)" == "MSVC2013EE" || \
+        "$(MSVC_VARIANT)" == "MSVC2015"   || \
+        "$(MSVC_VARIANT)" == "MSVC2015CE"
+LOCAL_CFLAGS=/Zi /W3 /MD $(DEBUG_CFLAGS) /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"
@@ -994,7 +1062,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
@@ -1020,7 +1089,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
 
@@ -1031,14 +1102,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
 
@@ -1047,8 +1115,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
@@ -1057,7 +1126,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
@@ -1091,7 +1159,7 @@ ENABLE_LIBWIRESHARK=USE
 #
 # install (debug) directory for Wireshark (relative to your source dir)
 INSTALL_DIR=wireshark-gtk2
-INSTALL_DIR_QT=wireshark-qt-release 
+INSTALL_DIR_QT=wireshark-qt-release
 
 ##### C-Runtime Redistributable #####
 #
@@ -1133,7 +1201,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"
 #
@@ -1157,7 +1225,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"
 #
@@ -1169,6 +1237,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++
@@ -1183,7 +1252,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
@@ -1200,7 +1269,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
@@ -1217,7 +1286,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
@@ -1246,37 +1330,25 @@ 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"
 
-# the XML validator (part of cygwin's libxml2 package)
-XMLLINT="xmllint"
-
 # Asciidoc converter (part of cygwin's asciidoc package). In order to build
 # the release notes you must have the Cygwin asciidoc and lynx packages
 # installed.
@@ -1324,8 +1396,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"
@@ -1387,7 +1459,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.
@@ -1493,6 +1565,7 @@ PCAP_FREE_DATALINKS_CONFIG=^#define HAVE_PCAP_FREE_DATALINKS 1
 PCAP_SET_DATALINK_CONFIG=^#define HAVE_PCAP_SET_DATALINK 1
 PCAP_OPEN_DEAD_CONFIG=^#define HAVE_PCAP_OPEN_DEAD 1
 BPF_IMAGE_CONFIG=^#define HAVE_BPF_IMAGE 1
+PCAP_CREATE_CONFIG=^#define HAVE_PCAP_CREATE 1
 !ELSE
 # no WpdPack installed
 WINPCAP_CONFIG=
@@ -1522,11 +1595,11 @@ 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
-ZLIB_CONFIG=^#define HAVE_LIBZ 1
+ZLIB_CONFIG=^#define HAVE_ZLIB 1
 !else
 ZLIB_CFLAGS=
 ZLIB_LIBS=
@@ -1535,7 +1608,6 @@ ZLIB_CONFIG=
 !ENDIF
 
 !IFDEF C_ARES_PKG
-!UNDEF ADNS_DIR
 C_ARES_DIR=$(WIRESHARK_LIB_DIR)\c-ares-$(C_ARES_PKG)-$(WIRESHARK_TARGET_PLATFORM)ws
 C_ARES_CFLAGS=/I$(C_ARES_DIR)/include
 C_ARES_LIBS=$(C_ARES_DIR)\lib\libcares-2.lib
@@ -1546,24 +1618,16 @@ C_ARES_CONFIG=^#define HAVE_C_ARES 1
 C_ARES_CFLAGS=
 C_ARES_LIBS=
 C_ARES_CONFIG=
-!IFDEF ADNS_DIR
-ADNS_PATH=$(ADNS_DIR)\adns_win32\lib
-ADNS_CFLAGS=/I$(ADNS_DIR)\src /I$(ADNS_DIR)\adns_win32
-ADNS_LIBS=$(WIRESHARK_LIB_DIR)\$(MSVC_VARIANT)\adns\adns_dll.lib
-ADNS_DLL=$(WIRESHARK_LIB_DIR)\$(MSVC_VARIANT)\adns\adns_dll.dll
-# Nmake uses carets to escape special characters
-ADNS_CONFIG=^#define HAVE_GNU_ADNS 1
-!else
-ADNS_CFLAGS=
-ADNS_LIBS=
-ADNS_CONFIG=
-!ENDIF # ADNS
 !ENDIF # C_ARES
 
 !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
@@ -1597,6 +1661,18 @@ GNUTLS_CONFIG=
 LIBGCRYPT_CONFIG=
 !ENDIF
 
+!IFDEF LIBSSH_DIR
+LIBSSH_CFLAGS=/I$(LIBSSH_DIR)\include
+LIBSSH_LIBS=$(LIBSSH_DIR)\lib\ssh.lib
+# Nmake uses carets to escape special characters
+LIBSSH_CONFIG=^#define HAVE_LIBSSH 1
+LIBSSH_VERSION=^#define HAVE_LIBSSH 1
+!else
+LIBSSH_CFLAGS=
+LIBSSH_LIBS=
+LIBSSH_CONFIG=
+!ENDIF
+
 !IFDEF LUA_DIR
 LUA_CFLAGS=/I$(LUA_DIR)\include
 LUA_LIBS=$(LUA_DIR)\lua52.lib
@@ -1625,6 +1701,8 @@ PORTAUDIO_CONFIG=
 !ENDIF
 
 !IFDEF HHC_DIR
+PATH=$(PATH);$(HHC_DIR)
+HHC_EXE=hhc.exe
 HHC_CFLAGS=-DHHC_DIR
 HHC_LIBS=htmlhelp.lib
 !ELSE
@@ -1637,11 +1715,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
@@ -1650,12 +1723,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
@@ -1663,11 +1730,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
@@ -1678,8 +1740,6 @@ LIBWIRESHARK_CONFIG=
 !ENDIF
 
 # Construct the path
-PATH=$(PATH);$(CYGWIN_PATH);$(GTK_DIR)\bin;$(GETTEXT_DIR)\bin;$(ZLIB_PATH);$(ADNS_PATH)
-
-INET6_CONFIG=^#define INET6 1
+PATH=$(PATH);$(CYGWIN_PATH);$(GTK_DIR)\bin;$(GETTEXT_DIR)\bin;$(ZLIB_PATH)
 
 NTDDNDIS_CONFIG=^#define HAVE_NTDDNDIS_H 1