Commit graph

325 commits

Author SHA1 Message Date
Peter Cullen
d57679e3dd Support for configurable localversion
Adds a new --localversion option to configure.
The value of localversion becomes part of the Zeek version string.
Docker builds allow an environment variable (LOCALVERSION) to set
the localversion string.
2024-04-17 14:16:47 -07:00
Tim Wojtulewicz
eedd0fbe8c Make sure that vcpkg isn't preferred if pcap_root_dir is passed in 2024-04-11 15:25:49 -07:00
Christian Kreibich
250d913dda Remove vestigial Conan bit in CMakeLists.txt
This is no longer required since we switched Conan to vcpkg a while back.
2024-03-27 16:50:08 -07:00
Christian Kreibich
602b1f88fb When configuring Spicy, be prepated for zeek_lib or zeek_exe targets.
This avoids a configuration error where zeek_exe is not defined (i.e. when
building (only) as a library). It anticipates building both the executable and
the library, which we used to do when using Conan but currently don't.
2024-03-27 16:49:07 -07:00
Christian Kreibich
e1ba20a878 Fix a typo in CMakeLists.txt when building Zeek as a library
This caused an error at configuration time since zeek_lie isn't a thing.
2024-03-27 16:12:10 -07:00
Dominik Charousset
015fddd8a1 Update Broker submodule 2024-03-18 15:39:48 -07:00
Tim Wojtulewicz
a610b8488d Fix searching for libpcap installed by vcpkg 2024-02-02 14:52:16 -07:00
Tim Wojtulewicz
674816a01d Switch all of the conan configuration to vcpkg 2024-02-02 14:52:16 -07:00
Tim Wojtulewicz
9cabff1da6 Configure c-ares before libkqueue
On platforms without a native libkqueue, c-ares is using the existing
value for HAVE_KQUEUE that was set during the libkqueue setup. We don't
pass the libkqueue information down to the c-ares cmake run so it won't
have the paths or library when it builds.
2024-02-01 10:06:28 -07:00
Christian Kreibich
832ce9f9a1 Merge branch 'topic/christian/more-feature-tests'
* topic/christian/more-feature-tests:
  Default to setting ZEEK_HAVE_JAVASCRIPT=no in CMakeLists.txt
  Show --disable-javascript in `configure --help`
  Show AF_PACKET support status in cmake output, and sort features
  Add feature tests for AF_PACKET, GeoIP, and JavaScript to zeek-config
2024-01-19 10:26:23 -08:00
Benjamin Bannier
9aba561e44 Make sure Spicy symbols are available.
The Spicy/HILTI runtime libraries are modelled as object libraries and
linked into the `spicy` and `hilti` libraries. These libraries are then
linked into `zeek_objs` which is another object library linked into the
`zeek` executable (target `zeek_exe`). On some platforms this transitive
link of object libraries is broken with `--binary-package` which causes
creation of static archives, even with our minimum required CMake
version which already contains many fixes for object libraries.

With this patch we now explicitly linked the Spicy/HILTI runtime
libraries into `zeek_exe`.

Closes #3177.
2024-01-19 12:26:44 +01:00
Christian Kreibich
2947bcda56 Default to setting ZEEK_HAVE_JAVASCRIPT=no in CMakeLists.txt
This still overrides it as appropriate when building with JS support, but shows
"JavaScript: no" in the configure output also when using
--disable-javascript, where it previously showed no output.
2024-01-18 15:52:19 -08:00
Christian Kreibich
e8007f04d9 Show AF_PACKET support status in cmake output, and sort features 2024-01-18 15:52:19 -08:00
Christian Kreibich
8ae560e7c6 Add feature tests for AF_PACKET, GeoIP, and JavaScript to zeek-config 2024-01-18 15:52:15 -08:00
Tim Wojtulewicz
bbcc4b00fb Set -Werror / /WX via target_compile_options to force warnings as errors 2024-01-08 13:25:05 -07:00
Arne Welzel
e0cf206732 Merge remote-tracking branch 'origin/topic/neverlord/avoid-openssl-header-deps'
* origin/topic/neverlord/avoid-openssl-header-deps:
  Integrate review feedback
  Avoid OpenSSL header dependencies

Added NEWS during merge and removed never set OPENSSL_INCLUDE_DIR reference
in main CMakeLists.txt.
2023-11-22 10:35:27 +01:00
Benjamin Bannier
e624c7500e Enable ccache-backed Spicy JIT for users of developer scripts.
For CI and more general BTest execution we already enabled ccache
previously, but developers using a Spicy build out of the build
directory still needed to manually set up caching.

With this patch we enable it for such cases as well via
`zeek-path-dev.*sh`.
2023-10-02 13:57:56 +02:00
Arne Welzel
bdb085af5f CMakeLists: Set Python3_EXECUTABLE hint for spicy 2023-09-15 11:39:21 +02:00
Arne Welzel
09b7caf986 configure/CMakelists: Use Python_EXECUTABLE as hint for interpreter
The PYTHON_EXECUTABLE variable was only interpreted by our own FindPythonDev.
cmake's FindPython uses Python_EXECUTABLE instead.

Also, if --with-python is not used, prefer unversioned executables that
match the version requirement. Further, remove Python_ADDITIONAL_VERSIONS
that is interpreted by FindPythonInterp which we're not using anymore.

https://cmake.org/cmake/help/latest/module/FindPython.html#artifacts-specification
https://cmake.org/cmake/help/latest/module/FindPythonInterp.html

Closes #3275
2023-09-07 12:48:37 +02:00
Dominik Charousset
f60a208b8d Forward OpenSSL include path to plugins 2023-08-29 20:05:41 +02:00
Tim Wojtulewicz
4022573d48 Merge remote-tracking branch 'origin/topic/bbannier/issue-3177'
* origin/topic/bbannier/issue-3177:
  Explicitly link Zeek executable against Spicy libraries in binary packaging mode.
2023-08-09 09:08:47 -07:00
Benjamin Bannier
26a6bc7dfe Explicitly link Zeek executable against Spicy libraries in binary packaging mode.
Closes #3177.
2023-08-09 11:31:27 +02:00
Tim Wojtulewicz
67c8e5192a Change VERSION variable in CMake config to ZEEK_VERSION_FULL 2023-08-07 09:33:52 -07:00
Tim Wojtulewicz
c743be0c54 Remove usage of FindRequiredPackage 2023-08-07 09:33:52 -07:00
Tim Wojtulewicz
18c77ddc2c Fix cmake formatting issue 2023-07-19 09:16:08 -07:00
Tim Wojtulewicz
401bdc86dd Add compiler flag to disable unknown pragma warnings on Windows
Without this flag you get a warning from every use of Type.h since it
contains a '#pramga GCC' for disabling a deprecation warning.
2023-07-18 16:13:38 -07:00
Tim Wojtulewicz
8f79bea18e Merge remote-tracking branch 'origin/topic/robin/spicy-build-dir-for-dev'
* origin/topic/robin/spicy-build-dir-for-dev:
  Set `SPICY_BUILD_DIRECTORY` in `zeek-path-dev`.
2023-07-05 13:32:50 -07:00
Robin Sommer
a3e170093d
Set SPICY_BUILD_DIRECTORY in zeek-path-dev.
Having this set allows running Spicy tests from inside
`auxil/spicy/tests`.
2023-07-05 11:32:34 +02:00
Tim Wojtulewicz
d5e2531b2f Add /J flag on Windows to force unsigned char 2023-06-30 13:48:24 -07:00
Tim Wojtulewicz
25da02fe50 Move CMake template files to separate directory 2023-06-26 13:39:59 -07:00
Tim Wojtulewicz
62382e6cb9 Force -std=c++17 mode for plugin targets, remove use of RequireCXX17.cmake 2023-06-15 09:51:32 -07:00
Arne Welzel
2fddddbf51 Merge remote-tracking branch 'origin/topic/awelzel/3090-propagate-doctest-defines'
* origin/topic/awelzel/3090-propagate-doctest-defines:
  Options: Do not output full usage on --test error
  CMakeLists: Propagate DOCTEST defines to external plugins
2023-06-15 18:35:32 +02:00
Arne Welzel
07b869e645 CMakeLists: Propagate DOCTEST defines to external plugins
If Zeek has not been built with doctest enabled then it's not easy
to run a plugin's tests (and if they really wanted to they could
again undef the DOCTEST_CONFIG_DISABLE and provide their own doctest
main() implementation.

Relates to #3090
2023-06-15 13:56:32 +02:00
Arne Welzel
2c4b2306fa CMakeLists: Add rapidjson/include to zeek_dynamic_plugin_base
threading/formatters/JSON.h has a rapidjson include. Extend the
include directories of external plugins so they are setup to find
these in Zeek's install tree.

