From: Akhilesh MY (amuttuva) Date: Sat, 18 Jan 2025 06:07:15 +0000 (+0000) Subject: Pull request #4567: cmake: modification to search custom jemalloc first X-Git-Tag: 3.6.2.0~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b384141bb26c84185ccc6b0cf4fe036e816f7ba7;p=thirdparty%2Fsnort3.git Pull request #4567: cmake: modification to search custom jemalloc first Merge in SNORT/snort3 from ~AMUTTUVA/snort3:jem_master to master Squashed commit of the following: commit 624a042434687d051f3f53aa76e954486567b1b1 Author: Akhilesh MY Date: Mon Jan 13 02:22:01 2025 -0500 cmake: modification to search custom jemalloc first --- diff --git a/cmake/FindJEMalloc.cmake b/cmake/FindJEMalloc.cmake index d7ad0012d..0082c1b47 100644 --- a/cmake/FindJEMalloc.cmake +++ b/cmake/FindJEMalloc.cmake @@ -7,21 +7,40 @@ find_package(PkgConfig QUIET) pkg_check_modules(PC_JEMALLOC QUIET jemalloc) +if (PC_JEMALLOC_INCLUDE_DIRS) + find_path(JEMALLOC_INCLUDE_DIR + NAMES jemalloc/jemalloc.h + HINTS ${PC_JEMALLOC_INCLUDE_DIRS} + NO_DEFAULT_PATH + ) +endif() find_path(JEMALLOC_INCLUDE_DIR NAMES jemalloc/jemalloc.h - HINTS ${PC_JEMALLOC_INCLUDE_DIRS} ) if ( STATIC_JEMALLOC ) - find_library(JEMALLOC_LIBRARY - NAMES libjemalloc.a jemalloc - HINTS ${PC_JEMALLOC_LIBRARY_DIRS} -) + if (PC_JEMALLOC_LIBRARY_DIRS) + find_library(JEMALLOC_LIBRARY + NAMES libjemalloc.a jemalloc + HINTS ${PC_JEMALLOC_LIBRARY_DIRS} + NO_DEFAULT_PATH + ) + endif() + find_library(JEMALLOC_LIBRARY + NAMES libjemalloc.a jemalloc + ) + else() + if (PC_JEMALLOC_LIBRARY_DIRS) + find_library(JEMALLOC_LIBRARY + NAMES jemalloc + HINTS ${PC_JEMALLOC_LIBRARY_DIRS} + NO_DEFAULT_PATH + ) + endif() find_library(JEMALLOC_LIBRARY NAMES jemalloc - HINTS ${PC_JEMALLOC_LIBRARY_DIRS} -) + ) endif() if(JEMALLOC_INCLUDE_DIR) diff --git a/configure_cmake.sh b/configure_cmake.sh index 572a53aa6..d75862828 100755 --- a/configure_cmake.sh +++ b/configure_cmake.sh @@ -433,6 +433,12 @@ while [ $# -ne 0 ]; do --with-dnet-libraries=*) append_cache_entry DNET_LIBRARIES_DIR_HINT PATH $optarg ;; + --with-jemalloc-includes=*) + append_cache_entry PC_JEMALLOC_INCLUDE_DIRS PATH $optarg + ;; + --with-jemalloc-libraries=*) + append_cache_entry PC_JEMALLOC_LIBRARY_DIRS PATH $optarg + ;; --with-daq-includes=*) append_cache_entry DAQ_INCLUDE_DIR_HINT PATH $optarg ;;