1#!/bin/bash
2# Copyright 2016 The Weave Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Make libevhtp.
7# Example uses libevhtp to implement HTTPS server. This step could be
8# replaced with apt-get in future (Debian jessie, Ubuntu vivid).
9cd $(dirname "$0")
10THIRD_PARTY=$(pwd)
11
12LIBEVHTP_VERSION=1.2.11n
13
14mkdir -p include lib
15
16rm -rf $THIRD_PARTY/libevhtp
17curl -L https://github.com/ellzey/libevhtp/archive/$LIBEVHTP_VERSION.tar.gz | tar xz || exit 1
18mv libevhtp-$LIBEVHTP_VERSION $THIRD_PARTY/libevhtp || exit 1
19cd $THIRD_PARTY/libevhtp || exit 1
20
21cmake -D EVHTP_DISABLE_REGEX:BOOL=ON . || exit 1
22make evhtp || exit 1
23
24cp -rf *.h $THIRD_PARTY/include/ || exit 1
25cp -f libevhtp.a $THIRD_PARTY/lib/ || exit 1
26
27rm -rf $THIRD_PARTY/libevhtp
28