Commit Graph

1029 Commits

Author SHA1 Message Date
Gerald Combs 0173337c91 CMake: Make sure we deploy Qt PDBs on Windows.
Pass "--pdb" to windeployqt 5.6 and later.

Add a note about installing the "Qt Debug Information Files" component
to the Developer's Guide.

Change-Id: I81329bc9f9131050b1076fe275445b6325c24794
Reviewed-on: https://code.wireshark.org/review/31921
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-07 04:41:04 +00:00
Uli Heilmeier af3c6115f2 CMake: Fix build without LibXml2
This is still needed when LibXml2 is missing, otherwise the build fails with:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Fixes: v2.9.1rc0-625-gd17e218918 ("CMake: Update FindLibXml2.cmake")
Change-Id: I06fc2c18aa82dd553d5a10604c1a874c9a2e88a8
Reviewed-on: https://code.wireshark.org/review/31896
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-05 15:35:48 +00:00
Gerald Combs 2ed12a238b 2.9 → 3.1.
Change-Id: Iea6b55037bfb62d2e9b333148cbdc55fcd53dfa2
Reviewed-on: https://code.wireshark.org/review/31888
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-05 01:21:10 +00:00
João Valverde d17e218918 CMake: Update FindLibXml2.cmake
Change-Id: I55f77910be642535cba128900c2af40fa6824f04
Reviewed-on: https://code.wireshark.org/review/31874
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-02-04 10:14:36 +00:00
João Valverde 1bb1ffa9ca CMake: Install documentation to docdir
Change-Id: I6860f2ba8c09daff3a72e44f0c41a1b19fb79218
Reviewed-on: https://code.wireshark.org/review/31852
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-02-03 10:43:27 +00:00
João Valverde c2eddffb84 CMake: Fix DOCDIR on Unix
User guides are installed to doc/Wireshark. Use doc/wireshark instead.

Remove leftover variable CPACK_PACKAGE_NAME.

Change-Id: I9a1d6bdc7d8f0b48c61e43679285d5ba83904a63
Reviewed-on: https://code.wireshark.org/review/31851
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-02-02 16:53:49 +00:00
Peter Wu 3bbf2c5e64 CMake: describe purpose of MaxMindDB
Change-Id: I7a3ec64d772ee5fc0d3b040702dfc0de8da93250
Reviewed-on: https://code.wireshark.org/review/31836
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31 13:16:12 +00:00
Peter Wu 298da5213b CMake: describe the purpose of NL
Change-Id: I9bfb2400445399088ff67eab39178e38daf85499
Reviewed-on: https://code.wireshark.org/review/31835
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31 13:15:58 +00:00
Peter Wu 87e5269c69 CMake: rewrite FindSystemd.cmake file
Clarify that this is only needed for the sdjournal extcap interface and
report the found version in the CMake output.

Change-Id: I40bc540631bda32d0b92e4fcd59d8c1726606d86
Reviewed-on: https://code.wireshark.org/review/31834
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-31 13:15:47 +00:00
João Valverde 1260f3edea CMake: Minor standard output improvements
Change-Id: I7677220ec49d7b04f61e2a7287dac3a744f1c6c6
Reviewed-on: https://code.wireshark.org/review/31786
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-01-29 15:03:25 +00:00
João Valverde 4f46a2af88 CMake: Set a direct rpath for libraries
Instead of using "$ORIGIN/../lib" just use "$ORIGIN".

Also be explicit in configuring the relative RPATH. We don't want
to assume a default relative path, in case more targets are addded,
out of caution.

Change-Id: I3b7f5e8de7be8bb30aca3b433212113d876c4163
Reviewed-on: https://code.wireshark.org/review/31647
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-22 00:55:40 +00:00
Peter Wu 6a7865e969 CMake: strip directory prefixes from __FILE__ macros
Depending on the build location, the full source and/or build directory
is currently visible in error messages (for example, DISSECTOR_ASSERT).
Remove these to help with reproducible builds and have shorter messages.

A similar option (-fdebug-prefix-map) is also needed, but it affects
external debugging tools and is therefore better left to distributors
(Debian and Arch Linux do this for example).

Bug: 15163
Change-Id: Icd8559bef2035f295aefbfc57ba6a342bfe76a41
Reviewed-on: https://code.wireshark.org/review/31645
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-21 13:29:41 +00:00
João Valverde a37388fbb6 CMake: Remove unnecessary check for CMAKE_INSTALL_RPATH
CMAKE_INSTALL_RPATH is set inside the if() block and not before.

Change-Id: Id8a863ca9bf5fed367de3fa7681a9a269d3f4f07
Reviewed-on: https://code.wireshark.org/review/31646
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-21 12:01:56 +00:00
Uli Heilmeier 03d67b8867 CMake: Fix LIBXML2 handling
Since commit a3991874eb cmake fails
when LIBXML2 is not found.
LIBXML2_INCLUDE_DIR is used but not set.

This commit sets LIBXML2_INCLUDE_DIR.

Change-Id: Ieb8b4accb5360d397b961fbd311ae349aac2c658
Reviewed-on: https://code.wireshark.org/review/31638
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2019-01-20 22:39:26 +00:00
Peter Wu 5dd86a0a7e CMake: do not set RPATH when installing to a system directory
When built with -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib
(as is done by many Linux distributions), do not set an unnecessary
RPATH. This was the case before v2.9.0rc0-2727-g697623411c.

Relocatable builds will still be possible with the default options as
/usr/local/lib is typically not considered a system library path.

Change-Id: Ic6ff1760183c20d3f9f9fb787604e888e116534e
Reviewed-on: https://code.wireshark.org/review/31602
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20 21:59:42 +00:00
João Valverde a3991874eb CMake: Replace PACKAGELIST magic
This is more explicit and easier to read with slightly better locality
while using less code.

Also less awkward when the package doesn't fit the narrow package list
expectations.

The ws_find_package() macro doesn't include all the status messages. The
choice was to rely on standard find_package() and feature_summary() output
and be less verbose.

Avoid polluting the CLI build interface. Per target include paths and
macro definitions are preferred.

Because this patch intentionally removes the global CMAKE_*_FLAGS
and include_directories() usage in favor of target properties, some
untested build configurations may inadvertently break because of
missing ${PACKAGE}_INCLUDE_DIRS or ${PACKAGE}_DEFINITIONS. This
required a manual review of dependencies that might have been
incomplete.

${PACKAGE_VAR}_LINK_FLAGS seems to be unused.

Changing the CMake Qt code to use more modern CMake component syntax
is left as future work.

Change-Id: I3ed75252189a6e05a23ed6e619088f519cd7ed78
Reviewed-on: https://code.wireshark.org/review/31496
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-20 11:50:10 +00:00
Peter Wu f3f97e976b CMake: set CMAKE_BUILD_RPATH_USE_ORIGIN
Tested with cmake v3.13.3-952-gf4c17c041, the resulting binaries indeed
contain $ORIGIN and are invariant of the build directory.

Change-Id: I5dad9493a6d54a0b03a3494fce69cc69a25b2f84
Ping-Bug: 15163
Reviewed-on: https://code.wireshark.org/review/31586
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-18 11:25:12 +00:00
Peter Wu 17cdfe9d77 CMake: silence CMP0083 warning from future CMake 3.14
The current development version of CMake started emitting warnings due
to the use of CMAKE_POSITION_INDEPENDENT_CODE without setting CMP0083.

Change-Id: Id6747c00fea7a1d28e5ba900ba4578fe89f40f83
Reviewed-on: https://code.wireshark.org/review/31579
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-17 22:28:14 +00:00
Gerald Combs 7fa8215feb Windows: Use a c-ares DLL built with vcpkg.
Update the Windows build environment to use c-ares packages built from
a VS 2017 command prompt with

    set CARES_VERSION=1.15.0
    vcpkg install c-ares:x86-windows c-ares:x64-windows
    vcpkg export c-ares:x86-windows --output=c-ares-%CARES_VERSION%-win32ws --zip
    vcpkg export c-ares:x64-windows --output=c-ares-%CARES_VERSION%-win64ws --zip

