From 7bcf7af535a292b7f401eb661662230243c18bf9 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 17 May 2023 13:26:12 +0200 Subject: [PATCH 1/3] Ensure spicyz/config.h is installed --- src/spicy/spicyz/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spicy/spicyz/CMakeLists.txt b/src/spicy/spicyz/CMakeLists.txt index 54800a3db8..003564af21 100644 --- a/src/spicy/spicyz/CMakeLists.txt +++ b/src/spicy/spicyz/CMakeLists.txt @@ -1,6 +1,7 @@ # See the file "COPYING" in the main distribution directory for copyright. configure_file(config.h.in config.h) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/zeek/spicy/spicyz) add_executable(spicyz driver.cc glue-compiler.cc main.cc) target_compile_options(spicyz PRIVATE "-Wall") From bc8b5f5830b4a0f4dd096a3aa9b2e0b2ecc9cb71 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 17 May 2023 13:31:48 +0200 Subject: [PATCH 2/3] 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. --- CMakeLists.txt | 8 +++++++- src/CMakeLists.txt | 1 - src/spicy/manager.cc | 2 +- src/spicy/spicyz/config.h.in | 2 +- src/util.cc | 2 +- src/util-config.h.in => zeek-config-paths.h.in | 2 ++ 6 files changed, 12 insertions(+), 5 deletions(-) rename src/util-config.h.in => zeek-config-paths.h.in (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17037915bf..5b918db39b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1112,10 +1112,16 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-version.h) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeek-version.h DESTINATION include/zeek) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-config.h) -include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeek-config.h DESTINATION include/zeek) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-config-paths.h.in + ${CMAKE_CURRENT_BINARY_DIR}/zeek-config-paths.h) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeek-config-paths.h DESTINATION include/zeek) + +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "." "${CMAKE_CURRENT_BINARY_DIR}/zeek") if (BinPAC_ROOT_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2c04a778bf..6baf3fa3dc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,6 @@ execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink ".." string(REPLACE "\"" "\\\"" ZEEK_BUILD_INFO_ESCAPED "${ZEEK_BUILD_INFO}") string(REPLACE "\n" "\\n" ZEEK_BUILD_INFO_ESCAPED "${ZEEK_BUILD_INFO_ESCAPED}") configure_file(version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c) -configure_file(util-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/util-config.h) # This creates a custom command to transform a bison output file (inFile) into # outFile in order to avoid symbol conflicts: - replaces instances of 'yylex' in diff --git a/src/spicy/manager.cc b/src/spicy/manager.cc index a90b279cdc..76a8c949f6 100644 --- a/src/spicy/manager.cc +++ b/src/spicy/manager.cc @@ -31,7 +31,7 @@ #include "zeek/spicy/file-analyzer.h" #include "zeek/spicy/packet-analyzer.h" #include "zeek/spicy/protocol-analyzer.h" -#include "zeek/util-config.h" +#include "zeek/zeek-config-paths.h" using namespace zeek; using namespace zeek::spicy; diff --git a/src/spicy/spicyz/config.h.in b/src/spicy/spicyz/config.h.in index 7d9aad960e..a3bed47c21 100644 --- a/src/spicy/spicyz/config.h.in +++ b/src/spicy/spicyz/config.h.in @@ -6,7 +6,7 @@ #include -#include "zeek/util-config.h" +#include "zeek/zeek-config-paths.h" namespace zeek::spicy::configuration { diff --git a/src/util.cc b/src/util.cc index 1e4abcf222..cd9473244f 100644 --- a/src/util.cc +++ b/src/util.cc @@ -4,7 +4,7 @@ #include "zeek/zeek-config.h" -#include "util-config.h" +#include "zeek/zeek-config-paths.h" #ifdef HAVE_DARWIN #include diff --git a/src/util-config.h.in b/zeek-config-paths.h.in similarity index 96% rename from src/util-config.h.in rename to zeek-config-paths.h.in index 689ac2461e..a49c248840 100644 --- a/src/util-config.h.in +++ b/zeek-config-paths.h.in @@ -1,3 +1,5 @@ +#pragma once + #define ZEEK_SCRIPT_INSTALL_PATH "@ZEEK_SCRIPT_INSTALL_PATH@" #define BRO_PLUGIN_INSTALL_PATH "@ZEEK_PLUGIN_DIR@" #define ZEEK_PLUGIN_INSTALL_PATH "@ZEEK_PLUGIN_DIR@" From 60be98e09bc02251c9c435b0ba7c484ef893e5a6 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 17 May 2023 15:01:46 +0200 Subject: [PATCH 3/3] Add license header to zeek-config*.h and zeek-version.h --- zeek-config-paths.h.in | 2 ++ zeek-config.h.in | 2 ++ zeek-version.h.in | 2 ++ 3 files changed, 6 insertions(+) diff --git a/zeek-config-paths.h.in b/zeek-config-paths.h.in index a49c248840..be135e8b93 100644 --- a/zeek-config-paths.h.in +++ b/zeek-config-paths.h.in @@ -1,3 +1,5 @@ +// See the file "COPYING" in the main distribution directory for copyright. + #pragma once #define ZEEK_SCRIPT_INSTALL_PATH "@ZEEK_SCRIPT_INSTALL_PATH@" diff --git a/zeek-config.h.in b/zeek-config.h.in index e475098986..7f9fe60a0c 100644 --- a/zeek-config.h.in +++ b/zeek-config.h.in @@ -1,3 +1,5 @@ +// See the file "COPYING" in the main distribution directory for copyright. + #pragma once /* Old libpcap versions (< 0.6.1) need defining pcap_freecode and diff --git a/zeek-version.h.in b/zeek-version.h.in index 30b0c914ba..f09f9ce5a7 100644 --- a/zeek-version.h.in +++ b/zeek-version.h.in @@ -1,3 +1,5 @@ +// See the file "COPYING" in the main distribution directory for copyright. + #pragma once /* Version number of package */