about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorTatiana Tikhomirova <itbot@bk.ru>2017-05-01 19:31:21 +0300
committerDan Liew <delcypher@gmail.com>2017-07-31 21:18:55 +0100
commit977e032add0e29683bc4edc8c03aef9a81fb6d6a (patch)
treee4dfe74d3bc05ad399f8e1f265ed0d91ad68ed82
parentfa4d6690d0413b354afe155f9e3f67f7069a6891 (diff)
downloadklee-977e032add0e29683bc4edc8c03aef9a81fb6d6a.tar.gz
Fix build for FreeBSD.
On FreeBSD <sys/capabilities.h> is present in libc, so we don't require libcap there.
Close and write functions are located in <unistd.h>.
-rw-r--r--CMakeLists.txt3
-rw-r--r--lib/Support/CompressionStream.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f162f21..80e6b506 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -418,7 +418,8 @@ if (HAVE_SYS_CAPABILITY_H)
     NAMES cap
     DOC "libcap library"
   )
-  if (NOT LIBCAP_LIBRARIES)
+# On FreeBSD <sys/capabilities.h> is present in libc, so we don't require libcap there.
+  if (NOT LIBCAP_LIBRARIES AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
     message(FATAL_ERROR "Found \"sys/capability.h\" but could not find libcap")
   endif()
 else()
diff --git a/lib/Support/CompressionStream.cpp b/lib/Support/CompressionStream.cpp
index 3cd5bc86..94f0bd18 100644
--- a/lib/Support/CompressionStream.cpp
+++ b/lib/Support/CompressionStream.cpp
@@ -19,6 +19,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #endif
+#include <unistd.h>
 
 namespace klee {