You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/07/25 03:24:18 UTC

[02/10] mesos git commit: Added rapidjson to the stout build.

Added rapidjson to the stout build.

This follows the approach used for picojson.

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


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

Branch: refs/heads/master
Commit: 543161dac422a7965cdb34fe2b75fc42f32f3e96
Parents: 2cc0c1f
Author: Benjamin Mahler <bm...@apache.org>
Authored: Thu Jul 19 14:29:57 2018 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Tue Jul 24 17:23:46 2018 -0700

----------------------------------------------------------------------
 3rdparty/stout/3rdparty/Makefile.am |  7 ++++++
 3rdparty/stout/CMakeLists.txt       |  1 +
 3rdparty/stout/Makefile.am          |  7 ++++++
 3rdparty/stout/configure.ac         | 40 ++++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/543161da/3rdparty/stout/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/stout/3rdparty/Makefile.am b/3rdparty/stout/3rdparty/Makefile.am
index 53e389b..f51d7a0 100644
--- a/3rdparty/stout/3rdparty/Makefile.am
+++ b/3rdparty/stout/3rdparty/Makefile.am
@@ -36,6 +36,7 @@ GMOCK = $(GOOGLETEST)/googlemock
 GTEST = $(GOOGLETEST)/googletest
 PICOJSON = picojson-$(PICOJSON_VERSION)
 PROTOBUF = protobuf-$(PROTOBUF_VERSION)
+RAPIDJSON = rapidjson-$(RAPIDJSON_VERSION)
 
 EXTRA_DIST =		\
   $(BOOST).tar.gz	\
@@ -43,6 +44,7 @@ EXTRA_DIST =		\
   $(GOOGLETEST).tar.gz	\
   $(PICOJSON).tar.gz	\
   $(PROTOBUF).tar.gz
+  $(RAPIDJSON).tar.gz
 
 # We need to patch glog in order to deal with a compilation issue when
 # compiling with clang (and C++11); see MESOS-860, MESOS-966.
@@ -59,6 +61,7 @@ CLEAN_EXTRACTED =	\
   $(GLOG)		\
   $(GMOCK)		\
   $(PICOJSON)		\
+  $(RAPIDJSON)		\
   $(PROTOBUF)
 
 # This is where the magic happens: we use stamp files as dependencies
@@ -112,6 +115,10 @@ ALL_LOCAL += $(PROTOBUF)/src/libprotobuf.la
 ALL_LOCAL += $(PROTOBUF)/src/protoc
 endif
 
+if WITH_BUNDLED_RAPIDJSON
+ALL_LOCAL += $(RAPIDJSON)-stamp
+endif
+
 # Convenience library for gmock/gtest.
 check_LTLIBRARIES = libgmock.la
 nodist_libgmock_la_SOURCES = gmock_sources.cc

