Repository: mesos Updated Branches: refs/heads/master b10c9590a -> 73cd79584
Fixed libprocess protobuf library detection. Review: https://reviews.apache.org/r/39774 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6dbc99a8 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6dbc99a8 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6dbc99a8 Branch: refs/heads/master Commit: 6dbc99a87ede0648580ae00ac7c0e3b875cebadc Parents: b10c959 Author: James Peach <[email protected]> Authored: Thu Nov 5 23:25:25 2015 +0100 Committer: Till Toenshoff <[email protected]> Committed: Thu Nov 5 23:25:25 2015 +0100 ---------------------------------------------------------------------- 3rdparty/libprocess/configure.ac | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/6dbc99a8/3rdparty/libprocess/configure.ac ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/configure.ac b/3rdparty/libprocess/configure.ac index bdbb454..4080165 100644 --- a/3rdparty/libprocess/configure.ac +++ b/3rdparty/libprocess/configure.ac @@ -531,13 +531,20 @@ if test "x$without_bundled_protobuf" = "xyes" || \ PROTOBUFPREFIX="/usr" fi - # Check for protobuf. - # TODO(jieyu): Symbol _init is not available for libs on OS X. - # Consider checking lib using AX_CXX_CHECK_LIB. - AC_CHECK_HEADERS([google/protobuf/message.h], - [AC_CHECK_LIB([protobuf], - [_init], - [found_protobuf=yes])]) + AC_CHECK_HEADERS([google/protobuf/message.h], [found_protobuf=yes], + [found_protobuf=no]) + + if test "x$found_protobuf" = "xyes"; then + saved_LIBS="$LIBS" + LIBS="-lprotobuf $LIBS" + AC_LANG_PUSH([C++]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <google/protobuf/stubs/common.h>], + [ google::protobuf::ShutdownProtobufLibrary(); ])], + [ found_protobuf=yes ], + [ found_protobuf=no ]) + AC_LANG_POP() + LIBS="$saved_LIBS" + fi if test "x$found_protobuf" = "xyes"; then with_bundled_protobuf=no
