diff options
author | Jacob Marble <jacobmarble@google.com> | 2016-01-28 10:29:23 -0800 |
---|---|---|
committer | Jacob Marble <jacobmarble@google.com> | 2016-01-30 05:30:39 +0000 |
commit | 331355869fb6f8e11427f35807b7c310ec7743ca (patch) | |
tree | d5e87ffc5c6622283b3f0ac915d3845231e773ff /third_party | |
parent | 919a8a9908cd48271a0b3e6afa5a444d912459e2 (diff) | |
download | libweave-331355869fb6f8e11427f35807b7c310ec7743ca.tar.gz |
Replace bleeding-edge libevent with libevhtp.
A libevhtp package exists for recent releases of Linux distros. An
exception for these will come in a future patch.
Change-Id: I15b96be469b91f19c06c326fc52b42027c097df9
Bug: 26850406
Bug: 24204638
Reviewed-on: https://weave-review.googlesource.com/2384
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
Diffstat (limited to 'third_party')
-rwxr-xr-x | third_party/get_libevent.sh | 29 | ||||
-rwxr-xr-x | third_party/get_libevhtp.sh | 25 | ||||
-rw-r--r-- | third_party/third_party.mk | 24 |
3 files changed, 37 insertions, 41 deletions
diff --git a/third_party/get_libevent.sh b/third_party/get_libevent.sh deleted file mode 100755 index 9985bc0..0000000 --- a/third_party/get_libevent.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Copyright 2015 The Weave Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Make libevent. -# Example uses libevent to implement HTTPS server. This capability is -# available only in version 2.1.x-alpha. Step could be replaced with apt-get -# in future. -cd $(dirname "$0") -THIRD_PARTY=$(pwd) - -mkdir -p include lib - -rm -rf $THIRD_PARTY/libevent -git clone https://github.com/libevent/libevent.git || exit 1 -cd libevent || exit 1 - -./autogen.sh || exit 1 -./configure --disable-shared || exit 1 -make || exit 1 -if [ -z "$DISABLE_LIBEVENT_TEST" ]; then - echo -e "\n\nTesting libevent...\nCan take several minutes.\n" - make verify || exit 1 -fi -cp -rf include/*.h include/event2 $THIRD_PARTY/include/ || exit 1 -cp -f .libs/lib* $THIRD_PARTY/lib/ || exit 1 - -rm -rf $THIRD_PARTY/libevent diff --git a/third_party/get_libevhtp.sh b/third_party/get_libevhtp.sh new file mode 100755 index 0000000..c270813 --- /dev/null +++ b/third_party/get_libevhtp.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright 2016 The Weave Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Make libevhtp. +# Example uses libevhtp to implement HTTPS server. This step could be +# replaced with apt-get in future (Debian jessie, Ubuntu vivid). +cd $(dirname "$0") +THIRD_PARTY=$(pwd) + +mkdir -p include lib + +rm -rf $THIRD_PARTY/libevhtp +curl -L https://github.com/ellzey/libevhtp/archive/1.2.10.tar.gz | tar xz || exit 1 +mv libevhtp-1.2.10 $THIRD_PARTY/libevhtp || exit 1 +cd $THIRD_PARTY/libevhtp || exit 1 + +cmake -D EVHTP_DISABLE_REGEX:BOOL=ON . || exit 1 +make evhtp || exit 1 + +cp -rf evhtp-config.h evhtp.h evthr/evthr.h htparse/htparse.h $THIRD_PARTY/include/ || exit 1 +cp -f libevhtp.a $THIRD_PARTY/lib/ || exit 1 + +rm -rf $THIRD_PARTY/libevhtp diff --git a/third_party/third_party.mk b/third_party/third_party.mk index 8a11e2d..7f651a2 100644 --- a/third_party/third_party.mk +++ b/third_party/third_party.mk @@ -64,15 +64,15 @@ clean-gtest : rm -rf third_party/googletest ### -# libevent (third_party, downloaded on build) - -third_party/include/event2/event.h : - @echo Downloading and building libevent... - DISABLE_LIBEVENT_TEST=1 third_party/get_libevent.sh - @echo Finished downloading and building libevent. - -clean-libevent : - rm -rf third_party/include/ev* third_party/include/event2 - rm -rf third_party/lib/libevent* - rm -rf third_party/libevent - +# libevhtp (third_party, downloaded on build) + +third_party/lib/libevhtp.a : third_party/include/evhtp.h +third_party/include/evhtp.h : + @echo Downloading and building libevhtp... + third_party/get_libevhtp.sh + @echo Finished downloading and building libevhtp. + +clean-libevhtp : + rm -rf third_party/include/evhtp.h third_party/include/evhtp-config.h third_party/include/evthr.h third_party/include/htparse.h + rm -rf third_party/lib/libevhtp.a + rm -rf third_party/libevhtp |