Subject: | Cannot compile on FreeBSD 10 systems (clang!) |
FreeBSD 10 does not ship anymore gcc and g++ by default, but instead clang and clang++. Therefore compilation fails:
...
g++ -std=c++11 -O2 -g -Wall -fPIC -c crawler.cpp
g++: not found
...
If the CXX definition is removed from libvmprobe/Makefile, then the compilation works. I think CXX has a reasonable default and may be removed everywhere.
The other problem is the call to msync(), where the first argument has to be casted, it seems.
With these patches also the test suite passes.
Subject: | 0001-enable-compilation-on-FreeBSD-10.patch |
From 75ac40fd5e1fa32dab3db12900a6a487d9bb1843 Mon Sep 17 00:00:00 2001
From: Slaven Rezic <cpansand@cvrsnica-freebsd-101.herceg.de>
Date: Fri, 15 Jan 2016 22:08:09 +0100
Subject: [PATCH] enable compilation on FreeBSD 10
---
libvmprobe/Makefile | 2 +-
libvmprobe/file.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvmprobe/Makefile b/libvmprobe/Makefile
index 393446d..cc05762 100644
--- a/libvmprobe/Makefile
+++ b/libvmprobe/Makefile
@@ -1,4 +1,4 @@
-CXX = g++
+#CXX = g++
AR = ar
W = -Wall
OPT = -O2 -g
diff --git a/libvmprobe/file.cpp b/libvmprobe/file.cpp
index fe46318..580a183 100644
--- a/libvmprobe/file.cpp
+++ b/libvmprobe/file.cpp
@@ -115,7 +115,7 @@ void file::evict(size_t start, size_t len) {
#if defined(__linux__) || defined(__hpux)
posix_fadvise(fd, start, len, POSIX_FADV_DONTNEED);
#elif defined(__FreeBSD__) || defined(__sun__) || defined(__APPLE__)
- msync(start, len, MS_INVALIDATE);
+ msync((void*)start, len, MS_INVALIDATE);
#endif
}
--
2.6.0