Module: kamailio
Branch: 6.0
Commit: ea8e68340a7ff3c65d6df9389472d176f41332b6
URL: 
https://github.com/kamailio/kamailio/commit/ea8e68340a7ff3c65d6df9389472d176f41332b6

Author: Xenofon Karamanos <x...@gilawa.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2025-08-14T15:08:02Z

cmake: Add futex definition to linux.

- Match existing behavior with makefiles
- This has the side effect that both fast_lock and use_futex are defined.
- code selects use_futex

(cherry picked from commit 9d6d4f66c586396def5bbf9b8cf59d277983c72e)

---

Modified: cmake/os-specific/linux.cmake

---

Diff:  
https://github.com/kamailio/kamailio/commit/ea8e68340a7ff3c65d6df9389472d176f41332b6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/ea8e68340a7ff3c65d6df9389472d176f41332b6.patch

---

diff --git a/cmake/os-specific/linux.cmake b/cmake/os-specific/linux.cmake
index 22315a3bd5d..4c9c37666f5 100644
--- a/cmake/os-specific/linux.cmake
+++ b/cmake/os-specific/linux.cmake
@@ -52,4 +52,13 @@ if(NOT NO_SIGIO_RT)
                                               SIGINFO64_WORKAROUND)
 endif()
 
-# TODO introduce check for futex
+# TODO This is placed here to match the Makefiles where both
+# FAST_LOCK and USE_FUTEX are defined unconditionally.
+# This also had the side effect that futex also uses the definitions
+# defined for FAST_LOCK like ADAPTIVE_WAIT[_LOOPS].
+# https://github.com/kamailio/kamailio/pull/4363 aims to fix this
+# and we should decide whether to also apply the definitions for USE_FUTEX 
case.
+find_path(FUTEX_HEADER_DIR linux/futex.h)
+if(FUTEX_HEADER_DIR)
+  target_compile_definitions(common INTERFACE USE_FUTEX)
+endif()

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to