Codebase list broccoli-python / d995d62
Merge tag 'upstream/0.63' into debian Upstream version 0.63 Hilko Bengen 5 years ago
24 changed file(s) with 418 addition(s) and 174 deletion(s). Raw diff Collapse all Expand all
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.
012
113 0.62 | 2017-05-26 08:27:17 -0500
214
3434
3535 include(UseSWIG)
3636
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
3845 swig_link_libraries(broccoli_intern ${Broccoli_LIBRARY} ${PYTHON_LIBRARIES})
3946 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES
4047 COMPILE_FLAGS -fno-strict-aliasing)
00 Metadata-Version: 1.0
11 Name: broccoli-python
2 Version: 0.62
2 Version: 0.63
33 Summary: UNKNOWN
44 Home-page: UNKNOWN
55 Author: UNKNOWN
00 .. -*- mode: rst-mode -*-
11 ..
22 .. Version number is filled in automatically.
3 .. |version| replace:: 0.62
3 .. |version| replace:: 0.63
44
55 ============================
66 Python Bindings for Broccoli
0 0.62
0 0.63
8888 endif ()
8989
9090 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 ()
92108 endif ()
93109
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})
99111
100112 add_custom_command(OUTPUT ${bifOutputs} ${BIF_OUTPUT_BRO}
101113 COMMAND ${BifCl_EXE}
99 # bro_ALL_GENERATED_OUTPUTS.
1010 macro(BINPAC_TARGET pacFile)
1111 if ( BRO_PLUGIN_INTERNAL_BUILD )
12 if ( BINPAC_EXE_PATH )
13 set(BinPAC_EXE ${BINPAC_EXE_PATH})
14 endif ()
15
1216 set(binpacDep "${BinPAC_EXE}")
1317 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 ()
1625 endif ()
1726
1827 get_filename_component(basename ${pacFile} NAME_WE)
3241 set(BINPAC_OUTPUT_H ${CMAKE_CURRENT_BINARY_DIR}/${basename}_pac.h)
3342 set(BINPAC_OUTPUT_CC ${CMAKE_CURRENT_BINARY_DIR}/${basename}_pac.cc)
3443 set(pacOutputs ${BINPAC_OUTPUT_H} ${BINPAC_OUTPUT_CC})
44 set_property(SOURCE ${BINPAC_OUTPUT_CC} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-tautological-compare")
3545
3646 set(target "pac-${CMAKE_CURRENT_BINARY_DIR}/${pacFile}")
3747
77 ## included from its top-level CMake file.
88
99 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 ()
22133
23134 if ( NOT BRO_PLUGIN_BASE )
24135 set(BRO_PLUGIN_BASE "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "" FORCE)
32143 set(BRO_PLUGIN_MAGIC "${BRO_PLUGIN_BUILD}/__bro_plugin__" CACHE INTERNAL "" FORCE)
33144 set(BRO_PLUGIN_README "${BRO_PLUGIN_BASE}/README" CACHE INTERNAL "" FORCE)
34145
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)
49146 set(BRO_PLUGIN_INTERNAL_BUILD false CACHE INTERNAL "" FORCE)
50147 set(BRO_PLUGIN_BUILD_DYNAMIC true CACHE INTERNAL "" FORCE)
51148
56153 message(STATUS "Bro plugin directory: ${BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH}")
57154 message(STATUS "Bro debug mode : ${BRO_PLUGIN_ENABLE_DEBUG}")
58155
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
65156 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
66157 # By default Darwin's linker requires all symbols to be present at link time.
67158 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -undefined dynamic_lookup -Wl,-bind_at_load")
68159 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}")
82160
83161 set(bro_PLUGIN_LIBS CACHE INTERNAL "plugin libraries" FORCE)
84162 set(bro_PLUGIN_BIF_SCRIPTS CACHE INTERNAL "Bro script stubs for BIFs in Bro plugins" FORCE)
137215
138216 target_link_libraries(${_plugin_lib} ${_plugin_libs})
139217
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
146218 # Create bif/__init__.bro.
147219 bro_bif_create_loader(bif-init-${_plugin_name_canon} "${bro_PLUGIN_BIF_SCRIPTS}")
148220
159231
160232 if ( _plugin_deps )
161233 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})
165235 endif()
166236
167237 # Create __bro_plugin__
183253
184254 # Create binary install package.
185255 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}
187257 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
188258 DEPENDS ${_plugin_lib}
189259 COMMENT "Building binary plugin package: ${_dist_tarball_name}")
199269 set(plugin_install "${BRO_PLUGIN_BRO_PLUGIN_INSTALL_PATH}/${_plugin_name_canon}")
200270
201271 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}
203273 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
204274 )")
205275
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.
1919
2020 # look for BinPAC in standard locations or user-provided root
2121 find_path(BinPAC_ROOT_DIR
22 NAMES include/binpac.h
22 NAMES include/binpac.h include/binpac/binpac.h
2323 )
2424
2525 find_file(BinPAC_EXE
3434
3535 find_path(BinPAC_INCLUDE_DIR
3636 NAMES binpac.h
37 HINTS ${BinPAC_ROOT_DIR}/include
37 HINTS ${BinPAC_ROOT_DIR}/include ${BinPAC_ROOT_DIR}/include/binpac
3838 )
3939
4040 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 )
6767 find_library(CAF_LIBRARY_${UPPERCOMP}
6868 NAMES
6969 "caf_${comp}"
70 "caf_${comp}_static"
7071 HINTS
7172 ${library_hints}
7273 /usr/lib
+0
-68
cmake/FindLibGeoIP.cmake less more
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 )
2020 # PYTHON_LIBRARIES The Python libraries and linker flags.
2121
2222 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 ()
2336
2437 if (PYTHON_EXECUTABLE)
2538 # Get the real path so that we can reliably find the correct python-config
2222 # endif ()
2323
2424 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 ()
2634 string(TOUPPER ${packageName} canonPackageName)
2735 if (NOT ${canonPackageName}_FOUND)
2836 set(MISSING_PREREQS true)
22 # shell script's hashbang (#!) line to use the absolute path to the
33 # interpreter in the path of the user running ./configure (or CMake equiv.).
44 #
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.
108 #
119 # _dstdir: absolute path to the directory in which to install the transformed
1210 # source file
3129 file(READ ${configed_file} _srclines)
3230 file(WRITE ${dehashbanged_file} "")
3331
34 if (NOT BINARY_PACKAGING_MODE)
32 if (NOT BINARY_PACKAGING_MODE AND NOT CMAKE_CROSSCOMPILING)
3533 set(_regex "^#![ ]*/usr/bin/env[ ]+([^\n ]*)")
3634 string(REGEX MATCH ${_regex} _match ${_srclines})
3735 if (_match)
2121 execute_process(COMMAND ${MAC_HBREW_BIN} "--prefix" OUTPUT_VARIABLE BREW_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
2222 list(INSERT CMAKE_PREFIX_PATH 0 ${BREW_PREFIX}) # Homebrew, if linked
2323 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
2426 endif ()
2527
2628 if (MAC_FINK_BIN)
11 include(CheckCXXSourceCompiles)
22 include(CheckCSourceRuns)
33
4 set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
4 set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS})
55 # Use all includes, not just OpenSSL includes to see if there are
66 # include files of different versions that do not match
77 GET_DIRECTORY_PROPERTY(includes INCLUDE_DIRECTORIES)
2929 endif ()
3030 endif ()
3131
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")
4333 message(FATAL_ERROR "OpenSSL >= v0.9.7 required")
4434 endif ()
4535
7060 endif ()
7161 endif ()
7262
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;
8275 }
83 return -1;
84 }
85 " OPENSSL_CORRECT_VERSION_NUMBER )
76 " OPENSSL_CORRECT_VERSION_NUMBER )
8677
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 ()
9082 endif ()
9183
9284 set(CMAKE_REQUIRED_INCLUDES)
55 set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIR})
66 set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY})
77
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
815 check_include_files(pcap-int.h HAVE_PCAP_INT_H)
16
17 cmake_policy(POP)
918
1019 check_function_exists(pcap_freecode HAVE_LIBPCAP_PCAP_FREECODE)
1120 if (NOT HAVE_LIBPCAP_PCAP_FREECODE)
00 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).
1313 string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type_upper)
1414
1515 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()
1620 # manual add of -g works around its omission in FreeBSD's CMake port
1721 set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -g -DDEBUG -DBRO_DEBUG")
1822 endif ()
55 from distutils.core import setup, Extension
66
77 setup(name="broccoli-python",
8 version="0.62", # Filled in automatically.
8 version="0.63", # Filled in automatically.
99 author_email="info@bro.org",
1010 license="BSD",
1111 py_modules=['broccoli'],