You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2014/05/07 03:34:54 UTC
git commit: Enabled unbundled usage of http-parser.
Repository: mesos
Updated Branches:
refs/heads/master dff07a68a -> 0e9eded9d
Enabled unbundled usage of http-parser.
Updates libprocess configure check for http-parser to build against
system dependencies outlined in MESOS-1071 + fixes libprocess local
'make check' which was broken.
Review: https://reviews.apache.org/r/20983
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0e9eded9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0e9eded9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0e9eded9
Branch: refs/heads/master
Commit: 0e9eded9ddacc353a974dd700bef301905b3f9ae
Parents: dff07a6
Author: Timothy St. Clair <ts...@redhat.com>
Authored: Tue May 6 18:25:52 2014 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Tue May 6 18:30:11 2014 -0700
----------------------------------------------------------------------
3rdparty/libprocess/3rdparty/Makefile.am | 18 ++++++------
3rdparty/libprocess/Makefile.am | 20 ++++++++++---
3rdparty/libprocess/configure.ac | 41 +++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/0e9eded9/3rdparty/libprocess/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/Makefile.am b/3rdparty/libprocess/3rdparty/Makefile.am
index 4ddb6a5..1474bbc 100644
--- a/3rdparty/libprocess/3rdparty/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/Makefile.am
@@ -66,15 +66,16 @@ CLEAN_EXTRACTED = \
test ! -e $(srcdir)/$*.patch || patch -d $* -p1 <$(srcdir)/$*.patch
touch $@
+if WITH_BUNDLED_HTTP_PARSER
+ # Convenience library for Ryan Dahl's HTTP parser.
+ noinst_LTLIBRARIES = libry_http_parser.la
+ nodist_libry_http_parser_la_SOURCES = $(RY_HTTP_PARSER)/http_parser.c
+ libry_http_parser_la_CPPFLAGS = -I$(RY_HTTP_PARSER)
-# Convenience library for Ryan Dahl's HTTP parser.
-noinst_LTLIBRARIES = libry_http_parser.la
-nodist_libry_http_parser_la_SOURCES = $(RY_HTTP_PARSER)/http_parser.c
-libry_http_parser_la_CPPFLAGS = -I$(RY_HTTP_PARSER)
+ BUILT_SOURCES += $(nodist_libry_http_parser_la_SOURCES)
-# We list the sources in BUILT_SOURCES to make sure that the package
-# gets unarchived first.
-BUILT_SOURCES += $(nodist_libry_http_parser_la_SOURCES)
+ $(RY_HTTP_PARSER)/http_parser.c: $(RY_HTTP_PARSER)-stamp
+endif
# Convenience library for gmock/gtest.
@@ -123,9 +124,6 @@ $(PROTOBUF)-build-stamp: $(PROTOBUF)-stamp
$(MAKE) $(AM_MAKEFLAGS)
touch $@
-$(RY_HTTP_PARSER)/http_parser.c: $(RY_HTTP_PARSER)-stamp
-
-
# Tests for stout.
check_PROGRAMS = stout-tests
http://git-wip-us.apache.org/repos/asf/mesos/blob/0e9eded9/3rdparty/libprocess/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/Makefile.am b/3rdparty/libprocess/Makefile.am
index 8990f38..fa9b4fd 100644
--- a/3rdparty/libprocess/Makefile.am
+++ b/3rdparty/libprocess/Makefile.am
@@ -15,7 +15,6 @@ GLOG = 3rdparty/glog-$(GLOG_VERSION)
GMOCK = 3rdparty/gmock-$(GMOCK_VERSION)
GPERFTOOLS = 3rdparty/gperftools-$(GPERFTOOLS_VERSION)
GTEST = $(GMOCK)/gtest
-RY_HTTP_PARSER = 3rdparty/ry-http-parser-$(RY_HTTP_PARSER_VERSION)
LIBEV = 3rdparty/libev-$(LIBEV_VERSION)
PICOJSON = 3rdparty/picojson-$(PICOJSON_VERSION)
@@ -47,14 +46,22 @@ libprocess_la_CPPFLAGS = \
-I$(srcdir)/$(STOUT)/include \
-I$(BOOST) \
-I$(GLOG)/src \
- -I$(RY_HTTP_PARSER) \
-I$(LIBEV) \
-I$(PICOJSON) \
$(AM_CPPFLAGS)
+if WITH_BUNDLED_HTTP_PARSER
+ RY_HTTP_PARSER = 3rdparty/ry-http-parser-$(RY_HTTP_PARSER_VERSION)
+ libprocess_la_CPPFLAGS += -I$(RY_HTTP_PARSER)
+
+ HTTP_PARSER_LIB = 3rdparty/libry_http_parser.la
+else
+ HTTP_PARSER_LIB = -lhttp_parser
+endif
+
libprocess_la_LIBADD = \
$(GLOG)/libglog.la \
- 3rdparty/libry_http_parser.la \
+ $(HTTP_PARSER_LIB) \
$(LIBEV)/libev.la
if HAS_GPERFTOOLS
@@ -149,7 +156,12 @@ tests_CPPFLAGS = \
-I$(GMOCK)/include \
$(libprocess_la_CPPFLAGS)
-tests_LDADD = 3rdparty/libgmock.la libprocess.la
+tests_LDADD = \
+ 3rdparty/libgmock.la \
+ libprocess.la \
+ $(GLOG)/libglog.la \
+ $(HTTP_PARSER_LIB) \
+ $(LIBEV)/libev.la
# We use a check-local target for now to avoid the parallel test
# runner that ships with newer versions of autotools.
http://git-wip-us.apache.org/repos/asf/mesos/blob/0e9eded9/3rdparty/libprocess/configure.ac
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/configure.ac b/3rdparty/libprocess/configure.ac
index a32c479..27c6ede 100644
--- a/3rdparty/libprocess/configure.ac
+++ b/3rdparty/libprocess/configure.ac
@@ -77,6 +77,13 @@ AC_ARG_WITH([boost],
location prefixed by the given path]),
[without_bundled_boost=yes], [])
+AC_ARG_WITH([http-parser],
+ AS_HELP_STRING([--with-http-parser@<:@=DIR@:>@],
+ [excludes building and using the bundled http-parser
+ package in lieu of an installed version at a
+ location prefixed by the given path]),
+ [without_bundled_http_parser=yes], [])
+
AC_ARG_WITH([zlib],
AS_HELP_STRING([--without-zlib],
[disables zlib compression, which means the webui
@@ -116,6 +123,10 @@ if test -n "`echo $with_boost`"; then
CPPFLAGS="$CPPFLAGS -I${with_boost}/include"
fi
+if test -n "`echo $with_http-parser`"; then
+ CPPFLAGS="$CPPFLAGS -I${with_http-parser}/include"
+fi
+
# Check if user has asked us to use a preinstalled Boost, or if they asked
# us to ignore all bundled libraries while compiling and linking.
if test "x$without_bundled_boost" = "xyes" || \
@@ -143,6 +154,36 @@ fi
AM_CONDITIONAL([WITH_BUNDLED_BOOST], [test "x$with_bundled_boost" = "xyes"])
+
+# Check if user has asked us to use a preinstalled http-parser, or if they asked
+# us to ignore all bundled libraries while compiling and linking.
+if test "x$without_bundled_http_parse" = "xyes" || \
+ test "x$enable_bundled" != "xyes"; then
+ # Check if headers and library were located.
+ AC_CHECK_HEADERS([http_parser.h], [found_http_parser=yes])
+
+ if test "x$found_http_parser" = "xyes"; then
+ with_bundled_http_parser=no
+ else
+ AC_MSG_ERROR([cannot find http-parser
+-------------------------------------------------------------------
+You have requested the use of a non-bundled http-parser but no suitable
+http-parser could be found.
+
+You may want specify the location of http-parser by providing a prefix
+path via --with-http-parser=DIR, or check that the path you provided is
+correct if you're already doing this.
+-------------------------------------------------------------------
+])
+ fi
+else
+ with_bundled_http_parser=yes
+fi
+
+AM_CONDITIONAL([WITH_BUNDLED_HTTP_PARSER],
+ [test "x$with_bundled_http_parser" = "xyes"])
+
+
# Default to gcc toolchain (we rely on some atomic builtins for now,
# that are also present with clang).
AC_PROG_CXX([g++])