Module: kamailio
Branch: master
Commit: 0498446fd24462a7de72f73aae37a76ceabc4276
URL: 
https://github.com/kamailio/kamailio/commit/0498446fd24462a7de72f73aae37a76ceabc4276

Author: drTr0jan <drtr0...@yandex.ru>
Committer: Xenofon Karamanos <xenakiskarama...@gmail.com>
Date: 2025-01-14T19:05:39+02:00

cmake: add FreeBSD support

---

Added: cmake/os-specific/freebsd.cmake
Modified: cmake/os-specific.cmake

---

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

---

diff --git a/cmake/os-specific.cmake b/cmake/os-specific.cmake
index d70a44cf379..ab67a4f7d68 100644
--- a/cmake/os-specific.cmake
+++ b/cmake/os-specific.cmake
@@ -12,6 +12,9 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "DragonFly")
 elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
   # Mac OS X specific flags
   include(${OS_SPECIFIC_DIR}/darwin.cmake)
+elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+  # FreeBSD specific flags
+  include(${OS_SPECIFIC_DIR}/freebsd.cmake)
 elseif()
   message(FATAL_ERROR "Unsupported system: ${CMAKE_SYSTEM_NAME}")
 endif()
diff --git a/cmake/os-specific/freebsd.cmake b/cmake/os-specific/freebsd.cmake
new file mode 100644
index 00000000000..03d1f2032c3
--- /dev/null
+++ b/cmake/os-specific/freebsd.cmake
@@ -0,0 +1,37 @@
+message(
+  STATUS
+    "Configuring for FreeBSD"
+)
+
+target_compile_definitions(
+  common
+  INTERFACE HAVE_SOCKADDR_SA_LEN
+            HAVE_GETHOSTBYNAME2
+            HAVE_UNION_SEMUN
+            HAVE_SCHED_YIELD
+            HAVE_MSGHDR_MSG_CONTROL
+            HAVE_CONNECT_ECONNRESET_BUG
+            HAVE_TIMEGM
+            HAVE_IP_MREQN
+)
+
+if(${RAW_SOCKS})
+  target_compile_definitions(common INTERFACE USE_RAW_SOCKS)
+endif()
+
+message(STATUS "USE_FAST_LOCK = ${USE_FAST_LOCK}")
+if(NOT ${USE_FAST_LOCK})
+  target_compile_definitions(common INTERFACE USE_PTHREAD_MUTEX)
+endif()
+
+if(NOT DEFINED ${NO_SELECT})
+  target_compile_definitions(common INTERFACE HAVE_SELECT)
+endif()
+
+if(NOT DEFINED ${NO_KQUEUE})
+  target_compile_definitions(common INTERFACE HAVE_KQUEUE)
+endif()
+
+if(NOT DEFINED RUN_PREFIX)
+  set(RUN_PREFIX "/var")
+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