Commit Graph

1054 Commits

Author SHA1 Message Date
Dario Lombardo f35e7f874d ship the dfilter_macros file.
By providing such a file, we give the users a basic toolbox
of macros. At the moment 3 macros have been added, for private
mac addresses, as well al IP v4 and v6.

Change-Id: Icc33efce437adef00e268172c184c8b52167df23
Reviewed-on: https://code.wireshark.org/review/33449
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-06-05 17:04:22 +00:00
Gerald Combs dd4c987756 CMake+macOS: Use symlinks for our CLI utilities.
On macOS, <build directory>/run/wireshark is a wrapper script that execs
run/Wireshark.app/Contents/MacOS/Wireshark so that Launch Services will
activate our application properly. We don't need to worry about this for
our other executables. Make them symlinks so that we can run things like
`lldb run/tshark` with impunity.

Change-Id: I4e656d778040ece722f873b1a7f6e6e60d21e2a6
Reviewed-on: https://code.wireshark.org/review/33071
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-24 17:05:39 +00:00
Guy Harris 03af0ad709 Enable -Wpointer-sign if we're enabling additional compiler warnings.
Or, rather, *disable* it only if we're *not* enabling additional
compiler warnings.

Change-Id: I95c23385a365e0e24f932ea5c680b287b5f717e0
Reviewed-on: https://code.wireshark.org/review/33237
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-16 21:15:00 +00:00
João Valverde 4c5d2f5ccf CMake: Add libpcap imported library target
Change-Id: I5326b87784817fb353329e2d686fe0515c32f6cb
Reviewed-on: https://code.wireshark.org/review/33038
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: João Valverde <j@v6e.pt>
2019-05-03 21:56:45 +00:00
João Valverde 186f985793 CMake: Check for and use system SpeexDSP library
Change-Id: I8443379d23a2946dd21c12e5e0bd5464ab73ca25
Reviewed-on: https://code.wireshark.org/review/31857
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-05-02 21:12:01 +00:00
Gerald Combs cec5991f40 Windows: Modernize our WSAStartup usage.
Make sure we link each application that calls WSAStartup with ws2_32.lib.
Pass version 2.2 to WSAStartup. Wikipedia says it was introduced in 1996,
so we should be OK.

Ping-Bug: 15711
Change-Id: I431839e930e7c646669af7373789640b5180ec28
Reviewed-on: https://code.wireshark.org/review/33033
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-01 17:51:59 +00:00
Fabrice Fontaine 900b9f1379 CMake: add USE_STATIC option
USE_STATIC will:
 - always link statically with external libraries (such as glib2)
 - will not set rpath to avoid the following error:

CMake Error at cmake_install.cmake:50 (file):
  file RPATH_CHANGE could not write new RPATH:

    /usr/lib

  to the file:

    /home/fabrice/br-test-pkg/br-arm-full-static/target/usr/bin/tshark

  No valid ELF RPATH or RUNPATH entry exists in the file;

Change-Id: I242dc1a091cc211ee891568a2dee5080c9974fba
Ping-Bug: 15713
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Reviewed-on: https://code.wireshark.org/review/32945
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-23 23:19:40 +00:00
Dániel Bakai 9ce60b173b Add brotli decompression support for HTTP and HTTP2 dissectors.
Change-Id: I9c09f55673187f6fee723fcd72798fb6b9958b03
Reviewed-on: https://code.wireshark.org/review/32745
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-22 15:24:46 +00:00
Peter Wu 7950811438 CMake: fix Windows build when all binaries are disabled
CLEAN_C_FILES is empty if all BUILD_xxx options are disabled.

Bug: 15662
Change-Id: I133b4d00336eb17f7eaeb0d6517ed83c30180373
Reviewed-on: https://code.wireshark.org/review/32895
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-20 06:07:45 +00:00
Peter Wu 8fd2e102a5 CMake: silence -Wunsafe-loop-optimizations for GCC 7
Clang does not implement this option, so do not bother checking it
there. GCC 6 is fine, GCC 7 is broken and GCC 8 is fixed again.

Change-Id: I3bc9ff4e934e05b1b3ce7d4c4a41bf40d6e38655
Reviewed-on: https://code.wireshark.org/review/32904
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-20 06:06:24 +00:00
Peter Wu 8c26217548 CMake: bail out if minimum GLib version is not satisfied
Require glibconfig.h to be found and extract the version from this file,
this has been present since the original GLib commit and is still
present in the meson build system introduced with 2.53.4.

Bug: 15706
Change-Id: I2e938a339d48d6815ed7cc46462735b93418377f
Reviewed-on: https://code.wireshark.org/review/32894
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-04-19 17:29:11 +00:00
Gerald Combs ba40851b27 Windows: Use an lz4 DLL built with vcpkg.
Update the Windows build environment to use lz4 packages built from a
VS 2017 command prompt with

    set LZ4_VERSION=1.8.3
    vcpkg remove lz4:x86-windows lz4:x64-windows
    vcpkg install lz4:x86-windows lz4:x64-windows
    vcpkg export lz4:x86-windows --output=lz4-%LZ4_VERSION%-win32ws --zip
    vcpkg export lz4:x64-windows --output=lz4-%LZ4_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: Icea512405d2085e5b271fa4a3ba8c0fe318b8cb5
Reviewed-on: https://code.wireshark.org/review/32785
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-04-09 04:28:36 +00:00
Gerald Combs 7c5f59dcf7 CMake: Require pod2man and pod2html.
Require the POD package. Some platforms ship POD translators as a
separate package instead of shipping them with Perl.

Bug: 15513
Change-Id: Ie277f9296d06063581512bc4c2df1d3158117f2c
Reviewed-on: https://code.wireshark.org/review/32685
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-03 16:55:15 +00:00
Gerald Combs a6da14982b NSIS: Fix our extra installer location.
We know the native Windows library path early on in the configure
process. Use it to set the location of the Npcap and USBPcap installers
instead of trying to derive it from the GLib DLL path.

Change-Id: I02d48e115b374fb6080a7fe8017cba789254d5f1
Reviewed-on: https://code.wireshark.org/review/32475
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-03-18 23:47:38 +00:00
Gerald Combs acc96e5206 Windows: Start using a `vcpkg export` bundle.
Create a library bundle using `vcpkg export ... --zip` as described at
https://vcpkg.readthedocs.io/en/latest/users/integration/#export-command.

The bundle includes the following packages:

gettext     0.19-8
glib        2.52.3-13
libffi      3.1-4
libiconv    1.15-5
liblzma     5.2.4
libxml2     2.9.9-4
pcre        8.41-1
zlib        1.2.11-5

It also includes a CMake toolchain file which we might want to make use
of in the future.

This means we no longer compile Zlib locally. Update the CMake environment
accordingly and remove zlib from win-setup.ps1.

It includes PDBs, so add them to the PDB .zip.

Change-Id: I0a94904a86d836e990019dab62af506573be1f35
Reviewed-on: https://code.wireshark.org/review/31377
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-03-18 22:22:44 +00:00
Peter Wu ba1ef0ec3d Re-implement "Map" feature for Endpoints
This feature was removed in v2.5.1rc0-427-gf529ab5d0a, anticipating that
MaxMind would remove support for it in 2019. They have however changed
their mind and maintained latitude and longitude information.

They recommend displaying an accuracy radius, but the reported values
are 50, 100, 200 and 1000km. When implemented literally, a marker in
Ireland would cover the whole island plus mainland, so I have instead
opted to use a fixed radius of 1km at deeper zoom levels.

The old ipmap.html file was outdated and had broken tiles, I rewrote a
new one from scratch using the light-weight Leaflet library combined
with tiles from OpenStreetMap. This is more mobile-friendly and secure
(https, SRI). To improve handling of nearby or overlapping nodes,
clustering is used (individual nodes can still be inspected).

Browser compatibility results: IE8 is unusable, IE9 partially works
(tooltips sometimes disappear and the cluster radius control is gone),
IE11 works. Of course Firefox 65 and Chromium 72 have no issues.

The map popup description in the generated GeoJSON structure is now
split in several properties, allowing presentation to be handled by the
HTML page instead of the C code.

Bug: 14693
Change-Id: If2ec9c518f7723ac0ab27b6272463356875a0ff2
Reviewed-on: https://code.wireshark.org/review/31952
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-16 21:11:12 +00:00
Gerald Combs 23c9a1e036 Convert the FAQ to Asciidoctor and remove old help files.
Convert our self-generating FAQ to Asciidoctor via the following steps:

- `help/faq.py > /tmp/faq.html`.
- `pandoc -t asciidoc -o docbook/faq.adoc /tmp/faq.html`.
- Manually clean up the markup using a text editor.

Question and answer content was left intact. Removing or updating
obsolete content will have to be done in a separate change.

The Asciidoctor project uses the .adoc extension, so start using it here
as well.

The contents of the "help" directory appear to have been used for
offline support in help_url.c, but that functionality was removed in
2008 in 242e3b78bc. Its content is covered in the User's Guide and man
pages so remove it.

Change-Id: I9060eefe97cfc137f8b414077c30f814379b576a
Reviewed-on: https://code.wireshark.org/review/32014
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-14 23:11:15 +00:00
Gerald Combs 1c27d782ba CMake: Move the PLUGIN_PATH_ID definition.
Define PLUGIN_PATH_ID where we use it. ENABLE_APPLICATION_BUNDLE is
defined later on, so test for APPLE instead.

Change-Id: I16c3ac3dc0e483fbf89cb1a2cacb2afb416d656f
Reviewed-on: https://code.wireshark.org/review/32016
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-14 02:23:32 +00:00
Gerald Combs aedf6fe1c5 macOS: Fix our plugin path.
In CMake we only used PROJECT_RELEASE_VERSION to construct our plugin
path, so rename it to PLUGIN_PATH_ID. Use a dash to separate version
numbers on macOS in order to allow code signing and a period elsewhere.

In the C code we only used VERSION_RELEASE to construct our plugin path,
so rename it to PLUGIN_PATH_ID.

Change-Id: I02abc591d7857269e8d47b414b61df4b28a25f2d
Reviewed-on: https://code.wireshark.org/review/32013
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-13 23:55:10 +00:00
Peter Wu e4a6f87088 CMake: disable relocatable builds when dumpcap is being built
dumpcap with capabilities/setuid currently does not start due to missing
libwsutil when installed to a non-standard prefix such as /usr/local.

Bug: 15490
Change-Id: If7427ba9625d3702ab8aac2deeaf37b6d3fda2a0
Reviewed-on: https://code.wireshark.org/review/31995
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-02-13 11:18:30 +00:00
Guy Harris ce7619040f Indicate what changes to make if we remove the version component.
Change-Id: I32fff5c34cfdb15a8102d2657e3380cf66928f66
Reviewed-on: https://code.wireshark.org/review/32002
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-13 03:25:57 +00:00
Guy Harris aa1f314464 Fix directory containing compiled plugins in macOS.
They weren't getting put in the version-number subdirectory, so the
plugin loader wasn't finding them.

If that causes problems with codesign, then we need to either

	1) figure out how to make it work with codesign

or

	2) for macOS, not put plugins in a version-number subdirectory
	   ***AND*** change the plugin loading process not to look for
	   compiled in a version-number subdirectory.

Change-Id: I58d344b728d05369d35edef4e4e530f10034e930
Reviewed-on: https://code.wireshark.org/review/32000
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-13 03:05:11 +00:00
Gerald Combs 6fef7cdc84 MacOS: Bundle and packaging updates
Update the code signing portions of the packaging scripts to match newer
versions of macOS.

Change-Id: I5e03611d8db61416955e797edcadfcff1404cc38
Reviewed-on: https://code.wireshark.org/review/31996
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-02-12 21:04:19 +00:00
Peter Wu f54a625682 CMake: clear cache variables when a library has changed
On Windows, whenever win-setup.ps1 installs new libraries, the old
paths become invalid. As a workaround the user can remove CMakeCache.txt
completely or manually delete entries. Removing the whole file might
lose custom options and clearing individual entries is tedious. Let's
handle this automatically.

Some HAVE_xxx variables from check_function_exists calls in PCAP and
ZLIB, and one from check_symbol_exists in KERBEROS are not cleared.
Those special cases would require too much work, the user should
manually clear their cache in this case if needed.

Fixes my local build since CARES, KERBEROS and LibXml2 were updated.
Special care was necessary for LibXml2 as it will not set cache variable
LIBXML2_LIBRARY when LIBXML2_LIBRARIES is already set.

Change-Id: Ic793bdb67161504aadadf221bd7740a0ca31db63
Link: https://www.wireshark.org/lists/wireshark-dev/201902/msg00028.html
Reviewed-on: https://code.wireshark.org/review/31960
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-11 05:06:10 +00:00
Peter Wu 07910e841e RPM: respect options for disabling Qt, SpanDSP and BCG729
"%bcond_without" enables a feature by default. Be sure to explicitly
disable features to match the requested configuration.

Change-Id: I90687f35bcd953670e147be9e70af03aaeaef5dc
Ping-Bug: 14606
Reviewed-on: https://code.wireshark.org/review/31933
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-10 14:50:49 +00:00
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