Add a much better workaround for bug #8382 and some expert info.
[metze/wireshark/wip.git] / config.nmake
index ea1ab1d21164430580b0dd7cf89a539c02f8c5e9..2029cbb35a2e969c01f7f8f601fbfe59e7622a7c 100644 (file)
@@ -3,6 +3,16 @@
 # 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
+# will be shared with a "normal" Wireshark installation.
+# Note that suport libararies needs to be in PROGRAM_NAME-libs...
+
+!IFNDEF PROGRAM_NAME
+PROGRAM_NAME=Wireshark
+!ENDIF
+
 ##### Target platform #####
 # Only "win32" and "win64" are valid (for now).
 # This can be defined in the system environment.
@@ -19,7 +29,7 @@ SVN_REVISION=0
 # Updated by make-version.pl
 VERSION_MAJOR=1
 VERSION_MINOR=9
-VERSION_MICRO=0
+VERSION_MICRO=1
 VERSION_BUILD=$(SVN_REVISION)
 
 # Local build information. Recommended: Unique string for your
@@ -40,7 +50,7 @@ WTAP_VERSION_MICRO=0
 # This can be defined in the system environment.
 #
 !IFNDEF WIRESHARK_LIB_DIR
-WIRESHARK_LIB_DIR=C:\wireshark-$(WIRESHARK_TARGET_PLATFORM)-libs
+WIRESHARK_LIB_DIR=C:\$(PROGRAM_NAME)-$(WIRESHARK_TARGET_PLATFORM)-libs
 !ENDIF
 
 #
@@ -112,16 +122,28 @@ PROCESSOR_ARCHITECTURE=amd64
 
 # "Microsoft Visual C++ 2012 Express Edition"
 # Visual C++ 11.0, _MSC_VER 1700, msvcr110.dll
-## Note: 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*
+## 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*
 ##        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
+##        *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
+##    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
 
+# "Microsoft Visual Studio 2012"
+# Visual C++ 11.0, _MSC_VER 1700, msvcr110.dll
+#MSVC_VARIANT=MSVC2012
+
 # The default if we haven't set a system environment variable or
 # uncommented an entry above.  We default to the version recommended
 # in the Developer's Guide, namely MSVC++ 2010 Express Edition.
@@ -228,10 +250,11 @@ 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 gtk3 if you want to use gtk3 - Not yet working
+# Set the name to gtk3 if you want to use gtk3 - experimental
 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
@@ -248,11 +271,14 @@ XML_DLL=libxml2-2.dll
 
 # This macro is used by the setup target.
 !IF "$(GTK_NAME)" == "gtk2"
-#GTK_PKG=2.16.6-20100912
-#GTK_PKG=2.22.1-20101227
-GTK_PKG=2.24.10-2.7
+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
 PKG_SUFIX=ws
 !ELSE
+GDK_DLL=libgdk-3-0.dll
+GTK_DLL=libgtk-3-0.dll
 PKG_SUFIX=ws
 GTK_PKG=3.4.4-2.1
 !ENDIF
@@ -264,8 +290,6 @@ GTK_PKG=3.4.4-2.1
 # These macros are used by the nsis installer script and by the setup target.
 #
 !IF "$(GTK_NAME)" == "gtk2"
-#GTK_INST_VERSION=2.16
-#GTK_INST_VERSION=2.22
 GTK_INST_VERSION=2.24
 !ELSE
 GTK_INST_VERSION=3.4
@@ -421,6 +445,13 @@ SMI_PKG=svn-40773
 #
 GEOIP_PKG=1.4.8-2
 
+#
+# Optional: WinSparkle, software updates
+#
+# Used for automatic software updates
+#
+WINSPARKLE_PKG=0.3-44-g2c8d9d3-win32ws
+
 !else
 ##### Win64 Libraries #####
 #
@@ -439,7 +470,7 @@ GLIB_VERSION=2.0
 # directory in which the "include" and "lib" directories reside.
 #
 #
-# Set the name to gtk3 if you want to use gtk3 - Not yet working
+# Set the name to gtk3 if you want to use gtk3 - experimental
 GTK_NAME=gtk2
 GTK_DIR=$(WIRESHARK_LIB_DIR)\$(GTK_NAME)
 
@@ -459,10 +490,14 @@ XML_DLL=libxml2-2.dll
 
 # These macros are used by the setup target.
 !IF "$(GTK_NAME)" == "gtk2"
-#GTK_PKG=2.16.6-20100912
-GTK_PKG=2.24.10-2.7
+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
 PKG_SUFIX=ws
 !ELSE
+GDK_DLL=libgdk-3-0.dll
+GTK_DLL=libgtk-3-0.dll
 PKG_SUFIX=ws
 GTK_PKG=3.4.4-2.1
 !ENDIF
@@ -630,7 +665,26 @@ SMI_PKG=svn-40773
 #
 GEOIP_PKG=1.4.8-2
 
+#
+# Optional: WinSparkle, software updates
+#
+# Used for automatic software updates
+#
+WINSPARKLE_PKG=0.3-44-g2c8d9d3-win64ws
+
 !endif
+# win32 / win64
+
+!IF "$(GTK_NAME)" == "gtk2"
+GTK_ETC_DIR=etc\gtk-2.0
+GTK_ENGINES_DIR=lib\gtk-2.0\$(GTK_LIB_DIR)\engines
+GTK_MODULES_DIR=lib\gtk-2.0\modules
+GTK_THEMES_DIR=share\themes\MS-Windows\gtk-2.0
+!ELSE
+GTK_ETC_DIR=etc\gtk-3.0
+GTK_SCHEMAS_DIR=\share\glib-2.0\schemas
+!ENDIF
+
 
 ##### Tools #####
 
@@ -758,6 +812,17 @@ MSC_VER_REQUIRED=1700
 MANIFEST_INFO_REQUIRED=1
 !ENDIF
 
+## VS2012 (VC11): 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 "$(WIRESHARK_TARGET_PLATFORM)" == "win32"
+APPVER=5.01
+!else
+APPVER=5.02
+!endif
+!ENDIF
+
 # Compiler flags:
 # /W3                               Warning level 3 (0 less - 4 most, 1 default).
 # /Zi                               Create .pdb file for debugging.
@@ -836,7 +901,7 @@ LOCAL_CFLAGS= $(LOCAL_CFLAGS) /analyze:WX-
 !ENDIF
 
 #STANDARD_CFLAGS are flags used for *Wireshark* compiles (not stuff like lemon, etc)
-STANDARD_CFLAGS=-DHAVE_CONFIG_H /DPCAP_VERSION=$(PCAP_VERSION) $(LOCAL_CFLAGS) $(WARNINGS_CFLAGS)
+STANDARD_CFLAGS=/DPCAP_VERSION=$(PCAP_VERSION) $(LOCAL_CFLAGS) $(WARNINGS_CFLAGS)
 
 # Optional: Define WIRESHARK_GENERATE_BSC_FILE to generate .sbr files for input to bscmake
 !IFDEF WIRESHARK_GENERATE_BSC_FILE
@@ -908,39 +973,111 @@ INSTALL_DIR=wireshark-gtk2
 # packages, the following will use the default paths depending
 # on the package version.
 #
+
+# You can either place the redistributable in its own platform-
+# and compiler-specific directory or in the top-level library
+# directory.
+!IF EXIST("$(WIRESHARK_LIB_DIR)\vcredist_$(MSVC_VARIANT)")
+VCREDIST_DIR=$(WIRESHARK_LIB_DIR)\vcredist_$(MSVC_VARIANT)
+!ELSE
+VCREDIST_DIR=$(WIRESHARK_LIB_DIR)
+!ENDIF
+
 !IF "$(WIRESHARK_TARGET_PLATFORM)" == "win64"