The packages also include a PDB, so  copy it to the build directory and
add it to the PDB .zip.

Change-Id: I1887ca89d897bea184144315219b366096519961
Reviewed-on: https://code.wireshark.org/review/31376
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-14 21:31:08 +00:00
Gerald Combs 290214adc9 tarball+RPM: Fetch our version from CMake.
Move git-export-release.sh to packaging/source. Have the source and RPM
packaging derive version information from CMake's VERSION variable. This
brings them in line with the rest of our packaging and avoids having to
read chicken entrails^W^Wgit output.

Make sure we always generate wireshark.spec.

Bug: 15359
Change-Id: I188efda489c94449a10a612abebf9c2872c305cb
Reviewed-on: https://code.wireshark.org/review/31504
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-14 17:41:43 +00:00
Dario Lombardo c3d198c401 dfilter: add string() function.
This function can convert non-string fields into strings. This allows the
user to apply string functions (like contains and matches) to non-string fields.

Examples:

string(frame.number) matches "[13579]$" => for odd frames
string(eth.dst) matches "aa\.bb\.cc\.dd\.ee\..." => to match a group of stations
string(snmp.name) matches "^1.2.3.4" => for all OIDs under a specific node

Change-Id: I18173f50ba5314ecdcd1e4b66c7e8ba5b44257ee
Reviewed-on: https://code.wireshark.org/review/31427
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-14 16:00:29 +00:00
Peter Wu 252938ed25 CMake: remove --clean from rpmbuild invocation
This allows for inspection of the build artifacts for a RPM build.
It is consistent with the deb-package target not executing --post-clean.

Change-Id: I63e3c571c893a104b5cfa98a0c67c8fdca03a964
Reviewed-on: https://code.wireshark.org/review/31538
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-14 15:21:45 +00:00
Peter Wu 4de0ea38cd CMake: change static qtui library into an object library
Save 800ms and avoids a synchronization point (improves build
parallelism) by directly adding object files to the wireshark binary.

Change-Id: I7d1484c65a26f3f6874474b61d38ba474aba8347
Reviewed-on: https://code.wireshark.org/review/31512
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12 18:20:52 +00:00
Peter Wu 5cc461490d CMake: use object libraries to avoid redundant builds
Some source files are duplicated via add_executable. Assuming that these
are not affected by target-specific preprocessor macros, they can be
built only once and shared among executables.

In one configuration, this reduces the number of object files by 55
(cli_main.c and version_info.c alone were built 15 times each).

Removes the version dependency from each target since the 'version_info'
target can now declare this dependency. Remove CLEAN_C_FILES from extcap
since it is not used to set -Werror. Due to removing some files from
wireshark_FILES (and others), these are no longer part of checkAPIs
though. Hopefully that is acceptable.

Change-Id: I0a3f1ffb950e70a6176c96d867f694fbc6476f58
Reviewed-on: https://code.wireshark.org/review/31509
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-12 18:20:44 +00:00
João Valverde 16953eca30 CMake: Remove legacy workaround for GTK+Zlib
Right now only the GTK+ 2.24.23 and GnuTLS 3.4.11 packages in trunk contain
include/zconf.h, these are used by master-2.6 but not current master.

Change-Id: If4e0407c83432fa0780e0ac8a2e15b92dbca8f17
Reviewed-on: https://code.wireshark.org/review/31505
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-01-12 12:03:14 +00:00
Peter Wu 3cc0cfc48c CMake: try harder to find the right Python version
The FindPythonInterp module does not verify that a discovered 'python'
program is actually Python 3. Replace this deprecated module by a modern
version that was introduced with CMake 3.12.

