You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by id...@apache.org on 2015/12/14 21:09:26 UTC

[2/4] mesos git commit: FreeBSD: Enable mesos build.

FreeBSD: Enable mesos build.

Review: https://reviews.apache.org/r/39634/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6196fb42
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6196fb42
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6196fb42

Branch: refs/heads/master
Commit: 6196fb42ee6c8cf6e262bb2cf80520a60fc6ce3d
Parents: ef38ec3
Author: David Forsythe <df...@gmail.com>
Authored: Mon Dec 14 09:33:25 2015 -0800
Committer: Ian Downes <id...@twitter.com>
Committed: Mon Dec 14 09:34:08 2015 -0800

----------------------------------------------------------------------
 configure.ac    | 33 +++++++++++++++++++++++++++++++--
 src/Makefile.am |  6 +++++-
 2 files changed, 36 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6196fb42/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index b30a8d3..40d60a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -298,6 +298,9 @@ case "${target_os}" in
   darwin*)
     OS_NAME=darwin
     ;;
+  freebsd*)
+    OS_NAME=freebsd
+    ;;
   *)
     AC_MSG_ERROR("Mesos is currently unsupported on your platform.")
 esac
@@ -305,6 +308,7 @@ esac
 
 # Used for conditionally including source files.
 AM_CONDITIONAL([OS_LINUX], [test "x$OS_NAME" = "xlinux"])
+AM_CONDITIONAL([OS_FREEBSD], [test "x$OS_NAME" = "xfreebsd"])
 
 
 # Default to gcc toolchain (we rely on some atomic builtins for now,
@@ -602,11 +606,22 @@ case "$host_os" in
       CXXFLAGS="$CXXFLAGS -stdlib=libc++"
     fi
 
-    # GTEST on OSX needs its own tr1 tuple.
+    # GTEST on OSX and FreeBSD needs its own tr1 tuple.
     CXXFLAGS="$CXXFLAGS -DGTEST_USE_OWN_TR1_TUPLE=1 -DGTEST_LANG_CXX11"
     ;;
+  freebsd* )
+    # If we're using clang, we need to pass -stdlib=libc++ too.
+    if test "x$ax_cv_cxx_compiler_vendor" = "xclang"; then
+      CXXFLAGS="$CXXFLAGS -stdlib=libc++"
+    fi
+
+    # FreeBSD needs GTEST_HAS_PTHREAD for this version of gmock/gtest and
+    # _WITH_GETLINE for getline().
+    CXXFLAGS="$CXXFLAGS -DGTEST_HAS_PTHREAD -D_WITH_GETLINE"
+    ;;
 esac
 
+
 # Also pass the flags to 3rdparty libraries.
 CONFIGURE_ARGS="$CONFIGURE_ARGS CXXFLAGS='$CXXFLAGS'"
 
@@ -616,7 +631,11 @@ AX_PTHREAD([], [AC_MSG_ERROR([failed to find pthreads])])
 
 
 # Check for libunwind, and link it in if present.
-AC_CHECK_LIB(unwind, backtrace, LIBS="$LIBS -lunwind")
+if test "x$OS_NAME" = "xfreebsd"; then
+  AC_CHECK_LIB(execinfo, backtrace, LIBS="$LIBS -lexecinfo")
+else
+  AC_CHECK_LIB(unwind, backtrace, LIBS="$LIBS -lunwind")
+fi
 
 
 # Check if zlib prefix path was provided, and if so, add it to
@@ -992,6 +1011,16 @@ __EOF__
 	break;
       fi
     done
+  elif test "$OS_NAME" = "freebsd"; then
+    for arch in amd64 i386 arm; do
+      dir="$JAVA_HOME/jre/lib/$arch/server"
+      if test -e "$dir"; then
+	# Note that these are libtool specific flags.
+	JAVA_TEST_LDFLAGS="-L$dir -R$dir -Wl,-ljvm"
+	JAVA_JVM_LIBRARY=$dir/libjvm.so
+	break;
+      fi
+    done
   fi
 
   if test -z "$JAVA_TEST_LDFLAGS"; then

http://git-wip-us.apache.org/repos/asf/mesos/blob/6196fb42/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 9762f85..acd17de 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1757,7 +1757,11 @@ mesos_tests_CPPFLAGS += -DBUILD_DIR=\"$(abs_top_builddir)\"
 mesos_tests_CPPFLAGS += -I../$(GTEST)/include
 mesos_tests_CPPFLAGS += -I../$(GMOCK)/include
 
-mesos_tests_LDADD = ../$(LIBPROCESS)/3rdparty/libgmock.la libmesos.la -ldl $(LDADD)
+mesos_tests_LDADD = ../$(LIBPROCESS)/3rdparty/libgmock.la libmesos.la $(LDADD)
+
+if !OS_FREEBSD
+  mesos_tests_LDADD += -ldl # FreeBSD includes dynamic lib utils in libc.
+endif
 
 mesos_tests_DEPENDENCIES = # Initialized to allow += below.