--- CMakeLists.txt.orig	2026-04-22 09:29:50 UTC
+++ CMakeLists.txt
@@ -29,8 +29,8 @@ endif()
   set(ICINGA2_MASTER ON)
 endif()
 
-option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ${ICINGA2_MASTER})
-option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ${ICINGA2_MASTER})
+option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)
+option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON)
 option(ICINGA2_WITH_CHECKER "Build the checker module" ON)
 option(ICINGA2_WITH_COMPAT "Build the compat module" ${ICINGA2_MASTER})
 option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ${ICINGA2_MASTER})
@@ -293,6 +293,12 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
   endif()
+endif()
+
+if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD.*")
+	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lexecinfo")
+	set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lexecinfo")
+	set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -lexecinfo")
 endif()
 
 include(CheckCXXCompilerFlag)
