]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4567: cmake: modification to search custom jemalloc first
authorAkhilesh MY (amuttuva) <amuttuva@cisco.com>
Sat, 18 Jan 2025 06:07:15 +0000 (06:07 +0000)
committerShanmugam S (shanms) <shanms@cisco.com>
Sat, 18 Jan 2025 06:07:15 +0000 (06:07 +0000)
Merge in SNORT/snort3 from ~AMUTTUVA/snort3:jem_master to master

Squashed commit of the following:

commit 624a042434687d051f3f53aa76e954486567b1b1
Author: Akhilesh MY <amuttuva@cisco.com>
Date:   Mon Jan 13 02:22:01 2025 -0500

    cmake: modification to search custom jemalloc first

cmake/FindJEMalloc.cmake
configure_cmake.sh

index d7ad0012d894a0e542d15d172ba173b6bd742b4b..0082c1b47b8543d34558684d7cde67434227cdf4 100644 (file)
@@ -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)
index 572a53aa659128d1e1f6910d011d1e6a56dfa314..d758628282becc3520de6e5e8b8bad4b6d630f43 100755 (executable)
@@ -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
             ;;