aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-11-17 12:50:44 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-11-17 13:37:33 +0000
commitbdbf75f72833c1f95f612e3b86ce9aaefcce6358 (patch)
tree8be21ee17b40f175b7680d3c51f305709e378ce4
parent10ad2d3955985f88c13461f395ea5b3dae5b6c23 (diff)
Fix build on FreeBSD.
-- MOS_MIGRATED_REVID=108029812
-rwxr-xr-xscripts/bootstrap/compile.sh2
-rw-r--r--src/BUILD1
-rw-r--r--src/main/cpp/blaze_util_freebsd.cc2
-rw-r--r--src/main/tools/process-wrapper.c1
4 files changed, 4 insertions, 2 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 841b294de6..ea21eba9c4 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -109,7 +109,7 @@ linux)
freebsd)
LDFLAGS="-lprocstat -lz -lrt $LDFLAGS"
JNILIB="libunix.so"
- MD5SUM="md5sum"
+ MD5SUM="md5"
# JAVA_HOME must point to a Java installation.
JAVA_HOME="${JAVA_HOME:-/usr/local/openjdk8}"
# Note: the linux protoc binary works on freebsd using linux emulation.
diff --git a/src/BUILD b/src/BUILD
index f88c1c7971..d1df1efdfd 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -31,6 +31,7 @@ filegroup(
cmd = select({
":darwin": md5_cmd % "/sbin/md5",
":darwin_x86_64": md5_cmd % "/sbin/md5",
+ ":freebsd": md5_cmd % "/sbin/md5",
"//conditions:default": md5_cmd % "md5sum",
}),
) for suffix, embedded_tools in {
diff --git a/src/main/cpp/blaze_util_freebsd.cc b/src/main/cpp/blaze_util_freebsd.cc
index 2317795bbd..0b87a10299 100644
--- a/src/main/cpp/blaze_util_freebsd.cc
+++ b/src/main/cpp/blaze_util_freebsd.cc
@@ -13,7 +13,6 @@
// limitations under the License.
#include <errno.h> // errno, ENAMETOOLONG
-#include <libprocstat.h>
#include <limits.h>
#include <pwd.h>
#include <signal.h>
@@ -26,6 +25,7 @@
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
+#include <libprocstat.h> // must be included after <sys/...> headers
#include "src/main/cpp/blaze_util.h"
#include "src/main/cpp/blaze_util_platform.h"
diff --git a/src/main/tools/process-wrapper.c b/src/main/tools/process-wrapper.c
index 36fa59e157..07ae840a52 100644
--- a/src/main/tools/process-wrapper.c
+++ b/src/main/tools/process-wrapper.c
@@ -33,6 +33,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <unistd.h>
#include "process-tools.h"