From d043aba54d7f94f8a7226c0ad7091c88e8d64e75 Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 21 Oct 2010 15:32:31 -0500 Subject: [PATCH] Added support for optional libz. --- BuildOptions.cmake | 1 - CMakeLists.txt | 8 ++++++-- config.h.in | 4 ++-- src/CMakeLists.txt | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/BuildOptions.cmake b/BuildOptions.cmake index ed210b5d80..f6bf636301 100644 --- a/BuildOptions.cmake +++ b/BuildOptions.cmake @@ -69,5 +69,4 @@ set(BinPAC_SKIP_INSTALL true) # TODO: more dependencies: # LibGeoIP -# Libz # Google perftools diff --git a/CMakeLists.txt b/CMakeLists.txt index f4510fd641..b39467c4a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,8 +99,12 @@ if (LIBMAGIC_FOUND) set(HAVE_LIBMAGIC true) endif () +find_package(ZLIB) +if (ZLIB_FOUND) + set(HAVE_LIBZ true) +endif () + # TODO: optional libGeoIP -# TODO: optional libz # TODO: optional Google perftools ## @@ -155,7 +159,7 @@ message( "\nBroccoli: ${use_broccoli}" "\nBroctl: ${use_broctl}" "\nGeoIP: ${use_geoip}" - "\nlibz: ${use_libz}" + "\nlibz: ${HAVE_LIBZ}" "\nlibmagic: ${HAVE_LIBMAGIC}" "\nGoogle perftools: ${use_perftools}" "\n" diff --git a/config.h.in b/config.h.in index df791a7e36..037434c9d7 100644 --- a/config.h.in +++ b/config.h.in @@ -23,8 +23,8 @@ /* Define if you have the `magic' library (-lmagic). */ #cmakedefine HAVE_LIBMAGIC -/* Define to 1 if you have the `z' library (-lz). */ -#undef HAVE_LIBZ +/* Define if you have the `z' library (-lz). */ +#cmakedefine HAVE_LIBZ /* We are on a Linux system */ #cmakedefine HAVE_LINUX diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d1a06f413..30b5b6bd5b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -369,6 +369,7 @@ target_link_libraries(bro ${OPENSSL_LIBRARIES} ${BIND_LIBRARY} ${LibMagic_LIBRARY} + ${ZLIB_LIBRARIES} ) install(TARGETS bro DESTINATION bin)