mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
bifcl: Port bifcl code from Bro
This commit is contained in:
parent
73e8f2c79d
commit
3a4f38a04b
6 changed files with 1446 additions and 0 deletions
71
tools/bifcl/CMakeLists.txt
Normal file
71
tools/bifcl/CMakeLists.txt
Normal file
|
@ -0,0 +1,71 @@
|
|||
project(BifCl C CXX)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
|
||||
|
||||
include(cmake/CommonCMakeConfig.cmake)
|
||||
|
||||
include(FindRequiredPackage)
|
||||
|
||||
FindRequiredPackage(BISON)
|
||||
FindRequiredPackage(FLEX)
|
||||
|
||||
if ( MISSING_PREREQS )
|
||||
foreach (prereq ${MISSING_PREREQ_DESCS})
|
||||
message(SEND_ERROR ${prereq})
|
||||
endforeach ()
|
||||
message(FATAL_ERROR "Configuration aborted due to missing prerequisites")
|
||||
endif ()
|
||||
|
||||
include_directories(BEFORE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set(BISON_FLAGS "--debug")
|
||||
|
||||
# BIF parser/scanner
|
||||
bison_target(BIFParser builtin-func.y
|
||||
${CMAKE_CURRENT_BINARY_DIR}/bif_parse.cc
|
||||
HEADER ${CMAKE_CURRENT_BINARY_DIR}/bif_parse.h
|
||||
#VERBOSE ${CMAKE_CURRENT_BINARY_DIR}/bif_parse.output
|
||||
COMPILE_FLAGS "${BISON_FLAGS}")
|
||||
flex_target(BIFScanner builtin-func.l ${CMAKE_CURRENT_BINARY_DIR}/bif_lex.cc)
|
||||
add_flex_bison_dependency(BIFScanner BIFParser)
|
||||
|
||||
set(bifcl_SRCS
|
||||
${BISON_BIFParser_INPUT}
|
||||
${FLEX_BIFScanner_INPUT}
|
||||
${BISON_BIFParser_OUTPUTS}
|
||||
${FLEX_BIFScanner_OUTPUTS}
|
||||
bif_arg.cc
|
||||
bif_arg.h
|
||||
module_util.cc
|
||||
module_util.h
|
||||
)
|
||||
|
||||
add_executable(bifcl ${bifcl_SRCS})
|
||||
|
||||
install(TARGETS bifcl DESTINATION bin)
|
||||
|
||||
if (CMAKE_BUILD_TYPE)
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType)
|
||||
endif ()
|
||||
|
||||
message(
|
||||
"\n====================| Bifcl Build Summary |====================="
|
||||
"\n"
|
||||
"\nBuild type: ${CMAKE_BUILD_TYPE}"
|
||||
"\nBuild dir: ${CMAKE_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)
|
Loading…
Add table
Add a link
Reference in a new issue