-# We're not creating portable packages and therefore don't have to worry about
-# "deploying using xcopy"
-VCREDIST_EXE=$(WIRESHARK_LIB_DIR)\vcredist_$(TARGET_MACHINE).exe
+#
+# For 64-bit platforms, we don't create portable packages and therefore
+# don't have to worry that "Using the Visual C++ Redistributable
+# Package" requires that an installer be run to install that package,
+# so we use that method to make the C runtime available.
+#
+VCREDIST_EXE=$(VCREDIST_DIR)\vcredist_$(TARGET_MACHINE).exe
 
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2005"
+#
+# For MSVC 2005 non-Express Edition, we "Install a particular Visual C++
+# assembly as a private assembly for the application", by copying
+# the contents of the Microsoft.VC80.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.
+#
 MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 8\VC\redist\$(PROCESSOR_ARCHITECTURE)\Microsoft.VC80.CRT\*.*
 
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2005EE" || "$(MSVC_VARIANT)" == "DOTNET20" || "$(MSVC_VARIANT)" == "MSVC2008EE"
-# you need to download the redistributable package vcredist_x86.exe from Microsoft first,
-# and copy it to the lib folder!!!
-VCREDIST_EXE=$(WIRESHARK_LIB_DIR)\vcredist_$(TARGET_MACHINE).exe
+#
+# For MSVC 2005 Express Edition, for the .NET Framework 2.0 SDK, and
+# for MSVC 2008 Express Edition, we "Use the Visual C++ Redistributable
+# Package", because they don't provide the Microsoft.VC80.CRT folder.
+#
+# They also don't provide the redistributable package, so you need to
+# download the appropriate version of the redistributable package,
+# vcredist_x86.exe, vcredist_x64.exe, or vcredist_ia64.exe, from
+# Microsoft first, and copy it to the lib folder!!!
+#
+VCREDIST_EXE=$(VCREDIST_DIR)\vcredist_$(TARGET_MACHINE).exe
 
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2008"
+#
+# For MSVC 2008 non-Express Edition, we "Install a particular Visual C++
+# assembly as a private assembly for the application", by copying
+# the contents of the Microsoft.VC90.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.
+#
 MSVCR_DLL=$(PROGRAM_FILES)\Microsoft Visual Studio 9.0\VC\redist\$(PROCESSOR_ARCHITECTURE)\Microsoft.VC90.CRT\*.*
 
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2010EE"
-# you need to download the redistributable package vcredist_x86.exe from Microsoft first,
-# and copy it to the lib folder!!!
-VCREDIST_EXE=$(WIRESHARK_LIB_DIR)\vcredist_$(TARGET_MACHINE).exe
+#
+# For MSVC 2010 Express Edition, we "Use the Visual C++ Redistributable
+# Package", because it doesn't provide the Microsoft.VC80.CRT folder.
+#
+# It also doesn't provide the redistributable package, so you need to
+# download the appropriate version of the redistributable package,
+# 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++
+# assembly as a private assembly for the application", by copying
+# the contents of the Microsoft.VC100.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=$(PROGRAM_FILES)\Microsoft Visual Studio 10.0\VC\redist\$(TARGET_MACHINE)\Microsoft.VC100.CRT\*.*
 !ELSEIF "$(MSVC_VARIANT)" == "MSVC2012"
+#
+# For MSVC 2012 non-Express Edition, we "Install a particular Visual C++
+# assembly as a private assembly for the application", by copying
+# the contents of the Microsoft.VC110.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=$(PROGRAM_FILES)\Microsoft Visual Studio 11.0\VC\redist\$(TARGET_MACHINE)\Microsoft.VC110.CRT\*.*
 
 !ELSE
 !ERROR MSVC_VARIANT unknown
 !ENDIF
 
-!IF DEFINED(VCREDIST_EXE) && ! EXIST("$(VCREDIST_EXE)")
-!ERROR Can't find $(VCREDIST_EXE). Have you downloaded it from Microsoft? \
-See the developer's guide section "C-Runtime "Redistributable" files" for details how to get it
-!ENDIF
+# This is still optional yet we define it above for all users.
+# So, don't check if it exists...
+#!IF DEFINED(VCREDIST_EXE) && ! EXIST("$(VCREDIST_EXE)")
+#!ERROR Can't find $(VCREDIST_EXE). Have you downloaded it from Microsoft? \
+#See the developer's guide section "C-Runtime "Redistributable" files" for details how to get it
+#!ENDIF
 
 ##### Advanced: Docbook/XML documentation generation #####
 # If you want to generate the Docbook/XML based docs (User's and Developer's
@@ -1079,15 +1216,10 @@ NEED_JPEG_DLL=USE
 NEED_TIFF_DLL=USE
 NEED_LZMA_DLL=USE
 
-GTK_WIMP_DLLSRC_DIR=$(GTK_DIR)\lib\gtk-2.0\$(GTK_LIB_DIR)\engines
-GTK_WIMP_DLLDST_DIR=lib\gtk-2.0\$(GTK_LIB_DIR)\engines
-GTK_WIMP_RCSRC_DIR=$(GTK_DIR)\share\themes\MS-Windows\gtk-2.0
-GTK_WIMP_RCDST_DIR=etc\gtk-2.0
 #
 # Use of GTK3+ is experimental/not working
 #
 !ELSEIF "$(GTK_INST_VERSION)" == "3.4"
-GTK_SCHEMAS_INST_DIR=\share\glib-2.0\schemas
 
 # GTK+
 GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR)\include\gtk-3.0 \
@@ -1111,6 +1243,7 @@ GTK_LIB_DIR=3.4
 !IFDEF _DLL
 !ENDIF
 
+NEED_CAIRO_GOBJECT_DLL=USE
 NEED_CAIRO_DLL=USE
 
 !IFDEF EXPAT_DLL
@@ -1362,6 +1495,18 @@ GEOIP_CONFIG=
 GEOIP_V6_CONFIG=
 !ENDIF
 
+!IFDEF WINSPARKLE_PKG
+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
 LIBWIRESHARK_CONFIG=^#define HAVE_LIBWIRESHARKDLL 1
 # Link plugins with the import library of libwireshark.dll