You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2018/08/31 19:52:10 UTC
[mesos] 02/07: Stout: Fixed standalone build with libarchive.
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit e4ea00def63c1b038e61dad33ed1be2d9e398eca
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Thu Aug 30 10:30:37 2018 -0700
Stout: Fixed standalone build with libarchive.
Review: https://reviews.apache.org/r/68577
---
3rdparty/stout/3rdparty/Makefile.am | 29 ++++++++++++++++++++++++++-
3rdparty/stout/configure.ac | 40 +++++++++++++++++++++++++++++++++++++
2 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/3rdparty/stout/3rdparty/Makefile.am b/3rdparty/stout/3rdparty/Makefile.am
index f51d7a0..5a88889 100644
--- a/3rdparty/stout/3rdparty/Makefile.am
+++ b/3rdparty/stout/3rdparty/Makefile.am
@@ -34,6 +34,7 @@ GLOG = glog-$(GLOG_VERSION)
GOOGLETEST = googletest-release-$(GOOGLETEST_VERSION)
GMOCK = $(GOOGLETEST)/googlemock
GTEST = $(GOOGLETEST)/googletest
+LIBARCHIVE = libarchive-$(LIBARCHIVE_VERSION)
PICOJSON = picojson-$(PICOJSON_VERSION)
PROTOBUF = protobuf-$(PROTOBUF_VERSION)
RAPIDJSON = rapidjson-$(RAPIDJSON_VERSION)
@@ -42,8 +43,9 @@ EXTRA_DIST = \
$(BOOST).tar.gz \
$(GLOG).tar.gz \
$(GOOGLETEST).tar.gz \
+ $(LIBARCHIVE).tar.gz \
$(PICOJSON).tar.gz \
- $(PROTOBUF).tar.gz
+ $(PROTOBUF).tar.gz \
$(RAPIDJSON).tar.gz
# We need to patch glog in order to deal with a compilation issue when
@@ -60,6 +62,7 @@ CLEAN_EXTRACTED = \
$(BOOST) \
$(GLOG) \
$(GMOCK) \
+ $(LIBARCHIVE) \
$(PICOJSON) \
$(RAPIDJSON) \
$(PROTOBUF)
@@ -135,6 +138,30 @@ $(GMOCK)-build-stamp: libgmock.la
ALL_LOCAL += $(GMOCK)-build-stamp
endif
+if WITH_BUNDLED_LIBARCHIVE
+LIB_LIBARCHIVE = $(LIBARCHIVE)/.libs/libarchive.la
+
+$(LIB_LIBARCHIVE): $(LIBARCHIVE)-build-stamp
+
+$(LIBARCHIVE)-build-stamp: $(LIBARCHIVE)-stamp
+ cd $(LIBARCHIVE) && \
+ ./configure $(CONFIGURE_ARGS) \
+ --without-bz2lib \
+ --without-cng \
+ --without-expat \
+ --without-iconv \
+ --without-libiconv-prefix \
+ --without-lz4 \
+ --without-lzma \
+ --without-nettle \
+ --without-openssl \
+ --without-xml2
+ cd $(LIBARCHIVE) && $(MAKE) $(AM_MAKEFLAGS)
+ touch $@
+
+ALL_LOCAL += $(LIB_LIBARCHIVE)
+endif
+
if LINKGTEST
libgmock_la_LIBADD = -lgtest
endif
diff --git a/3rdparty/stout/configure.ac b/3rdparty/stout/configure.ac
index 5de0eb0..6449686 100644
--- a/3rdparty/stout/configure.ac
+++ b/3rdparty/stout/configure.ac
@@ -141,6 +141,11 @@ AC_ARG_WITH([gmock],
location prefixed by the given path]),
[without_bundled_gmock=yes], [])
+AC_ARG_WITH([libarchive],
+ AS_HELP_STRING([--with-libarchive=@<:@=DIR@:>@],
+ [specify where to locate the libarchive library]),
+ [without_bundled_libarchive=yes], [])
+
AC_ARG_WITH([picojson],
AS_HELP_STRING([--with-picojson@<:@=DIR@:>@],
[excludes building and using the bundled picojson
@@ -450,6 +455,41 @@ AC_SUBST([GMOCKSRC])
AC_SUBST([GTESTSRC])
+# Check if user has asked us to use a preinstalled libarchive, or if
+# they asked us to ignore all bundled libraries while compiling and
+# linking.
+if test -n "`echo $with_libarchive`"; then
+ CPPFLAGS="$CPPFLAGS -I${with_libarchive}/include"
+ LDFLAGS="$LDFLAGS -L${with_libarchive}/lib"
+fi
+
+if test "x$without_bundled_libarchive" = "xyes" || \
+ test "x$enable_bundled" != "xyes"; then
+ # Check if headers and library were located.
+ AC_CHECK_HEADERS([archive.h], [found_libarchive=yes])
+
+ if test "x$found_libarchive" = "xyes"; then
+ with_bundled_libarchive=no
+ else
+ AC_MSG_ERROR([cannot find libarchive
+-------------------------------------------------------------------
+You have requested the use of a non-bundled libarchive but no suitable
+libarchive could be found.
+
+You may want specify the location of libarchive by providing a prefix
+path via --with-libarchive=DIR, or check that the path you provided is
+correct if you're already doing this.
+-------------------------------------------------------------------
+])
+ fi
+
+else
+ with_bundled_libarchive=yes
+fi
+
+AM_CONDITIONAL([WITH_BUNDLED_LIBARCHIVE], [test "x$with_bundled_libarchive" = "xyes"])
+
+
if test -n "`echo $with_picojson`"; then
CPPFLAGS="$CPPFLAGS -I${with_picojson}/include"
fi