[icinga-checkins] icinga.org: icinga2/master: Build fix for OpenBSD

git at icinga.org git at icinga.org
Fri Feb 13 11:21:38 CET 2015


Module: icinga2
Branch: master
Commit: d8203f4bb53327bd0840ac5491c6faa973ba7278
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=d8203f4bb53327bd0840ac5491c6faa973ba7278

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Fri Feb 13 11:21:20 2015 +0100

Build fix for OpenBSD

fixes #8434

---

 CMakeLists.txt                |    8 +++++++-
 third-party/execvpe/execvpe.c |    4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e9ad83..5288662 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,10 +122,16 @@ if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
 endif()
 
 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
   if(CMAKE_SYSTEM_NAME MATCHES AIX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g -lpthread")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lpthread")
+  elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread")
   else()
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
   endif()
 endif()
diff --git a/third-party/execvpe/execvpe.c b/third-party/execvpe/execvpe.c
index c0528b1..05a72eb 100644
--- a/third-party/execvpe/execvpe.c
+++ b/third-party/execvpe/execvpe.c
@@ -17,9 +17,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
 #include <alloca.h>
-#endif /* _FreeBSD__ */
+#endif /* !__FreeBSD__ && !__OpenBSD__ */
 #include <unistd.h>
 #include <stdarg.h>
 #include <stdbool.h>



More information about the icinga-checkins mailing list