Merge tag 'upstream/0.63' into debian
Upstream version 0.63
Hilko Bengen
5 years ago
0 | ||
1 | 0.63 | 2018-08-22 11:55:29 -0500 | |
2 | ||
3 | * Release v0.63. | |
4 | ||
5 | 0.62-11 | 2018-08-06 16:01:03 -0500 | |
6 | ||
7 | * Fix deprecation warning for swig_add_module (Jon Siwek, Corelight) | |
8 | ||
9 | 0.62-5 | 2018-05-15 15:38:58 +0000 | |
10 | ||
11 | * Updating submodule. | |
0 | 12 | |
1 | 13 | 0.62 | 2017-05-26 08:27:17 -0500 |
2 | 14 |
34 | 34 | |
35 | 35 | include(UseSWIG) |
36 | 36 | |
37 | swig_add_module(broccoli_intern python broccoli_intern.i) | |
37 | if ( CMAKE_VERSION VERSION_LESS 3.8.0 ) | |
38 | swig_add_module(broccoli_intern python broccoli_intern.i) | |
39 | else () | |
40 | swig_add_library(broccoli_intern | |
41 | LANGUAGE python | |
42 | SOURCES broccoli_intern.i) | |
43 | endif () | |
44 | ||
38 | 45 | swig_link_libraries(broccoli_intern ${Broccoli_LIBRARY} ${PYTHON_LIBRARIES}) |
39 | 46 | set_source_files_properties(${swig_generated_file_fullname} PROPERTIES |
40 | 47 | COMPILE_FLAGS -fno-strict-aliasing) |
0 | 0 | Metadata-Version: 1.0 |
1 | 1 | Name: broccoli-python |
2 | Version: 0.62 | |
2 | Version: 0.63 | |
3 | 3 | Summary: UNKNOWN |
4 | 4 | Home-page: UNKNOWN |
5 | 5 | Author: UNKNOWN |
0 | 0 | .. -*- mode: rst-mode -*- |
1 | 1 | .. |
2 | 2 | .. Version number is filled in automatically. |
3 | .. |version| replace:: 0.62 | |
3 | .. |version| replace:: 0.63 | |
4 | 4 | |
5 | 5 | ============================ |
6 | 6 | Python Bindings for Broccoli |
88 | 88 | endif () |
89 | 89 | |
90 | 90 | if ( BRO_PLUGIN_INTERNAL_BUILD ) |
91 | set(bifclDep "bifcl") | |
91 | if ( BIFCL_EXE_PATH ) | |
92 | set(BifCl_EXE ${BIFCL_EXE_PATH}) | |
93 | else () | |
94 | set(BifCl_EXE "bifcl") | |
95 | endif () | |
96 | else () | |
97 | if ( NOT BifCl_EXE ) | |
98 | if ( BRO_PLUGIN_BRO_BUILD ) | |
99 | set(BifCl_EXE "${BRO_PLUGIN_BRO_BUILD}/aux/bifcl/bifcl") | |
100 | else () | |
101 | find_program(BifCl_EXE bifcl) | |
102 | ||
103 | if ( NOT BifCl_EXE ) | |
104 | message(FATAL_ERROR "Failed to find 'bifcl' program") | |
105 | endif () | |
106 | endif () | |
107 | endif () | |
92 | 108 | endif () |
93 | 109 | |
94 | if ( BRO_PLUGIN_INTERNAL_BUILD ) | |
95 | set(BifCl_EXE "bifcl") | |
96 | else () | |
97 | set(BifCl_EXE "${BRO_PLUGIN_BRO_BUILD}/src/bifcl") | |
98 | endif () | |
110 | set(bifclDep ${BifCl_EXE}) | |
99 | 111 | |
100 | 112 | add_custom_command(OUTPUT ${bifOutputs} ${BIF_OUTPUT_BRO} |
101 | 113 | COMMAND ${BifCl_EXE} |
9 | 9 | # bro_ALL_GENERATED_OUTPUTS. |
10 | 10 | macro(BINPAC_TARGET pacFile) |
11 | 11 | if ( BRO_PLUGIN_INTERNAL_BUILD ) |
12 | if ( BINPAC_EXE_PATH ) | |
13 | set(BinPAC_EXE ${BINPAC_EXE_PATH}) | |
14 | endif () | |
15 | ||
12 | 16 | set(binpacDep "${BinPAC_EXE}") |
13 | 17 | else () |
14 | set(BinPAC_EXE "${BRO_PLUGIN_BRO_BUILD}/aux/binpac/src/binpac") | |
15 | set(BinPAC_addl_args "-I;${BRO_PLUGIN_BRO_SRC}/src") | |
18 | if ( BRO_PLUGIN_BRO_BUILD ) | |
19 | set(BinPAC_EXE "${BRO_PLUGIN_BRO_BUILD}/aux/binpac/src/binpac") | |
20 | set(BinPAC_addl_args "-I;${BRO_PLUGIN_BRO_SRC}/src") | |
21 | else () | |
22 | find_package(BinPAC REQUIRED) | |
23 | set(BinPAC_addl_args "-I;${BRO_PLUGIN_BRO_CONFIG_INCLUDE_DIR}") | |
24 | endif () | |
16 | 25 | endif () |
17 | 26 | |
18 | 27 | get_filename_component(basename ${pacFile} NAME_WE) |
32 | 41 | set(BINPAC_OUTPUT_H ${CMAKE_CURRENT_BINARY_DIR}/${basename}_pac.h) |
33 | 42 | set(BINPAC_OUTPUT_CC ${CMAKE_CURRENT_BINARY_DIR}/${basename}_pac.cc) |
34 | 43 | set(pacOutputs ${BINPAC_OUTPUT_H} ${BINPAC_OUTPUT_CC}) |
44 | set_property(SOURCE ${BINPAC_OUTPUT_CC} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-tautological-compare") | |
35 | 45 | |
36 | 46 | set(target "pac-${CMAKE_CURRENT_BINARY_DIR}/${pacFile}") |
37 | 47 |
7 | 7 | ## included from its top-level CMake file. |
8 | 8 | |
9 | 9 | if ( NOT BRO_PLUGIN_INTERNAL_BUILD ) |
10 | include(${BRO_DIST}/cmake/CommonCMakeConfig.cmake) | |
11 | ||
12 | if ( NOT BRO_DIST ) | |
13 | message(FATAL_ERROR "BRO_DIST not set") | |
14 | endif () | |
15 | ||
16 | if ( NOT EXISTS "${BRO_DIST}/build/CMakeCache.txt" ) | |
17 | message(FATAL_ERROR "${BRO_DIST}/build/CMakeCache.txt; has Bro been built?") | |
18 | endif () | |
19 | ||
20 | load_cache("${BRO_DIST}/build" READ_WITH_PREFIX bro_cache_ | |
21 | CMAKE_INSTALL_PREFIX Bro_BINARY_DIR Bro_SOURCE_DIR ENABLE_DEBUG BRO_PLUGIN_INSTALL_PATH BRO_EXE_PATH CMAKE_CXX_FLAGS CMAKE_C_FLAGS) | |
10 | set(BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH "${BRO_PLUGIN_INSTALL_ROOT}" | |
11 | CACHE INTERNAL "" FORCE) | |
12 | ||
13 | if ( BRO_DIST ) | |
14 | include(${BRO_DIST}/cmake/CommonCMakeConfig.cmake) | |
15 | ||
16 | if ( NOT EXISTS "${BRO_DIST}/build/CMakeCache.txt" ) | |
17 | message(FATAL_ERROR | |
18 | "${BRO_DIST}/build/CMakeCache.txt; has Bro been built?") | |
19 | endif () | |
20 | ||
21 | load_cache("${BRO_DIST}/build" READ_WITH_PREFIX bro_cache_ | |
22 | CMAKE_INSTALL_PREFIX | |
23 | Bro_BINARY_DIR | |
24 | Bro_SOURCE_DIR | |
25 | ENABLE_DEBUG | |
26 | BRO_PLUGIN_INSTALL_PATH | |
27 | BRO_EXE_PATH | |
28 | CMAKE_CXX_FLAGS | |
29 | CMAKE_C_FLAGS | |
30 | CAF_INCLUDE_DIR_CORE | |
31 | CAF_INCLUDE_DIR_IO | |
32 | CAF_INCLUDE_DIR_OPENSSL) | |
33 | ||
34 | if ( NOT BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH ) | |
35 | set(BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH | |
36 | "${bro_cache_BRO_PLUGIN_INSTALL_PATH}" CACHE INTERNAL "" FORCE) | |
37 | endif () | |
38 | ||
39 | set(BRO_PLUGIN_BRO_INSTALL_PREFIX "${bro_cache_CMAKE_INSTALL_PREFIX}" | |
40 | CACHE INTERNAL "" FORCE) | |
41 | set(BRO_PLUGIN_ENABLE_DEBUG "${bro_cache_ENABLE_DEBUG}" | |
42 | CACHE INTERNAL "" FORCE) | |
43 | set(BRO_PLUGIN_BRO_SRC "${bro_cache_Bro_SOURCE_DIR}" | |
44 | CACHE INTERNAL "" FORCE) | |
45 | set(BRO_PLUGIN_BRO_BUILD "${bro_cache_Bro_BINARY_DIR}" | |
46 | CACHE INTERNAL "" FORCE) | |
47 | set(BRO_PLUGIN_BRO_EXE_PATH "${bro_cache_BRO_EXE_PATH}" | |
48 | CACHE INTERNAL "" FORCE) | |
49 | ||
50 | set(BRO_PLUGIN_BRO_CMAKE ${BRO_PLUGIN_BRO_SRC}/cmake) | |
51 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) | |
52 | set(CMAKE_MODULE_PATH ${BRO_PLUGIN_BRO_CMAKE} ${CMAKE_MODULE_PATH}) | |
53 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${bro_cache_CMAKE_C_FLAGS}") | |
54 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${bro_cache_CMAKE_CXX_FLAGS}") | |
55 | ||
56 | include_directories(BEFORE | |
57 | ${BRO_PLUGIN_BRO_SRC}/src | |
58 | ${BRO_PLUGIN_BRO_SRC}/aux/binpac/lib | |
59 | ${BRO_PLUGIN_BRO_SRC}/aux/broker | |
60 | ${BRO_PLUGIN_BRO_BUILD} | |
61 | ${BRO_PLUGIN_BRO_BUILD}/src | |
62 | ${BRO_PLUGIN_BRO_BUILD}/aux/binpac/lib | |
63 | ${BRO_PLUGIN_BRO_BUILD}/aux/broker | |
64 | ${bro_cache_CAF_INCLUDE_DIR_CORE} | |
65 | ${bro_cache_CAF_INCLUDE_DIR_IO} | |
66 | ${bro_cache_CAF_INCLUDE_DIR_OPENSSL} | |
67 | ${CMAKE_CURRENT_BINARY_DIR} | |
68 | ${CMAKE_CURRENT_BINARY_DIR}/src | |
69 | ${CMAKE_CURRENT_SOURCE_DIR} | |
70 | ${CMAKE_CURRENT_SOURCE_DIR}/src | |
71 | ) | |
72 | ||
73 | set(ENV{PATH} "${BRO_PLUGIN_BRO_BUILD}/build/src:$ENV{PATH}") | |
74 | ||
75 | else () | |
76 | # Independent from BRO_DIST source tree | |
77 | ||
78 | if ( NOT BRO_CONFIG_CMAKE_DIR ) | |
79 | message(FATAL_ERROR "CMake var. BRO_CONFIG_CMAKE_DIR must be set" | |
80 | " to the path where Bro installed its cmake modules") | |
81 | endif () | |
82 | ||
83 | include(${BRO_CONFIG_CMAKE_DIR}/CommonCMakeConfig.cmake) | |
84 | ||
85 | if ( NOT BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH ) | |
86 | if ( NOT BRO_CONFIG_PLUGIN_DIR ) | |
87 | message(FATAL_ERROR "CMake var. BRO_CONFIG_PLUGIN_DIR must be" | |
88 | " set to the path where Bro installs its plugins") | |
89 | endif () | |
90 | ||
91 | set(BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH | |
92 | "${BRO_CONFIG_PLUGIN_DIR}" CACHE INTERNAL "" FORCE) | |
93 | endif () | |
94 | ||
95 | if ( NOT BRO_CONFIG_PREFIX ) | |
96 | message(FATAL_ERROR "CMake var. BRO_CONFIG_PREFIX must be set" | |
97 | " to the root installation path of Bro") | |
98 | endif () | |
99 | ||
100 | if ( NOT BRO_CONFIG_INCLUDE_DIR ) | |
101 | message(FATAL_ERROR "CMake var. BRO_CONFIG_INCLUDE_DIR must be set" | |
102 | " to the installation path of Bro headers") | |
103 | endif () | |
104 | ||
105 | set(BRO_PLUGIN_BRO_CONFIG_INCLUDE_DIR "${BRO_CONFIG_INCLUDE_DIR}" | |
106 | CACHE INTERNAL "" FORCE) | |
107 | set(BRO_PLUGIN_BRO_INSTALL_PREFIX "${BRO_CONFIG_PREFIX}" | |
108 | CACHE INTERNAL "" FORCE) | |
109 | set(BRO_PLUGIN_BRO_EXE_PATH "${BRO_CONFIG_PREFIX}/bin/bro" | |
110 | CACHE INTERNAL "" FORCE) | |
111 | ||
112 | set(BRO_PLUGIN_BRO_CMAKE ${BRO_CONFIG_CMAKE_DIR}) | |
113 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) | |
114 | set(CMAKE_MODULE_PATH ${BRO_PLUGIN_BRO_CMAKE} ${CMAKE_MODULE_PATH}) | |
115 | ||
116 | find_package(BinPAC REQUIRED) | |
117 | find_package(CAF COMPONENTS core io openssl REQUIRED) | |
118 | find_package(Broker REQUIRED) | |
119 | ||
120 | include_directories(BEFORE | |
121 | ${BRO_CONFIG_INCLUDE_DIR} | |
122 | ${BinPAC_INCLUDE_DIR} | |
123 | ${BROKER_INCLUDE_DIR} | |
124 | ${CAF_INCLUDE_DIR_CORE} | |
125 | ${CAF_INCLUDE_DIR_IO} | |
126 | ${CAF_INCLUDE_DIR_OPENSSL} | |
127 | ${CMAKE_CURRENT_BINARY_DIR} | |
128 | ${CMAKE_CURRENT_BINARY_DIR}/src | |
129 | ${CMAKE_CURRENT_SOURCE_DIR} | |
130 | ${CMAKE_CURRENT_SOURCE_DIR}/src | |
131 | ) | |
132 | endif () | |
22 | 133 | |
23 | 134 | if ( NOT BRO_PLUGIN_BASE ) |
24 | 135 | set(BRO_PLUGIN_BASE "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "" FORCE) |
32 | 143 | set(BRO_PLUGIN_MAGIC "${BRO_PLUGIN_BUILD}/__bro_plugin__" CACHE INTERNAL "" FORCE) |
33 | 144 | set(BRO_PLUGIN_README "${BRO_PLUGIN_BASE}/README" CACHE INTERNAL "" FORCE) |
34 | 145 | |
35 | set(BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH "${BRO_PLUGIN_INSTALL_ROOT}" CACHE INTERNAL "" FORCE) | |
36 | ||
37 | if ( NOT BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH ) | |
38 | set(BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH "${bro_cache_BRO_PLUGIN_INSTALL_PATH}" CACHE INTERNAL "" FORCE) | |
39 | endif () | |
40 | ||
41 | set(BRO_PLUGIN_BRO_INSTALL_PREFIX "${bro_cache_CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE) | |
42 | set(BRO_PLUGIN_BRO_SRC "${bro_cache_Bro_SOURCE_DIR}" CACHE INTERNAL "" FORCE) | |
43 | set(BRO_PLUGIN_BRO_BUILD "${bro_cache_Bro_BINARY_DIR}" CACHE INTERNAL "" FORCE) | |
44 | set(BRO_PLUGIN_BRO_EXE_PATH "${bro_cache_BRO_EXE_PATH}" CACHE INTERNAL "" FORCE) | |
45 | set(BRO_PLUGIN_BRO_CXX_FLAGS "${bro_cache_CMAKE_CXX_FLAGS}" CACHE INTERNAL "" FORCE) | |
46 | set(BRO_PLUGIN_BRO_C_FLAGS "${bro_cache_CMAKE_C_FLAGS}" CACHE INTERNAL "" FORCE) | |
47 | ||
48 | set(BRO_PLUGIN_ENABLE_DEBUG "${bro_cache_ENABLE_DEBUG}" CACHE INTERNAL "" FORCE) | |
49 | 146 | set(BRO_PLUGIN_INTERNAL_BUILD false CACHE INTERNAL "" FORCE) |
50 | 147 | set(BRO_PLUGIN_BUILD_DYNAMIC true CACHE INTERNAL "" FORCE) |
51 | 148 | |
56 | 153 | message(STATUS "Bro plugin directory: ${BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH}") |
57 | 154 | message(STATUS "Bro debug mode : ${BRO_PLUGIN_ENABLE_DEBUG}") |
58 | 155 | |
59 | set(CMAKE_MODULE_PATH ${BRO_PLUGIN_BASE}/cmake ${CMAKE_MODULE_PATH}) | |
60 | set(CMAKE_MODULE_PATH ${BRO_PLUGIN_BRO_SRC}/cmake ${CMAKE_MODULE_PATH}) | |
61 | ||
62 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BRO_PLUGIN_BRO_C_FLAGS}") | |
63 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BRO_PLUGIN_BRO_CXX_FLAGS}") | |
64 | ||
65 | 156 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
66 | 157 | # By default Darwin's linker requires all symbols to be present at link time. |
67 | 158 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -undefined dynamic_lookup -Wl,-bind_at_load") |
68 | 159 | endif () |
69 | ||
70 | include_directories(BEFORE ${BRO_PLUGIN_BRO_SRC}/src | |
71 | ${BRO_PLUGIN_BRO_SRC}/aux/binpac/lib | |
72 | ${BRO_PLUGIN_BRO_BUILD} | |
73 | ${BRO_PLUGIN_BRO_BUILD}/src | |
74 | ${BRO_PLUGIN_BRO_BUILD}/aux/binpac/lib | |
75 | ${CMAKE_CURRENT_BINARY_DIR} | |
76 | ${CMAKE_CURRENT_BINARY_DIR}/src | |
77 | ${CMAKE_CURRENT_SOURCE_DIR} | |
78 | ${CMAKE_CURRENT_SOURCE_DIR}/src | |
79 | ) | |
80 | ||
81 | set(ENV{PATH} "${BRO_PLUGIN_BRO_BUILD}/build/src:$ENV{PATH}") | |
82 | 160 | |
83 | 161 | set(bro_PLUGIN_LIBS CACHE INTERNAL "plugin libraries" FORCE) |
84 | 162 | set(bro_PLUGIN_BIF_SCRIPTS CACHE INTERNAL "Bro script stubs for BIFs in Bro plugins" FORCE) |
137 | 215 | |
138 | 216 | target_link_libraries(${_plugin_lib} ${_plugin_libs}) |
139 | 217 | |
140 | # Copy bif/*.bro. | |
141 | string(REPLACE "${BRO_PLUGIN_BASE}/" "" msg "Creating ${BRO_PLUGIN_BIF} for ${_plugin_name}") | |
142 | add_custom_target(copy-bif-${_plugin_name_canon} | |
143 | COMMAND "${CMAKE_COMMAND}" -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/bif ${BRO_PLUGIN_BIF} | |
144 | COMMENT "${msg}") | |
145 | ||
146 | 218 | # Create bif/__init__.bro. |
147 | 219 | bro_bif_create_loader(bif-init-${_plugin_name_canon} "${bro_PLUGIN_BIF_SCRIPTS}") |
148 | 220 | |
159 | 231 | |
160 | 232 | if ( _plugin_deps ) |
161 | 233 | add_dependencies(bif-init-${_plugin_name_canon} ${_plugin_deps}) |
162 | add_dependencies(copy-bif-${_plugin_name_canon} ${_plugin_deps}) | |
163 | add_dependencies(bif-init-${_plugin_name_canon} copy-bif-${_plugin_name_canon}) | |
164 | add_dependencies(${_plugin_lib} bif-init-${_plugin_name_canon} copy-bif-${_plugin_name_canon}) | |
234 | add_dependencies(${_plugin_lib} bif-init-${_plugin_name_canon}) | |
165 | 235 | endif() |
166 | 236 | |
167 | 237 | # Create __bro_plugin__ |
183 | 253 | |
184 | 254 | # Create binary install package. |
185 | 255 | add_custom_command(OUTPUT ${_dist_output} |
186 | COMMAND ${BRO_PLUGIN_BRO_SRC}/cmake/bro-plugin-create-package.sh ${_plugin_name_canon} ${_plugin_dist} | |
256 | COMMAND ${BRO_PLUGIN_BRO_CMAKE}/bro-plugin-create-package.sh ${_plugin_name_canon} ${_plugin_dist} | |
187 | 257 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
188 | 258 | DEPENDS ${_plugin_lib} |
189 | 259 | COMMENT "Building binary plugin package: ${_dist_tarball_name}") |
199 | 269 | set(plugin_install "${BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH}/${_plugin_name_canon}") |
200 | 270 | |
201 | 271 | INSTALL(CODE "execute_process( |
202 | COMMAND ${BRO_PLUGIN_BRO_SRC}/cmake/bro-plugin-install-package.sh ${_plugin_name_canon} \$ENV{DESTDIR}/${BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH} | |
272 | COMMAND ${BRO_PLUGIN_BRO_CMAKE}/bro-plugin-install-package.sh ${_plugin_name_canon} \$ENV{DESTDIR}/${BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH} | |
203 | 273 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
204 | 274 | )") |
205 | 275 |
0 | Copyright (c) 1995-2017, The Regents of the University of California | |
1 | through the Lawrence Berkeley National Laboratory and the | |
2 | International Computer Science Institute. All rights reserved. | |
3 | ||
4 | Redistribution and use in source and binary forms, with or without | |
5 | modification, are permitted provided that the following conditions are met: | |
6 | ||
7 | (1) Redistributions of source code must retain the above copyright | |
8 | notice, this list of conditions and the following disclaimer. | |
9 | ||
10 | (2) Redistributions in binary form must reproduce the above copyright | |
11 | notice, this list of conditions and the following disclaimer in the | |
12 | documentation and/or other materials provided with the distribution. | |
13 | ||
14 | (3) Neither the name of the University of California, Lawrence Berkeley | |
15 | National Laboratory, U.S. Dept. of Energy, International Computer | |
16 | Science Institute, nor the names of contributors may be used to endorse | |
17 | or promote products derived from this software without specific prior | |
18 | written permission. | |
19 | ||
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
24 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
25 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
26 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
27 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
28 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
29 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
30 | POSSIBILITY OF SUCH DAMAGE. | |
31 | ||
32 | Note that some files in the distribution may carry their own copyright | |
33 | notices. |
19 | 19 | |
20 | 20 | # look for BinPAC in standard locations or user-provided root |
21 | 21 | find_path(BinPAC_ROOT_DIR |
22 | NAMES include/binpac.h | |
22 | NAMES include/binpac.h include/binpac/binpac.h | |
23 | 23 | ) |
24 | 24 | |
25 | 25 | find_file(BinPAC_EXE |
34 | 34 | |
35 | 35 | find_path(BinPAC_INCLUDE_DIR |
36 | 36 | NAMES binpac.h |
37 | HINTS ${BinPAC_ROOT_DIR}/include | |
37 | HINTS ${BinPAC_ROOT_DIR}/include ${BinPAC_ROOT_DIR}/include/binpac | |
38 | 38 | ) |
39 | 39 | |
40 | 40 | include(FindPackageHandleStandardArgs) |
0 | # - Try to find Broker library and headers | |
1 | # | |
2 | # Usage of this module as follows: | |
3 | # | |
4 | # find_package(Broker) | |
5 | # | |
6 | # Variables used by this module, they can change the default behaviour and need | |
7 | # to be set before calling find_package: | |
8 | # | |
9 | # BROKER_ROOT_DIR Set this variable to the root installation of | |
10 | # Broker if the module has problems finding the | |
11 | # proper installation path. | |
12 | # | |
13 | # Variables defined by this module: | |
14 | # | |
15 | # BROKER_FOUND System has Broker library | |
16 | # BROKER_LIBRARY The broker library | |
17 | # BROKER_INCLUDE_DIR The broker headers | |
18 | ||
19 | find_path(BROKER_ROOT_DIR | |
20 | NAMES include/broker/broker.hh | |
21 | ) | |
22 | ||
23 | find_library(BROKER_LIBRARY | |
24 | NAMES broker | |
25 | HINTS ${BROKER_ROOT_DIR}/lib | |
26 | ) | |
27 | ||
28 | find_path(BROKER_INCLUDE_DIR | |
29 | NAMES broker/broker.hh | |
30 | HINTS ${BROKER_ROOT_DIR}/include | |
31 | ) | |
32 | ||
33 | include(FindPackageHandleStandardArgs) | |
34 | find_package_handle_standard_args(Broker DEFAULT_MSG | |
35 | BROKER_LIBRARY | |
36 | BROKER_INCLUDE_DIR | |
37 | ) | |
38 | ||
39 | mark_as_advanced( | |
40 | BROKER_ROOT_DIR | |
41 | BROKER_LIBRARY | |
42 | BROKER_INCLUDE_DIR | |
43 | ) |
67 | 67 | find_library(CAF_LIBRARY_${UPPERCOMP} |
68 | 68 | NAMES |
69 | 69 | "caf_${comp}" |
70 | "caf_${comp}_static" | |
70 | 71 | HINTS |
71 | 72 | ${library_hints} |
72 | 73 | /usr/lib |
0 | # - Try to find GeoIP headers and libraries | |
1 | # | |
2 | # Usage of this module as follows: | |
3 | # | |
4 | # find_package(LibGeoIP) | |
5 | # | |
6 | # Variables used by this module, they can change the default behaviour and need | |
7 | # to be set before calling find_package: | |
8 | # | |
9 | # LibGeoIP_ROOT_DIR Set this variable to the root installation of | |
10 | # libGeoIP if the module has problems finding the | |
11 | # proper installation path. | |
12 | # | |
13 | # Variables defined by this module: | |
14 | # | |
15 | # LIBGEOIP_FOUND System has GeoIP libraries and headers | |
16 | # LibGeoIP_LIBRARY The GeoIP library | |
17 | # LibGeoIP_INCLUDE_DIR The location of GeoIP headers | |
18 | # HAVE_GEOIP_COUNTRY_EDITION_V6 Whether the API support IPv6 country edition | |
19 | # HAVE_GEOIP_CITY_EDITION_REV0_V6 Whether the API supports IPv6 city edition | |
20 | ||
21 | find_path(LibGeoIP_ROOT_DIR | |
22 | NAMES include/GeoIPCity.h | |
23 | ) | |
24 | ||
25 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
26 | # the static version of the library is preferred on OS X for the | |
27 | # purposes of making packages (libGeoIP doesn't ship w/ OS X) | |
28 | set(libgeoip_names libGeoIp.a GeoIP) | |
29 | else () | |
30 | set(libgeoip_names GeoIP) | |
31 | endif () | |
32 | ||
33 | find_library(LibGeoIP_LIBRARY | |
34 | NAMES ${libgeoip_names} | |
35 | HINTS ${LibGeoIP_ROOT_DIR}/lib | |
36 | ) | |
37 | ||
38 | find_path(LibGeoIP_INCLUDE_DIR | |
39 | NAMES GeoIPCity.h | |
40 | HINTS ${LibGeoIP_ROOT_DIR}/include | |
41 | ) | |
42 | ||
43 | include(FindPackageHandleStandardArgs) | |
44 | find_package_handle_standard_args(LibGeoIP DEFAULT_MSG | |
45 | LibGeoIP_LIBRARY | |
46 | LibGeoIP_INCLUDE_DIR | |
47 | ) | |
48 | ||
49 | if (LIBGEOIP_FOUND) | |
50 | include(CheckCXXSourceCompiles) | |
51 | set(CMAKE_REQUIRED_INCLUDES ${LibGeoIP_INCLUDE_DIR}) | |
52 | check_cxx_source_compiles(" | |
53 | #include <GeoIPCity.h> | |
54 | int main() { GEOIP_COUNTRY_EDITION_V6; return 0; } | |
55 | " HAVE_GEOIP_COUNTRY_EDITION_V6) | |
56 | check_cxx_source_compiles(" | |
57 | #include <GeoIPCity.h> | |
58 | int main() { GEOIP_CITY_EDITION_REV0_V6; return 0; } | |
59 | " HAVE_GEOIP_CITY_EDITION_REV0_V6) | |
60 | set(CMAKE_REQUIRED_INCLUDES) | |
61 | endif () | |
62 | ||
63 | mark_as_advanced( | |
64 | LibGeoIP_ROOT_DIR | |
65 | LibGeoIP_LIBRARY | |
66 | LibGeoIP_INCLUDE_DIR | |
67 | ) |
0 | # - Try to find Krb5 headers and libraries | |
1 | # | |
2 | # Usage of this module as follows: | |
3 | # | |
4 | # find_package(LibKrb5) | |
5 | # | |
6 | # Variables used by this module, they can change the default behaviour and need | |
7 | # to be set before calling find_package: | |
8 | # | |
9 | # LibKrb5_ROOT_DIR Set this variable to the root installation of | |
10 | # libKrb5 if the module has problems finding the | |
11 | # proper installation path. | |
12 | # | |
13 | # Variables defined by this module: | |
14 | # | |
15 | # LibKrb5_FOUND System has Krb5 libraries and headers | |
16 | # LibKrb5_LIBRARY The Krb5 library | |
17 | # LibKrb5_INCLUDE_DIR The location of Krb5 headers | |
18 | ||
19 | find_path(LibKrb5_ROOT_DIR | |
20 | NAMES include/krb5.h | |
21 | ) | |
22 | ||
23 | find_library(LibKrb5_LIBRARY | |
24 | NAMES krb5 | |
25 | HINTS ${LibKrb5_ROOT_DIR}/lib | |
26 | ) | |
27 | ||
28 | find_path(LibKrb5_INCLUDE_DIR | |
29 | NAMES krb5.h | |
30 | HINTS ${LibKrb5_ROOT_DIR}/include | |
31 | ) | |
32 | ||
33 | include(FindPackageHandleStandardArgs) | |
34 | find_package_handle_standard_args(LibKrb5 DEFAULT_MSG | |
35 | LibKrb5_LIBRARY | |
36 | LibKrb5_INCLUDE_DIR | |
37 | ) | |
38 | ||
39 | mark_as_advanced( | |
40 | LibKrb5_ROOT_DIR | |
41 | LibKrb5_LIBRARY | |
42 | LibKrb5_INCLUDE_DIR | |
43 | ) |
0 | # - Try to find libmaxminddb headers and libraries | |
1 | # | |
2 | # Usage of this module as follows: | |
3 | # | |
4 | # find_package(LibMMDB) | |
5 | # | |
6 | # Variables used by this module, they can change the default behaviour and need | |
7 | # to be set before calling find_package: | |
8 | # | |
9 | # LibMMDB_ROOT_DIR Set this variable to the root installation of | |
10 | # libmaxminddb if the module has problems finding the | |
11 | # proper installation path. | |
12 | # | |
13 | # Variables defined by this module: | |
14 | # | |
15 | # LibMMDB_FOUND System has libmaxminddb libraries and headers | |
16 | # LibMMDB_LIBRARY The libmaxminddb library | |
17 | # LibMMDB_INCLUDE_DIR The location of libmaxminddb headers | |
18 | ||
19 | find_path(LibMMDB_ROOT_DIR | |
20 | NAMES include/maxminddb.h | |
21 | ) | |
22 | ||
23 | if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
24 | # the static version of the library is preferred on OS X for the | |
25 | # purposes of making packages (libmaxminddb doesn't ship w/ OS X) | |
26 | set(libmmdb_names libmaxminddb.a maxminddb) | |
27 | else () | |
28 | set(libmmdb_names maxminddb) | |
29 | endif () | |
30 | ||
31 | find_library(LibMMDB_LIBRARY | |
32 | NAMES ${libmmdb_names} | |
33 | HINTS ${LibMMDB_ROOT_DIR}/lib | |
34 | ) | |
35 | ||
36 | find_path(LibMMDB_INCLUDE_DIR | |
37 | NAMES maxminddb.h | |
38 | HINTS ${LibMMDB_ROOT_DIR}/include | |
39 | ) | |
40 | ||
41 | include(FindPackageHandleStandardArgs) | |
42 | find_package_handle_standard_args(LibMMDB DEFAULT_MSG | |
43 | LibMMDB_LIBRARY | |
44 | LibMMDB_INCLUDE_DIR | |
45 | ) | |
46 | ||
47 | mark_as_advanced( | |
48 | LibMMDB_ROOT_DIR | |
49 | LibMMDB_LIBRARY | |
50 | LibMMDB_INCLUDE_DIR | |
51 | ) |
20 | 20 | # PYTHON_LIBRARIES The Python libraries and linker flags. |
21 | 21 | |
22 | 22 | include(FindPackageHandleStandardArgs) |
23 | ||
24 | if ( CMAKE_CROSSCOMPILING ) | |
25 | find_package(PythonLibs) | |
26 | if (PYTHON_INCLUDE_PATH AND NOT PYTHON_INCLUDE_DIR) | |
27 | set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}") | |
28 | endif () | |
29 | find_package_handle_standard_args(PythonDev DEFAULT_MSG | |
30 | PYTHON_INCLUDE_DIR | |
31 | PYTHON_LIBRARIES | |
32 | ) | |
33 | ||
34 | return() | |
35 | endif () | |
23 | 36 | |
24 | 37 | if (PYTHON_EXECUTABLE) |
25 | 38 | # Get the real path so that we can reliably find the correct python-config |
22 | 22 | # endif () |
23 | 23 | |
24 | 24 | macro(FindRequiredPackage packageName) |
25 | find_package(${packageName}) | |
25 | string(TOUPPER ${packageName} upperPackageName) | |
26 | if ( (DEFINED ${upperPackageName}_ROOT_DIR) AND (DEFINED CMAKE_PREFIX_PATH) ) | |
27 | set(CMAKE_PREFIX_SAVE ${CMAKE_PREFIX_PATH}) | |
28 | unset(CMAKE_PREFIX_PATH) | |
29 | find_package(${packageName}) | |
30 | set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_SAVE}) | |
31 | else() | |
32 | find_package(${packageName}) | |
33 | endif () | |
26 | 34 | string(TOUPPER ${packageName} canonPackageName) |
27 | 35 | if (NOT ${canonPackageName}_FOUND) |
28 | 36 | set(MISSING_PREREQS true) |
2 | 2 | # shell script's hashbang (#!) line to use the absolute path to the |
3 | 3 | # interpreter in the path of the user running ./configure (or CMake equiv.). |
4 | 4 | # |
5 | # Hashbangs are not transformed when in binary packaging mode because, | |
6 | # if NMI systems are to be used in creating binary packages, that could | |
7 | # result in picking up a python interpreter in a non-standard location for | |
8 | # a given distro. (NMI tends to install non-essential prerequisite packages | |
9 | # in atypical locations). | |
5 | # Hashbangs are not transformed when in binary packaging or cross-compiling | |
6 | # mode because that can result in inserting paths on the build system | |
7 | # that are not valid on the target system. | |
10 | 8 | # |
11 | 9 | # _dstdir: absolute path to the directory in which to install the transformed |
12 | 10 | # source file |
31 | 29 | file(READ ${configed_file} _srclines) |
32 | 30 | file(WRITE ${dehashbanged_file} "") |
33 | 31 | |
34 | if (NOT BINARY_PACKAGING_MODE) | |
32 | if (NOT BINARY_PACKAGING_MODE AND NOT CMAKE_CROSSCOMPILING) | |
35 | 33 | set(_regex "^#![ ]*/usr/bin/env[ ]+([^\n ]*)") |
36 | 34 | string(REGEX MATCH ${_regex} _match ${_srclines}) |
37 | 35 | if (_match) |
21 | 21 | execute_process(COMMAND ${MAC_HBREW_BIN} "--prefix" OUTPUT_VARIABLE BREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) |
22 | 22 | list(INSERT CMAKE_PREFIX_PATH 0 ${BREW_PREFIX}) # Homebrew, if linked |
23 | 23 | list(INSERT CMAKE_PREFIX_PATH 0 ${BREW_PREFIX}/opt/openssl) # Homebrew OpenSSL |
24 | list(INSERT CMAKE_PREFIX_PATH 0 ${BREW_PREFIX}/opt/bison/bin) # Homebrew Bison | |
25 | list(INSERT CMAKE_PREFIX_PATH 0 ${BREW_PREFIX}/opt/actor-framework) # Homebrew actor-framework | |
24 | 26 | endif () |
25 | 27 | |
26 | 28 | if (MAC_FINK_BIN) |
1 | 1 | include(CheckCXXSourceCompiles) |
2 | 2 | include(CheckCSourceRuns) |
3 | 3 | |
4 | set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) | |
4 | set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS}) | |
5 | 5 | # Use all includes, not just OpenSSL includes to see if there are |
6 | 6 | # include files of different versions that do not match |
7 | 7 | GET_DIRECTORY_PROPERTY(includes INCLUDE_DIRECTORIES) |
29 | 29 | endif () |
30 | 30 | endif () |
31 | 31 | |
32 | # check for OPENSSL_add_all_algorithms_conf function | |
33 | # and thus OpenSSL >= v0.9.7 | |
34 | check_c_source_compiles(" | |
35 | #include <openssl/evp.h> | |
36 | int main() { | |
37 | OPENSSL_add_all_algorithms_conf(); | |
38 | return 0; | |
39 | } | |
40 | " openssl_greater_than_0_9_7) | |
41 | ||
42 | if (NOT openssl_greater_than_0_9_7) | |
32 | if (OPENSSL_VERSION VERSION_LESS "0.9.7") | |
43 | 33 | message(FATAL_ERROR "OpenSSL >= v0.9.7 required") |
44 | 34 | endif () |
45 | 35 | |
70 | 60 | endif () |
71 | 61 | endif () |
72 | 62 | |
73 | check_c_source_runs(" | |
74 | #include <stdio.h> | |
75 | #include <openssl/opensslv.h> | |
76 | #include <openssl/crypto.h> | |
77 | int main() { | |
78 | printf(\"-- OpenSSL Library version: %s\\\\n\", SSLeay_version(SSLEAY_VERSION)); | |
79 | printf(\"-- OpenSSL Header version: %s\\\\n\", OPENSSL_VERSION_TEXT); | |
80 | if (SSLeay() == OPENSSL_VERSION_NUMBER) { | |
81 | return 0; | |
63 | if (NOT CMAKE_CROSSCOMPILING) | |
64 | check_c_source_runs(" | |
65 | #include <stdio.h> | |
66 | #include <openssl/opensslv.h> | |
67 | #include <openssl/crypto.h> | |
68 | int main() { | |
69 | printf(\"-- OpenSSL Library version: %s\\\\n\", SSLeay_version(SSLEAY_VERSION)); | |
70 | printf(\"-- OpenSSL Header version: %s\\\\n\", OPENSSL_VERSION_TEXT); | |
71 | if (SSLeay() == OPENSSL_VERSION_NUMBER) { | |
72 | return 0; | |
73 | } | |
74 | return -1; | |
82 | 75 | } |
83 | return -1; | |
84 | } | |
85 | " OPENSSL_CORRECT_VERSION_NUMBER ) | |
76 | " OPENSSL_CORRECT_VERSION_NUMBER ) | |
86 | 77 | |
87 | if (NOT OPENSSL_CORRECT_VERSION_NUMBER) | |
88 | message(FATAL_ERROR | |
89 | "OpenSSL library version does not match headers") | |
78 | if (NOT OPENSSL_CORRECT_VERSION_NUMBER) | |
79 | message(FATAL_ERROR | |
80 | "OpenSSL library version does not match headers") | |
81 | endif () | |
90 | 82 | endif () |
91 | 83 | |
92 | 84 | set(CMAKE_REQUIRED_INCLUDES) |
5 | 5 | set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIR}) |
6 | 6 | set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY}) |
7 | 7 | |
8 | cmake_policy(PUSH) | |
9 | ||
10 | if ( POLICY CMP0075 ) | |
11 | # It's fine that check_include_files links against CMAKE_REQUIRED_LIBRARIES | |
12 | cmake_policy(SET CMP0075 NEW) | |
13 | endif () | |
14 | ||
8 | 15 | check_include_files(pcap-int.h HAVE_PCAP_INT_H) |
16 | ||
17 | cmake_policy(POP) | |
9 | 18 | |
10 | 19 | check_function_exists(pcap_freecode HAVE_LIBPCAP_PCAP_FREECODE) |
11 | 20 | if (NOT HAVE_LIBPCAP_PCAP_FREECODE) |
0 | 0 | This is a collection of CMake scripts intended to be included as a |
1 | git submodule in other repositories related to Bro (www.bro-ids.org). | |
1 | git submodule in other repositories related to Bro (www.bro.org). |
13 | 13 | string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type_upper) |
14 | 14 | |
15 | 15 | if ( "${_build_type_upper}" STREQUAL "DEBUG" ) |
16 | if ( ENABLE_COVERAGE ) | |
17 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") | |
18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") | |
19 | endif() | |
16 | 20 | # manual add of -g works around its omission in FreeBSD's CMake port |
17 | 21 | set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -g -DDEBUG -DBRO_DEBUG") |
18 | 22 | endif () |