Relates to #3090
2023-06-15 12:23:20 +02:00
Benjamin Bannier
eb1c7eff6c Clarify subitem relationship in CMake configure summary. 2023-06-09 13:31:53 +02:00
Tim Wojtulewicz
ef2473564e Revert part of previous CMake debug type fix 2023-05-22 16:11:58 -07:00
Christian Kreibich
3a55cf3911 Fix CMAKE_BUILD_TYPE_LOWER definition-vs-use ordering problem
It needs to be defined by the time we create zeek-config, which happens before
its current definition. To avoid a redundant TOLOWER when we check for presence
of --enable-debug at the beginning, this also switches this to a case-unadjusted
comparison to "Debug", which we use elsewhere in the file too.
2023-05-19 17:08:10 -07:00
Robin Sommer
933bd017f1
Fix CMake ordering issue leaving configuration paths unset. 2023-05-18 10:38:29 +02:00
Arne Welzel
bc8b5f5830 Rename util-config.h to zeek-config-paths.h and install it
The util-config.h has never been installed previously. Skimming the history,
it was only meant for inclusion from util.cc, hence the name. Now that it's
included from some other headers, rename it to align with what it
contains and install it, too.
2023-05-17 15:01:57 +02:00
Robin Sommer
10477b38aa
Move Spicy submodule a layer up.
This moves `auxil/spicy/spicy` to `auxil/spicy`. It relocates the
pieces previously inside that intermediary directory. The main change
is that now tweak the compilation flags for Spicy through target
options.

This is on top of `topic/robin/spicy-plugin`.
2023-05-16 12:09:12 +02:00
Robin Sommer
57eb7b4d2a
Update comment. 2023-05-16 10:21:21 +02:00
Robin Sommer
0040111955
Integrate the Spicy plugin into Zeek proper.
This reflects the `spicy-plugin` code as of `d8c296b81cc2a11`.

In addition to moving the code into Zeek's source tree, this comes
with a couple small functional changes:

- `spicyz` no longer tries to infer if it's running from the build
  directory. Instead `ZEEK_SPICY_LIBRARY` can be set to a custom
  location. `zeek-set-path.sh` does that now.

- ZEEK_CONFIG can be set to change what `spicyz -z` print out. This is
  primarily for backwards compatibility.

Some further notes on specifics:

- We raise the minimum Spicy version to 1.8 (i.e., current `main`
  branch).

- Renamed the `compiler/` subdirectory to `spicyz` to avoid
  include-path conflicts with the Spicy headers.

- In `cmake/`, the corresponding PR brings a new/extended version of
  `FindZeek`, which Spicy analyzer packages need. We also now install
  some of the files that the Spicy plugin used to bring for testing,
  so that existing packages keep working.

- For now, this all remains backwards compatible with the current
  `zkg` analyzer templates so that they work with both external and
  integrated Spicy support. Later, once we don't need to support any
  external Spicy plugin versions anymore, we can clean up the
  templates as well.

- All the plugin's tests have moved into the standard test suite. They
  are skipped if configure with `--disable-spicy`.

This holds off on adapting the new code further to Zeek's coding
conventions, so that it remains easier to maintain it in parallel to
the (now legacy) external plugin. We'll make a pass over the
formatting for (presumable) Zeek 6.1.
2023-05-16 10:17:45 +02:00
Arne Welzel
8c0e7cd8bc Merge remote-tracking branch 'origin/topic/neverlord/version-header'
* origin/topic/neverlord/version-header:
  testing/zeek-version-link: Assume nm is there
  Drop dependency for zeek_dynamic_plugin_base
  Fixup ifdef check in Plugin.h
  Update cmake_minimum_required() in test plugins
  testing: Add zeek-version-link tests
  Clean up ZEEK_CONFIG_SKIP_VERSION_H issues

cmake-format during merge
2023-05-10 23:33:11 +02:00
Dominik Charousset
879f605407 Drop dependency for zeek_dynamic_plugin_base 2023-05-10 16:59:07 +02:00
Tim Wojtulewicz
84e3f414a7 Use the same rules as cmake submodule to reformat Zeek 2023-05-09 08:31:43 -07:00
Dominik Charousset
986834dce7 Clean up ZEEK_CONFIG_SKIP_VERSION_H issues 2023-05-08 18:05:56 +02:00
Arne Welzel
02b7439d44 Revert "Skip version.h by default for Zeek sources"
This reverts commit 8246baf25c.

Actually fails the include_plugins CI test and I had just
opened another related issue.
2023-05-05 21:05:17 +02:00
Dominik Charousset
8246baf25c Skip version.h by default for Zeek sources 2023-05-05 17:12:10 +02:00
Dominik Charousset
94ec8167b2
Integrate review feedback
Co-authored-by: Tim Wojtulewicz <timwoj@gmail.com>
2023-05-02 21:24:53 +02:00
Dominik Charousset
c2c34148ca Fix CMake option defaults on Windows 2023-05-02 20:43:33 +02:00