mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
Merge remote-tracking branch 'origin/topic/neverlord/object-libraries'
* origin/topic/neverlord/object-libraries: Update CMake submodule Use object libraries for subdir libs and plugins
This commit is contained in:
commit
1afcb5c993
20 changed files with 27 additions and 73 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
|||
|
||||
3.1.0-dev.245 | 2019-11-04 16:57:11 -0800
|
||||
|
||||
* Use CMake object libraries for subdir libs and plugins (Dominik Charousset, Corelight)
|
||||
|
||||
3.1.0-dev.242 | 2019-11-04 09:58:53 -0800
|
||||
|
||||
* Fix error handling in decode_base64() (Jon Siwek, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
3.1.0-dev.242
|
||||
3.1.0-dev.245
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4565be72bdb2c39532a6e21e24a498b131517492
|
||||
Subproject commit e5b1940850d486e3989f6a55615140a16bd1b9d2
|
|
@ -1 +1 @@
|
|||
Subproject commit db52dc35d0a6a503caf7b8c5428cc84ef6fc204d
|
||||
Subproject commit 9d7bdd82dfabe9ca2522c43ef1dd22e1044882ee
|
|
@ -1 +1 @@
|
|||
Subproject commit 960b97bff2da42bca5ac64af7146ccba727432de
|
||||
Subproject commit 6c0d6c1d43e787c0110d5ad610281e5fb3f48725
|
|
@ -1 +1 @@
|
|||
Subproject commit b36db12038eb9d9b400f19308227854e3885835a
|
||||
Subproject commit 6ecf78b664653736eb74243f93baf6f2b6aa8747
|
|
@ -1 +1 @@
|
|||
Subproject commit 246ba470e5e653c64589bb1fb0c210a2617fac34
|
||||
Subproject commit 1bb662776b84420142ca746e3a7b0b486c2ad15d
|
2
cmake
2
cmake
|
@ -1 +1 @@
|
|||
Subproject commit e8ddcaeb5885970f3abdcd641120bbb803ddefb4
|
||||
Subproject commit d3e1884a876781dedac716d102e8a06e1cc54380
|
|
@ -13,10 +13,6 @@ set(bro_REGISTER_BIFS CACHE INTERNAL "BIFs for automatic registering" FORCE)
|
|||
set(bro_BASE_BIF_SCRIPTS CACHE INTERNAL "Zeek script stubs for BIFs in base distribution of Zeek" FORCE)
|
||||
set(bro_PLUGIN_BIF_SCRIPTS CACHE INTERNAL "Zeek script stubs for BIFs in Zeek plugins" FORCE)
|
||||
|
||||
# If TRUE, use CMake's object libraries for sub-directories instead of
|
||||
# static libraries. This requires CMake >= 2.8.8.
|
||||
set(bro_HAVE_OBJECT_LIBRARIES FALSE)
|
||||
|
||||
configure_file(version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
||||
configure_file(util-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/util-config.h)
|
||||
|
||||
|
@ -139,7 +135,9 @@ list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
|
|||
########################################################################
|
||||
|
||||
set(bro_SUBDIR_LIBS CACHE INTERNAL "subdir libraries" FORCE)
|
||||
set(bro_SUBDIR_DEPS CACHE INTERNAL "subdir dependencies" FORCE)
|
||||
set(bro_PLUGIN_LIBS CACHE INTERNAL "plugin libraries" FORCE)
|
||||
set(bro_PLUGIN_DEPS CACHE INTERNAL "plugin dependencies" FORCE)
|
||||
|
||||
add_subdirectory(analyzer)
|
||||
add_subdirectory(broker)
|
||||
|
@ -150,26 +148,6 @@ add_subdirectory(iosource)
|
|||
add_subdirectory(logging)
|
||||
add_subdirectory(probabilistic)
|
||||
|
||||
set(bro_SUBDIRS
|
||||
# Order is important here.
|
||||
${bro_PLUGIN_LIBS}
|
||||
${bro_SUBDIR_LIBS}
|
||||
)
|
||||
|
||||
if ( NOT bro_HAVE_OBJECT_LIBRARIES )
|
||||
foreach (_plugin ${bro_PLUGIN_LIBS})
|
||||
string(REGEX REPLACE "plugin-" "" _plugin "${_plugin}")
|
||||
string(REGEX REPLACE "-" "_" _plugin "${_plugin}")
|
||||
set(_decl "namespace plugin { namespace ${_plugin} { class Plugin; extern Plugin plugin; } };")
|
||||
set(_use "i += (size_t)(&(plugin::${_plugin}::plugin));")
|
||||
set(__BRO_DECL_PLUGINS "${__BRO_DECL_PLUGINS}${_decl}\n")
|
||||
set(__BRO_USE_PLUGINS "${__BRO_USE_PLUGINS}${_use}\n")
|
||||
endforeach()
|
||||
|
||||
configure_file(plugins.cc.in ${CMAKE_CURRENT_BINARY_DIR}/plugins.cc)
|
||||
set(PLUGIN_INIT ${CMAKE_CURRENT_BINARY_DIR}/plugins.cc)
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
## bro target
|
||||
|
||||
|
@ -344,20 +322,14 @@ set(bro_SRCS
|
|||
${FLEX_Scanner_INPUT}
|
||||
${BISON_Parser_INPUT}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/DebugCmdConstants.h
|
||||
${PLUGIN_INIT}
|
||||
${THIRD_PARTY_SRCS}
|
||||
${MAIN_SRCS}
|
||||
)
|
||||
|
||||
collect_headers(bro_HEADERS ${bro_SRCS})
|
||||
|
||||
if ( bro_HAVE_OBJECT_LIBRARIES )
|
||||
add_executable(zeek ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIRS})
|
||||
target_link_libraries(zeek ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
||||
else ()
|
||||
add_executable(zeek ${bro_SRCS} ${bro_HEADERS})
|
||||
target_link_libraries(zeek ${bro_SUBDIRS} ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
||||
endif ()
|
||||
add_executable(zeek ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIR_LIBS} ${bro_PLUGIN_LIBS})
|
||||
target_link_libraries(zeek ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
||||
|
||||
if ( NOT "${bro_LINKER_FLAGS}" STREQUAL "" )
|
||||
set_target_properties(zeek PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}")
|
||||
|
@ -396,12 +368,12 @@ add_dependencies(generate_outputs generate_outputs_stage2a generate_outputs_stag
|
|||
|
||||
# Build __load__.zeek files for standard *.bif.zeek.
|
||||
bro_bif_create_loader(bif_loader "${bro_BASE_BIF_SCRIPTS}")
|
||||
add_dependencies(bif_loader ${bro_SUBDIRS})
|
||||
add_dependencies(bif_loader ${bro_PLUGIN_DEPS} ${bro_SUBDIR_DEPS})
|
||||
add_dependencies(zeek bif_loader)
|
||||
|
||||
# Build __load__.zeek files for plugins/*.bif.zeek.
|
||||
bro_bif_create_loader(bif_loader_plugins "${bro_PLUGIN_BIF_SCRIPTS}")
|
||||
add_dependencies(bif_loader_plugins ${bro_SUBDIRS})
|
||||
add_dependencies(bif_loader_plugins ${bro_PLUGIN_DEPS} ${bro_SUBDIR_DEPS})
|
||||
add_dependencies(zeek bif_loader_plugins)
|
||||
|
||||
# Install *.bif.zeek.
|
||||
|
|
|
@ -17,6 +17,6 @@ set(analyzer_SRCS
|
|||
|
||||
bif_target(analyzer.bif)
|
||||
|
||||
bro_add_subdir_library(analyzer ${analyzer_SRCS} ${BIF_OUTPUT_CC})
|
||||
bro_add_subdir_library(analyzer ${analyzer_SRCS})
|
||||
add_dependencies(bro_analyzer generate_outputs)
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ bif_target(data.bif)
|
|||
bif_target(messaging.bif)
|
||||
bif_target(store.bif)
|
||||
|
||||
bro_add_subdir_library(brokercomm ${comm_SRCS} ${BIF_OUTPUT_CC})
|
||||
bro_add_subdir_library(brokercomm ${comm_SRCS})
|
||||
add_dependencies(bro_brokercomm generate_outputs)
|
||||
|
|
|
@ -20,5 +20,5 @@ set(file_analysis_SRCS
|
|||
|
||||
bif_target(file_analysis.bif)
|
||||
|
||||
bro_add_subdir_library(file_analysis ${file_analysis_SRCS} ${BIF_OUTPUT_CC})
|
||||
bro_add_subdir_library(file_analysis ${file_analysis_SRCS})
|
||||
add_dependencies(bro_file_analysis generate_outputs)
|
||||
|
|
|
@ -4,5 +4,5 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
|
|||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
zeek_plugin_begin(Zeek FileDataEvent)
|
||||
zeek_plugin_cc(DataEvent.cc Plugin.cc ../../Analyzer.cc)
|
||||
zeek_plugin_cc(DataEvent.cc Plugin.cc)
|
||||
zeek_plugin_end()
|
||||
|
|
|
@ -4,6 +4,6 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
|
|||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
zeek_plugin_begin(Zeek FileEntropy)
|
||||
zeek_plugin_cc(Entropy.cc Plugin.cc ../../Analyzer.cc)
|
||||
zeek_plugin_cc(Entropy.cc Plugin.cc)
|
||||
zeek_plugin_bif(events.bif)
|
||||
zeek_plugin_end()
|
||||
|
|
|
@ -4,7 +4,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
|
|||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
zeek_plugin_begin(Zeek FileExtract)
|
||||
zeek_plugin_cc(Extract.cc Plugin.cc ../../Analyzer.cc)
|
||||
zeek_plugin_cc(Extract.cc Plugin.cc)
|
||||
zeek_plugin_bif(events.bif)
|
||||
zeek_plugin_bif(functions.bif)
|
||||
zeek_plugin_end()
|
||||
|
|
|
@ -4,6 +4,6 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
|
|||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
zeek_plugin_begin(Zeek FileHash)
|
||||
zeek_plugin_cc(Hash.cc Plugin.cc ../../Analyzer.cc)
|
||||
zeek_plugin_cc(Hash.cc Plugin.cc)
|
||||
zeek_plugin_bif(events.bif)
|
||||
zeek_plugin_end()
|
||||
|
|
|
@ -5,7 +5,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
|
|||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
zeek_plugin_begin(Zeek Unified2)
|
||||
zeek_plugin_cc(Unified2.cc Plugin.cc ../../Analyzer.cc)
|
||||
zeek_plugin_cc(Unified2.cc Plugin.cc)
|
||||
zeek_plugin_bif(events.bif types.bif)
|
||||
zeek_plugin_pac(unified2.pac unified2-file.pac unified2-analyzer.pac)
|
||||
zeek_plugin_end()
|
||||
|
|
|
@ -18,6 +18,6 @@ set(input_SRCS
|
|||
|
||||
bif_target(input.bif)
|
||||
|
||||
bro_add_subdir_library(input ${input_SRCS} ${BIF_OUTPUT_CC})
|
||||
bro_add_subdir_library(input ${input_SRCS})
|
||||
add_dependencies(bro_input generate_outputs)
|
||||
|
||||
|
|
|
@ -20,6 +20,6 @@ set(logging_SRCS
|
|||
|
||||
bif_target(logging.bif)
|
||||
|
||||
bro_add_subdir_library(logging ${logging_SRCS} ${BIF_OUTPUT_CC})
|
||||
bro_add_subdir_library(logging ${logging_SRCS})
|
||||
add_dependencies(bro_logging generate_outputs)
|
||||
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
// A work-around the problem that for static libraries unused globals
|
||||
// aren't linked into the final binary. CMake automatically inserts
|
||||
// code here to reference the globals that initializes each of the
|
||||
// statically compiled plugins.
|
||||
//
|
||||
// Note: This won't be necessary anymore once we can assume CMake >2.8.8
|
||||
// as a required depencendy. If so, switch bro_HAVE_OBJECT_LIBRARIES
|
||||
// in src/CMakeLists.txt to TRUE and remove this.
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
${__BRO_DECL_PLUGINS}
|
||||
|
||||
size_t __make_sure_to_use_plugin_globals()
|
||||
{
|
||||
// This function is never actually called.
|
||||
|
||||
size_t i = 0;
|
||||
${__BRO_USE_PLUGINS}
|
||||
return i;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue