From a2f4f2adc36cbc55877a9e12dc09f3aeeab09796 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Sun, 17 Aug 2025 21:01:06 -0700 Subject: [PATCH] gen-zam: Remove submodule, adapt CMake configuration for Zeek build --- .gitmodules | 3 --- CMakeLists.txt | 2 +- auxil/gen-zam | 1 - tools/gen-zam/CMakeLists.txt | 35 ++--------------------------------- tools/gen-zam/src/Gen-ZAM.cc | 2 +- tools/gen-zam/src/Gen-ZAM.h | 4 ++-- 6 files changed, 6 insertions(+), 41 deletions(-) delete mode 160000 auxil/gen-zam diff --git a/.gitmodules b/.gitmodules index 53b0f86697..dbf4e2590f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,9 +40,6 @@ [submodule "auxil/zeek-client"] path = auxil/zeek-client url = https://github.com/zeek/zeek-client -[submodule "auxil/gen-zam"] - path = auxil/gen-zam - url = https://github.com/zeek/gen-zam [submodule "auxil/c-ares"] path = auxil/c-ares url = https://github.com/c-ares/c-ares diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e146f1a2c..a4dc95c1df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -912,7 +912,7 @@ set(BIFCL_EXE_PATH "${CMAKE_BINARY_DIR}/tools/bifcl/bifcl${CMAKE_EXECUTABLE_SUFF set(_bifcl_exe_path "included") if (NOT GEN_ZAM_EXE_PATH) - add_subdirectory(auxil/gen-zam) + add_subdirectory(tools/gen-zam) endif () if (ENABLE_JEMALLOC) diff --git a/auxil/gen-zam b/auxil/gen-zam deleted file mode 160000 index 56a6db00b8..0000000000 --- a/auxil/gen-zam +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 56a6db00b887c79d26f303676677cb490d1c296d diff --git a/tools/gen-zam/CMakeLists.txt b/tools/gen-zam/CMakeLists.txt index cc5bc3a32e..29e848cc78 100644 --- a/tools/gen-zam/CMakeLists.txt +++ b/tools/gen-zam/CMakeLists.txt @@ -1,33 +1,2 @@ -cmake_minimum_required(VERSION 3.15 FATAL_ERROR) -project(Gen-ZAM C CXX) - -include(cmake/CommonCMakeConfig.cmake) - -include(RequireCXXStd) - -set(GEN_ZAM_SRCS src/Gen-ZAM.cc) -set(GEN_ZAM_HEADERS src/Gen-ZAM.h) -add_executable(gen-zam ${GEN_ZAM_SRCS} ${GEN_ZAM_HEADERS}) -install(TARGETS gen-zam DESTINATION bin) - -if (CMAKE_BUILD_TYPE) - string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType) -endif () - -message( - "\n===================| Gen-ZAM Build Summary |==================\n" - "\n" - "\nBuild type: ${CMAKE_BUILD_TYPE}" - "\nBuild dir: ${PROJECT_BINARY_DIR}" - "\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" - "\nDebug mode: ${ENABLE_DEBUG}" - "\n" - "\nCC: ${CMAKE_C_COMPILER}" - "\nCFLAGS: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BuildType}}" - "\nCXX: ${CMAKE_CXX_COMPILER}" - "\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}" - "\nCPP: ${CMAKE_CXX_COMPILER}" - "\n" - "\n================================================================\n") - -include(UserChangedWarning) +add_executable(gen-zam) +target_sources(gen-zam PRIVATE src/Gen-ZAM.cc) diff --git a/tools/gen-zam/src/Gen-ZAM.cc b/tools/gen-zam/src/Gen-ZAM.cc index 8b30441b50..dc07544c3d 100644 --- a/tools/gen-zam/src/Gen-ZAM.cc +++ b/tools/gen-zam/src/Gen-ZAM.cc @@ -136,7 +136,7 @@ ArgsManager::ArgsManager(const OCVec& oc_orig, ZAM_InstClass zc) { void ArgsManager::Differentiate() { // First, figure out which parameter names are used how often. - map name_count; // how often the name apepars + map name_count; // how often the name appears map usage_count; // how often the name's been used so far for ( auto& arg : args ) { auto& name = arg.param_name; diff --git a/tools/gen-zam/src/Gen-ZAM.h b/tools/gen-zam/src/Gen-ZAM.h index d5a8640503..a93eabfcd4 100644 --- a/tools/gen-zam/src/Gen-ZAM.h +++ b/tools/gen-zam/src/Gen-ZAM.h @@ -367,7 +367,7 @@ protected: // An "assignment-less" operation is one that, if its result // is used in a dead assignment, should be converted to a different - // operation that explictly omits any assignment. + // operation that explicitly omits any assignment. bool HasAssignmentLess() const { return ! assignment_less_op.empty(); } void SetAssignmentLess(string op, string op_class) { assignment_less_op = std::move(op); @@ -515,7 +515,7 @@ protected: IndentDown(); } - // Start/finish emiting a (likely multi-line) string literal - + // Start/finish emitting a (likely multi-line) string literal - // see corresponding ZAMGen methods. void StartString(); void EndString();