Remove PYTHON_EXECUTABLE from WSDG now that it is much more likely that
CMake discovers the right version.

Change-Id: I1f8438baced3d5bf9e1e2732980ad177d3257ca3
Reviewed-on: https://code.wireshark.org/review/31468
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-10 06:42:08 +00:00
Gerald Combs 1243976ccd Move make-version.pl to tools.
Move make-version.pl to the tools directory.

Change-Id: I7c3ec8951a682d45d650e3fdb1580d90bf19e8b4
Reviewed-on: https://code.wireshark.org/review/31473
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-10 05:18:29 +00:00
Peter Wu fd4d41fc32 CMake: remove LocatePythonExecutable.cmake for Windows
Cygwin is now unsupported, so remove special handling for it and rely on
FindPythonInterp.cmake to locate an appropriate version.

This patch can only cause issues if the PATH environment variable
contains the Cygwin binary directory without any native Python version
appearing before that. In that case, either remove Cygwin from PATH or
add the native Python (e.g. C:\Python37) earlier in PATH.

Change-Id: Ia5554e5a83d06a941dacf4a28d41d84fca4fe99d
Reviewed-on: https://code.wireshark.org/review/31453
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-09 04:22:27 +00:00
Peter Wu aac30ba2d1 CMake,WSDG: Remove Cygwin support
Declare Cygwin as unsupported and remove all supporting code. Simplify
some Chocolatey notes in the WSDG.

Remove FindPerl.cmake as it only existed to force use of Wireshark's
bundled FindCygwin.cmake (bug 13922). FindXSLTPROC.cmake special
handling for Cygwin was also removed, in theory this could cause issues
when the PATH contains a Cygwin xsltproc, but it's unsupported anyway.

Change-Id: Iabfac2b4a9fd930530505d27bdba618bdb8f7f34
Reviewed-on: https://code.wireshark.org/review/31452
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-09 04:21:50 +00:00
Peter Wu 2e411dba93 test: allow running pytest without specifying the tests directory
This allows `pytest` to be executed from the top-level source or build
directory (or any other directory below).

Change-Id: Ib7af2ea2aaf01319d6839d2dc67228fbb5a7bc34
Reviewed-on: https://code.wireshark.org/review/31370
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-05 06:46:54 +00:00
Peter Wu ac58eafa32 Add support for RSA decryption using PKCS #11 tokens
Add support for loading RSA private key files from PKCS #11 tokens,
identified by PKCS #11 URIs. Add a new 'pkcs11_libs' UAT which can
dynamically load PKCS #11 provider libraries that are not found by
p11-kit.

The configuration GUI will need additional code to discover available
PKCS #11 tokens and will be added later.

This feature requires GnuTLS 3.4 with PKCS #11 support, so Windows,
macOS via Homebrew, Ubuntu 16.04, Debian Stretch. Not supported: RHEL7.
Currently macOS via official packages disables PKCS #11 support, so that
will also not work.

Change-Id: I20646bfd69c6bd13c8c2d27cb65c164a4b0b7a66
Reviewed-on: https://code.wireshark.org/review/30855
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-29 10:40:16 +00:00
Dario Lombardo 5444b41530 test: add suite_outputformats for json output regression testing.
This suite uses different output formats to check against fixed
samples.

Change-Id: I8adccfefea35a6d3cfacf3da61e8a72d830ed3a0
Reviewed-on: https://code.wireshark.org/review/31056
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-12-26 19:32:47 +00:00
Atli Guðmundsson a051c12f2c Added a generic dissector validator and some ASTERIX unit tests that use it.
This patch extends the test suite with:
* a way for tests to check if a given byte sequence dissects into an expected dissection result.

Unit tests included:
* ASTERIX I019
* ASTERIX I063
* ASTERIX I065

