mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Allow building auxilliary projects along with Bro.
BinPAC, Broccoli, Broctl, and Bro auxilliary tools are included as git submodules.
This commit is contained in:
parent
0221c121fc
commit
7737572aab
11 changed files with 93 additions and 75 deletions
18
.gitmodules
vendored
18
.gitmodules
vendored
|
@ -1,6 +1,12 @@
|
|||
[submodule "aux"]
|
||||
path = aux
|
||||
url = ssh://bro@git.icir.org/bro-aux
|
||||
[submodule "binpac"]
|
||||
path = binpac
|
||||
url = ssh://bro@git.icir.org/binpac
|
||||
[submodule "aux/bro-aux"]
|
||||
path = aux/bro-aux
|
||||
url = git://git.icir.org/bro-aux
|
||||
[submodule "aux/binpac"]
|
||||
path = aux/binpac
|
||||
url = git://git.icir.org/binpac
|
||||
[submodule "aux/broccoli"]
|
||||
path = aux/broccoli
|
||||
url = git://git.icir.org/broccoli
|
||||
[submodule "aux/broctl"]
|
||||
path = aux/broctl
|
||||
url = git://git.icir.org/broctl
|
||||
|
|
|
@ -17,6 +17,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
|||
|
||||
project(Bro)
|
||||
|
||||
set(BRO_ROOT_DIR ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
file(STRINGS "${CMAKE_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1)
|
||||
|
||||
if (ENABLE_DEBUG AND ENABLE_RELEASE)
|
||||
|
@ -57,6 +59,10 @@ find_package(BISON REQUIRED)
|
|||
find_package(PCAP REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(BIND REQUIRED)
|
||||
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/aux/binpac/CMakeLists.txt)
|
||||
add_subdirectory(aux/binpac)
|
||||
endif ()
|
||||
find_package(BinPAC REQUIRED)
|
||||
|
||||
include_directories(BEFORE
|
||||
|
@ -130,8 +136,34 @@ add_subdirectory(policy)
|
|||
#add_subdirectory(scripts)
|
||||
#add_subdirectory(doc)
|
||||
|
||||
if (INSTALL_AUXTOOLS)
|
||||
add_subdirectory(aux)
|
||||
if (INSTALL_BROCCOLI)
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/aux/broccoli/CMakeLists.txt)
|
||||
add_subdirectory(aux/broccoli)
|
||||
else ()
|
||||
message(FATAL_ERROR "Broccoli selected for installation, "
|
||||
"but the source code does not exist in "
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/aux/broccoli")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (INSTALL_BROCTL)
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/aux/broctl/CMakeLists.txt)
|
||||
add_subdirectory(aux/broctl)
|
||||
else ()
|
||||
message(FATAL_ERROR "Broctl selected for installation, "
|
||||
"but the source code does not exist in "
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/aux/broctl")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (INSTALL_AUX_TOOLS)
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/aux/bro-aux/CMakeLists.txt)
|
||||
add_subdirectory(aux/bro-aux)
|
||||
else ()
|
||||
message(FATAL_ERROR "Bro auxilliary tools selected for installation, "
|
||||
"but the source code does not exist in "
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/aux/bro-aux")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
########################################################################
|
||||
|
@ -198,8 +230,8 @@ message(
|
|||
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BuildType}}"
|
||||
"\nCPP: ${CMAKE_CXX_COMPILER}"
|
||||
"\n"
|
||||
"\nBroccoli: ${use_broccoli}"
|
||||
"\nBroctl: ${use_broctl}"
|
||||
"\nBroccoli: ${INSTALL_BROCCOLI}"
|
||||
"\nBroctl: ${INSTALL_BROCTL}"
|
||||
"\nGeoIP: ${USE_GEOIP}"
|
||||
"\nlibz: ${HAVE_LIBZ}"
|
||||
"\nlibmagic: ${HAVE_LIBMAGIC}"
|
||||
|
|
1
aux
1
aux
|
@ -1 +0,0 @@
|
|||
Subproject commit 3aff865343ae3f152f6c9dc20a8015830e1b9412
|
1
aux/binpac
Submodule
1
aux/binpac
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 7ebfe11ce241560bc7450ebb71eb077cf1d80783
|
1
aux/bro-aux
Submodule
1
aux/bro-aux
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 34049cd5d9b150fa72c35772931f2fc9d754ee08
|
1
aux/broccoli
Submodule
1
aux/broccoli
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit bdec0ca0911e4f40afd747dfc95e47609428f6f4
|
1
aux/broctl
Submodule
1
aux/broctl
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 406d02505eb19400359a08c83b321a9ae1d4ad8c
|
1
binpac
1
binpac
|
@ -1 +0,0 @@
|
|||
Subproject commit 37f8d8b16be30b5011db2e74cc7d07b6e857d2ca
|
|
@ -10,10 +10,6 @@
|
|||
# BinPAC_ROOT_DIR Set this variable to the root installation of
|
||||
# BinPAC if the module has problems finding the
|
||||
# proper installation path.
|
||||
# BinPAC_PREFER_BUILD Set this to true if BinPAC should be built
|
||||
# from sources located in the root source
|
||||
# directory in subidrectory 'binpac'. The
|
||||
# module will not look for BinPAC elsewhere.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
|
@ -22,21 +18,6 @@
|
|||
# BinPAC_LIBRARY The libbinpac.a library
|
||||
# BinPAC_INCLUDE_DIR The binpac headers
|
||||
|
||||
if (BinPAC_PREFER_BUILD)
|
||||
# check if we can build BinPAC locally
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/binpac/CMakeLists.txt)
|
||||
if (NOT BinPAC_EXE)
|
||||
# Display only first time
|
||||
message(STATUS "Building local version of BinPAC")
|
||||
endif ()
|
||||
# BinPAC's CMake project must declare:
|
||||
# BinPAC_EXE, BinPAC_LIBRARY, BinPAC_INCLUDE_DIR
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/binpac)
|
||||
else ()
|
||||
message(WARNING "Option to build BinPAC from source selected, "
|
||||
"but no sources found in ${CMAKE_SOURCE_DIR}/binpac")
|
||||
endif ()
|
||||
else ()
|
||||
# look for BinPAC in standard locations or user-provided root
|
||||
find_path(BinPAC_ROOT_DIR
|
||||
NAMES include/binpac.h
|
||||
|
@ -56,7 +37,6 @@ else ()
|
|||
NAMES binpac.h
|
||||
HINTS ${BinPAC_ROOT_DIR}/include
|
||||
)
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(BinPAC DEFAULT_MSG
|
||||
|
|
47
configure
vendored
47
configure
vendored
|
@ -27,12 +27,11 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
|
|||
--enable-release compile with optimizations
|
||||
--enable-brov6 enable IPv6 processing
|
||||
--enable-perftools use Google's perftools
|
||||
--build-binpac build BinPAC from source located in
|
||||
'binpac' subdirectory
|
||||
--install-binpac if --build-binpac, this option adds
|
||||
BinPAC build files to the install target
|
||||
--install-auxtools build and install auxilliary tools located
|
||||
in 'aux' subdirectory
|
||||
--enable-broccoli build/install the Broccoli library
|
||||
--enable-broctl install Broctl configured in standalone mode
|
||||
--enable-cluster install Broctl configured for cluster operation
|
||||
--enable-auxtools build and install auxilliary tools located
|
||||
in 'aux/bro-aux' subdirectory
|
||||
|
||||
Required Packages in Non-Standard Locations:
|
||||
--with-openssl=PATH path to OpenSSL install root
|
||||
|
@ -71,16 +70,15 @@ append_cache_entry () {
|
|||
builddir=build
|
||||
CMakeCacheEntries=""
|
||||
append_cache_entry CMAKE_INSTALL_PREFIX PATH /usr/local/bro
|
||||
append_cache_entry BRO_ROOT_DIR PATH /usr/local/bro
|
||||
append_cache_entry PY_MOD_INSTALL_DIR PATH /usr/local/bro/lib/broctl
|
||||
append_cache_entry DATADIR STRING share/bro
|
||||
append_cache_entry ENABLE_DEBUG BOOL false
|
||||
append_cache_entry ENABLE_RELEASE BOOL false
|
||||
append_cache_entry BROv6 BOOL false
|
||||
append_cache_entry ENABLE_PERFTOOLS BOOL false
|
||||
|
||||
# these settings should be set depending on whether the submodule exists
|
||||
append_cache_entry BinPAC_PREFER_BUILD BOOL false
|
||||
append_cache_entry BinPAC_SKIP_INSTALL BOOL true
|
||||
append_cache_entry INSTALL_AUX_TOOLS BOOL false
|
||||
append_cache_entry BUILD_SHARED_LIBS BOOL true
|
||||
|
||||
# parse arguments
|
||||
while [ $# -ne 0 ]; do
|
||||
|
@ -99,6 +97,8 @@ while [ $# -ne 0 ]; do
|
|||
;;
|
||||
--prefix=*)
|
||||
append_cache_entry CMAKE_INSTALL_PREFIX PATH $optarg
|
||||
append_cache_entry BRO_ROOT_DIR PATH $optarg
|
||||
append_cache_entry PY_MOD_INSTALL_DIR PATH $optarg/lib/broctl
|
||||
;;
|
||||
--datadir=*)
|
||||
append_cache_entry DATADIR STRING $optarg
|
||||
|
@ -115,24 +115,19 @@ while [ $# -ne 0 ]; do
|
|||
--enable-perftools)
|
||||
append_cache_entry ENABLE_PERFTOOLS BOOL true
|
||||
;;
|
||||
--build-binpac)
|
||||
if [ -f $sourcedir/binpac/CMakeLists.txt ]; then
|
||||
append_cache_entry BinPAC_PREFER_BUILD BOOL true
|
||||
else
|
||||
echo "Error: BinPAC source not found in $sourcedir/binpac" >&2
|
||||
exit 1
|
||||
fi
|
||||
--enable-broccoli)
|
||||
append_cache_entry INSTALL_BROCCOLI BOOL true
|
||||
;;
|
||||
--install-binpac)
|
||||
append_cache_entry BinPAC_SKIP_INSTALL BOOL false
|
||||
--enable-broctl)
|
||||
append_cache_entry INSTALL_BROCTL BOOL true
|
||||
append_cache_entry STANDALONE BOOL true
|
||||
;;
|
||||
--install-auxtools)
|
||||
if [ -f $sourcedir/aux/CMakeLists.txt ]; then
|
||||
append_cache_entry INSTALL_AUX_TOOLS BOOL false
|
||||
else
|
||||
echo "Error: Bro-Aux source not found in $sourcedir/aux" >&2
|
||||
exit 1
|
||||
fi
|
||||
--enable-cluster)
|
||||
append_cache_entry INSTALL_BROCTL BOOL true
|
||||
append_cache_entry STANDALONE BOOL false
|
||||
;;
|
||||
--enable-auxtools)
|
||||
append_cache_entry INSTALL_AUX_TOOLS BOOL true
|
||||
;;
|
||||
--with-openssl=*)
|
||||
append_cache_entry OpenSSL_ROOT_DIR PATH $optarg
|
||||
|
|
|
@ -394,3 +394,6 @@ target_link_libraries(bro ${brolibs})
|
|||
|
||||
install(TARGETS bro DESTINATION bin)
|
||||
install(FILES ${INSTALL_BIF_OUTPUTS} DESTINATION ${DATADIR})
|
||||
|
||||
set(BRO_EXE bro
|
||||
CACHE STRING "Bro executable binary" FORCE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue