]> granicus.if.org Git - icinga2/commitdiff
Build fix for OpenBSD
authorGunnar Beutner <gunnar@beutner.name>
Fri, 13 Feb 2015 10:21:20 +0000 (11:21 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 13 Feb 2015 10:21:20 +0000 (11:21 +0100)
fixes #8434

CMakeLists.txt
third-party/execvpe/execvpe.c

index 2e9ad834c79508f20a3aeea8f63745d7f827af62..52886623a1dcdb01479b827eaaf8ceb49b5e26d9 100644 (file)
@@ -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()
index c0528b10df3afc242d3619b59aa4f25b1f9d71b4..05a72ebe6274e5d5fa489e3c13b0ec508a0c28ec 100644 (file)
@@ -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>