Change-Id: Ib168382ec15b0b610ff5913806120ba1bf1d1503
Reviewed-on: https://code.wireshark.org/review/31083
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-26 16:52:40 +00:00
Gerald Combs 25e1e2c848 CMake: Don't bundle our libraries at compile time.
Setting LIBRARY_OUTPUT_DIRECTORY to Wireshark.app/Contents/Frameworks
for each of our libraries ends up installing a fully versioned .dylib
along with soversion and unversioned symlinks, which is more than we
want and which wastes disk space when osx-app.sh dsymifies our
libraries.

Leave LIBRARY_OUTPUT_DIRECTORY unset and depend on osx-app.sh to copy
our libraries into place.

Bug: 15361
Change-Id: If0fbaa796b4be806e2aa13887e511a330fe55df5
Reviewed-on: https://code.wireshark.org/review/31139
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-20 20:34:39 +00:00
Joakim Karlsson f01a9d9fe8 CMake: make use of sdjournal build flag
With this change CMake will not build sdjournal when
feature turned off

Change-Id: I896c8286b95abdf7ec668c4ab6c8dfacc930be03
Reviewed-on: https://code.wireshark.org/review/31086
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-19 18:31:19 +00:00
Gerald Combs dca4c992fc CMake: More VERSION_GREATER_EQUAL fixes.
Change-Id: Id6cc4f05f564383b2844aa00ebd21d204e4320db
Reviewed-on: https://code.wireshark.org/review/31063
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-16 17:36:54 +00:00
Gerald Combs 985fd11798 CMake: VERSION_GREATER_EQUAL didn't appear until 3.7.
Change-Id: Ib650129bfc4d686f49e8f2cf58f4978ef98dc5c0
Reviewed-on: https://code.wireshark.org/review/31059
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-16 09:34:51 +00:00
Gerald Combs 22bd32bde6 CMake: Fixup some logic in CMakeLists.txt
Fix the check for !APPLE && CMAKE_OSX_DEPLOYMENT_TARGET.

Change-Id: Ib6b33935062a03e2f53180431de2c0a3c8005fe5
Reviewed-on: https://code.wireshark.org/review/31058
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-16 00:40:08 +00:00
Gerald Combs e13d8be962 CMake: Make sure we use the same minimum macOS version everywhere.
Add a MIN_MACOS_VERSION variable. Update it and sanity check it
according to CMAKE_OSX_DEPLOYMENT_TARGET and our Qt version. Use it to
set our minimum macOS version in various places.

Change-Id: Icaf0dbe463f34d182986868021e2b56d2239da38
Reviewed-on: https://code.wireshark.org/review/31048
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-15 07:38:08 +00:00
Guy Harris a34cc98b2a Put the main() and wmain() routines for CLI programs into a separate file.
That means that code is only in one place, rather than having copies of
it in each of those programs.

CLI programs that, on Windows, should get UTF-8 arguments rather than
arguments in the local code page should:

	include the top-level cli_main.h header;

	define the main function as real_main();

	be built with the top-level cli_main.c file.

On UN*X, cli_main.c has a main() program, and just passes the arguments
on to real_main().

On Windows, cli_main.c has a wmain() function that converts the UTF-16
arguments it's handed to UTF-8 arguments, using WideCharToMultiByte() so
that it doesn't use any functions other than those provided by the
system, and then calls real_main() with the argument count and UTF-8
arguments.

Change-Id: I8b11f01dbc5c63fce599d1bef9ad96cd92c3c01e
Reviewed-on: https://code.wireshark.org/review/31017
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-13 00:52:11 +00:00
Gerald Combs 17b721e451 2.9.0 → 2.9.1.
Change-Id: I5c1a26f234289edeb9e29f5b8a8bdd220bd49ecf
Reviewed-on: https://code.wireshark.org/review/31028
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-13 00:40:18 +00:00
Gerald Combs 4d6509854c Packaging: Add initial support for AppImage.
Add an "appimage" target that will create an AppImage package. Current
AppImage tools assume that you only have one executable, so add
a custom AppRun wrapper that will let you run our associated CLI
utilities via symlinks, e.g.

    ln -s ./Wireshark-3.2.1-x86.appimage capinfos
    ./capinfos --help