http://git-wip-us.apache.org/repos/asf/mesos/blob/543161da/3rdparty/stout/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/stout/CMakeLists.txt b/3rdparty/stout/CMakeLists.txt
index 371da47..3fd63dc 100644
--- a/3rdparty/stout/CMakeLists.txt
+++ b/3rdparty/stout/CMakeLists.txt
@@ -29,6 +29,7 @@ target_link_libraries(
   libcurl
   picojson
   protobuf
+  rapidjson
   Threads::Threads
   zlib
   $<$<PLATFORM_ID:Linux>:rt dl svn>

http://git-wip-us.apache.org/repos/asf/mesos/blob/543161da/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/stout/Makefile.am b/3rdparty/stout/Makefile.am
index ba032c1..743ae4d 100644
--- a/3rdparty/stout/Makefile.am
+++ b/3rdparty/stout/Makefile.am
@@ -56,6 +56,7 @@ GTEST = $(GOOGLETEST)/googletest
 LIBARCHIVE = $(BUNDLED_DIR)/libarchive-$(LIBARCHIVE_VERSION)
 PICOJSON = $(BUNDLED_DIR)/picojson-$(PICOJSON_VERSION)
 PROTOBUF = $(BUNDLED_DIR)/protobuf-$(PROTOBUF_VERSION)
+RAPIDJSON = $(BUNDLED_DIR)/rapidjson-$(RAPIDJSON_VERSION)
 
 # Dependencies for all-local.
 BUNDLED_DEPS = # Initialize BUNDLED_DEPS so we can add to it.
@@ -109,6 +110,11 @@ PICOJSON_INCLUDE_FLAGS += -I$(PICOJSON)
 BUNDLED_DEPS += $(PICOJSON)-stamp
 endif
 
+if WITH_BUNDLED_RAPIDJSON
+RAPIDJSON_INCLUDE_FLAGS = -I$(RAPIDJSON)/include
+BUNDLED_DEPS += $(RAPIDJSON)-stamp
+endif
+
 if WITH_BUNDLED_PROTOBUF
 PROTOBUF_INCLUDE_FLAGS = -I$(PROTOBUF)/src
 LIB_PROTOBUF = $(PROTOBUF)/src/libprotobuf.la
@@ -200,6 +206,7 @@ stout_tests_CPPFLAGS =			\
   $(LIBARCHIVE_INCLUDE_FLAGS)		\
   $(PICOJSON_INCLUDE_FLAGS)		\
   $(PROTOBUF_INCLUDE_FLAGS)		\
+  $(RAPIDJSON_INCLUDE_FLAGS)		\
   $(AM_CPPFLAGS)
 
 # The order of LDADD flags would matter if the same symbol is provided by

http://git-wip-us.apache.org/repos/asf/mesos/blob/543161da/3rdparty/stout/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/stout/configure.ac b/3rdparty/stout/configure.ac
index 7e85c7e..5de0eb0 100644
--- a/3rdparty/stout/configure.ac
+++ b/3rdparty/stout/configure.ac
@@ -148,6 +148,13 @@ AC_ARG_WITH([picojson],
                            location prefixed by the given path]),
             [without_bundled_picojson=yes], [])
 
+AC_ARG_WITH([rapidjson],
+            AS_HELP_STRING([--with-rapidjson@<:@=DIR@:>@],
+                           [excludes building and using the bundled rapidjson
+                           package in lieu of an installed version at a
+                           location prefixed by the given path]),
+            [without_bundled_rapidjson=yes], [])
+
 AC_ARG_WITH([protobuf],
             AS_HELP_STRING([--with-protobuf@<:@=DIR@:>@],
                            [excludes building and using the bundled protobuf
@@ -476,6 +483,39 @@ fi
 AM_CONDITIONAL([WITH_BUNDLED_PICOJSON], [test "x$with_bundled_picojson" = "xyes"])
 
 
+if test -n "`echo $with_rapidjson`"; then
+  CPPFLAGS="$CPPFLAGS -I${with_rapidjson}/include"
+fi
+
+# Check if user has asked us to use a preinstalled rapidjson, or if
+# they asked us to ignore all bundled libraries while compiling and
+# linking.
+if test "x$without_bundled_rapidjson" = "xyes" || \
+   test "x$enable_bundled" != "xyes"; then
+  # Check if headers and library were located.
+  AC_CHECK_HEADERS([rapidjson/rapidjson.h], [found_rapidjson=yes])
+
+  if test "x$found_rapidjson" = "xyes"; then
+    with_bundled_rapidjson=no
+  else
+    AC_MSG_ERROR([cannot find rapidjson
+-------------------------------------------------------------------
+You have requested the use of a non-bundled rapidjson but no suitable
+rapidjson could be found.
+
+You may want specify the location of rapidjson by providing a prefix
+path via --with-rapidjson=DIR, or check that the path you provided is
+correct if you're already doing this.
+-------------------------------------------------------------------
+])
+  fi
+else
+  with_bundled_rapidjson=yes
+fi
+
+AM_CONDITIONAL([WITH_BUNDLED_RAPIDJSON], [test "x$with_bundled_rapidjson" = "xyes"])
+
+
 if test -n "`echo $with_protobuf`"; then
   CPPFLAGS="$CPPFLAGS -I${with_protobuf}/include"
   LDFLAGS="$LDFLAGS -L${with_protobuf}/lib"