Packaging requires both linuxdeployqt and appimagetool, although we
might be able to reduce this to just linuxdeployqt:

    https://github.com/probonopd/linuxdeployqt
    https://github.com/AppImage/AppImageKit

I haven't done much testing beyond running Wireshark and
capinfos. There are undoubtedly issues that need to be fixed.

Bug: 14464
Change-Id: Ic004ba1962e6a8630ebb017349d9b2c0462fd5fe
Reviewed-on: https://code.wireshark.org/review/30953
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-12 21:02:44 +00:00
Peter Wu 39ec5f8ec2 CMake: allow nested structures to be initialized via { 0 }
This is already permitted since C89 and popular compilers seem to
support it (including Clang 3.0 - 7.0, GCC 4.1.2 - 8.2 and MSVC 2015).
GCC used to be buggy: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

C89 6.5.7. Initialization: "only enough initializers from the list are
taken to account for the members of the subaggregate".

Change-Id: Ic59b9fe71e2d3ce60b4b7d1074f8d84af01a817a
Reviewed-on: https://code.wireshark.org/review/30968
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-09 07:13:16 +00:00
Peter Wu f7def1d07f Revert "CMake: Fix Windows help install target"
This reverts commit 8992760c68.

Breaks the "make clean" target as it tries to remove the "help"
directory. Since this change, the macOS builds started failing tests as
well (init.lua and colorfilters seems not to be applied).

Change-Id: I3fce346e04875e667680a4ed9ba3beca8054a168
Reviewed-on: https://code.wireshark.org/review/30950
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-07 02:01:40 +00:00
Peter Wu ceef87c550 CMake: limit -Wextra-semi to C++ only
Saves a check and removes a GCC warning from CMakeError.log:

    cc1: warning: command line option ‘-Wextra-semi’ is valid for C++/ObjC++ but not for C

Change-Id: I76d027e7b5703b06237ac70eb340c4a09322e09e
Fixes: v2.9.0rc0-958-g866ddb1b18 ("Add -Wextra-semi to (clang) C and C++ flags to make sure the buildbots will find this.")
Reviewed-on: https://code.wireshark.org/review/30948
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-12-06 23:22:52 +00:00
João Valverde 697623411c CMake: Use $ORIGIN with RPATH
Make our package relocatable on Unix systems.

Linux, Solaris and FreeBSD are known to support $ORIGIN.

Change-Id: Ibcdda33d62c075bfa867d006cb6aaf5824609011
Reviewed-on: https://code.wireshark.org/review/30896
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-03 23:54:15 +00:00
João Valverde c3741a653b CMake: Simplify CMAKE_INSTALL_DATADIR usage
Change-Id: I414aa551b8e9315a654f4da62b882e787d4f6d53
Reviewed-on: https://code.wireshark.org/review/30904
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-03 22:35:37 +00:00
João Valverde 8992760c68 CMake: Fix Windows help install target
We can't install from DATAFILE_DIR on this platform, we
must use CMAKE_BINARY_DIR.

Do that and try to keep this thing intact.

Ping-Bug: 15301
Change-Id: I5c0b787f8b1a148dda52f26242ab681e3c3a0d44
Reviewed-on: https://code.wireshark.org/review/30879
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
2018-12-02 22:00:38 +00:00
Pascal Quantin 4adaeee0eb Win32: update the zlib 1.2.11 CMake file
- get rid of the CMP0048 deprecation warning
- fix the absolute install path (João Valverde)

Change-Id: If2353987483b17b38a43a2400b97f1446c312e28
Reviewed-on: https://code.wireshark.org/review/30886
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-12-02 16:12:57 +00:00
João Valverde 0ceead5335 CMake: Avoid link_directories()
Change-Id: Ia5fbf638dfef9150978f74c6dd4d54e207483a5c
Reviewed-on: https://code.wireshark.org/review/30852
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-12-01 03:11:05 +00:00