diff options
author | Mike Frysinger <vapier@google.com> | 2016-03-18 16:49:05 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2016-03-24 16:18:17 +0000 |
commit | 5c2870f2620a7a7840d1e57a2a306ddaa67832af (patch) | |
tree | 069c5e2fc0f55d6a70558a552646096d6b3ab536 | |
parent | 3e4d883e3addbe43b656328e64bd0a88f6d9165d (diff) | |
download | libweave-5c2870f2620a7a7840d1e57a2a306ddaa67832af.tar.gz |
libevhtp: build checked out copy
Now that libevhtp is part of the manifest, build it directly and store
the results in out/.
This also deletes references to third_party/{include,lib} as they're
no longer needed.
BUG=b/27820899
TEST+`make` still works, as does the unittests
Change-Id: I6b1dd91cea0f152f8e79527e842add6a9d797a3c
Reviewed-on: https://weave-review.googlesource.com/3001
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | examples/examples.mk | 17 | ||||
-rw-r--r-- | tests.mk | 4 | ||||
-rwxr-xr-x | third_party/get_libevhtp.sh | 27 | ||||
-rw-r--r-- | third_party/third_party.mk | 21 |
7 files changed, 25 insertions, 49 deletions
@@ -1,8 +1,6 @@ *~ /out/ /third_party/cross -/third_party/include -/third_party/lib /third_party/libevhtp /third_party/googletest gomacc.lock @@ -15,7 +15,6 @@ INCLUDES := \ -I. \ -Iinclude \ -Ithird_party/chromium \ - -Ithird_party/include \ -Ithird_party/googletest/googletest/include \ -Ithird_party/googletest/googlemock/include \ -Ithird_party/libuweave \ @@ -88,7 +88,7 @@ sudo apt-get install \ - hostapd - libavahi-client-dev - libcurl4-openssl-dev - - libevhtp (included; see third_party/get_libevhtp.sh) + - libevhtp (included; see third_party/libevhtp/) - libevent-dev diff --git a/examples/examples.mk b/examples/examples.mk index af15d5c..48a1210 100644 --- a/examples/examples.mk +++ b/examples/examples.mk @@ -10,9 +10,15 @@ examples_provider_obj_files := $(EXAMPLES_PROVIDER_SRC_FILES:%.cc=out/$(BUILD_MO USE_INTERNAL_LIBEVHTP ?= 1 ifeq (1, $(USE_INTERNAL_LIBEVHTP)) -$(examples_provider_obj_files) : third_party/include/evhtp.h +LIBEVHTP_INCLUDES = -Ithird_party/libevhtp -I$(dir $(third_party_libevhtp_header)) +LIBEVHTP_HEADERS = $(third_party_libevhtp_header) +else +LIBEVHTP_INCLUDES = +LIBEVHTP_HEADERS = endif +$(examples_provider_obj_files) : $(LIBEVHTP_HEADERS) +$(examples_provider_obj_files) : INCLUDES += $(LIBEVHTP_INCLUDES) $(examples_provider_obj_files) : out/$(BUILD_MODE)/%.o : %.cc mkdir -p $(dir $@) $(CXX) $(DEFS_$(BUILD_MODE)) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $< @@ -31,17 +37,14 @@ EXAMPLES_DAEMON_SRC_FILES := \ examples_daemon_obj_files := $(EXAMPLES_DAEMON_SRC_FILES:%.cc=out/$(BUILD_MODE)/%.o) -ifeq (1, $(USE_INTERNAL_LIBEVHTP)) -$(examples_daemon_obj_files) : third_party/include/evhtp.h -endif - +$(examples_daemon_obj_files) : $(LIBEVHTP_HEADERS) +$(examples_daemon_obj_files) : INCLUDES += $(LIBEVHTP_INCLUDES) $(examples_daemon_obj_files) : out/$(BUILD_MODE)/%.o : %.cc mkdir -p $(dir $@) $(CXX) $(DEFS_$(BUILD_MODE)) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $< daemon_common_flags := \ -Wl,-rpath=out/$(BUILD_MODE)/ \ - -Lthird_party/lib \ -levent \ -levent_openssl \ -lpthread \ @@ -55,7 +58,7 @@ daemon_common_flags := \ daemon_deps := out/$(BUILD_MODE)/examples_provider.a out/$(BUILD_MODE)/libweave.so ifeq (1, $(USE_INTERNAL_LIBEVHTP)) -daemon_deps += third_party/lib/libevhtp.a +daemon_deps += $(third_party_libevhtp_lib) else daemon_common_flags += -levhtp endif @@ -37,7 +37,7 @@ out/$(BUILD_MODE)/libweave_testrunner : \ out/$(BUILD_MODE)/libweave-test.a \ $(third_party_gtest_lib) \ $(third_party_gmock_lib) - $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lpthread -lrt -Lthird_party/lib + $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lpthread -lrt test : out/$(BUILD_MODE)/libweave_testrunner $(TEST_ENV) $< $(TEST_FLAGS) @@ -58,7 +58,7 @@ out/$(BUILD_MODE)/libweave_exports_testrunner : \ out/$(BUILD_MODE)/src/test/weave_testrunner.o \ $(third_party_gtest_lib) \ $(third_party_gmock_lib) - $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lpthread -lrt -Lthird_party/lib -Wl,-rpath=out/$(BUILD_MODE)/ + $(CXX) -o $@ $^ $(CFLAGS) -lcrypto -lexpat -lpthread -lrt -Wl,-rpath=out/$(BUILD_MODE)/ export-test : out/$(BUILD_MODE)/libweave_exports_testrunner $(TEST_ENV) $< $(TEST_FLAGS) diff --git a/third_party/get_libevhtp.sh b/third_party/get_libevhtp.sh deleted file mode 100755 index cfcada9..0000000 --- a/third_party/get_libevhtp.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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) - -LIBEVHTP_VERSION=1.2.11n - -mkdir -p include lib - -rm -rf $THIRD_PARTY/libevhtp -curl -L https://github.com/ellzey/libevhtp/archive/$LIBEVHTP_VERSION.tar.gz | tar xz || exit 1 -mv libevhtp-$LIBEVHTP_VERSION $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 *.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 e53529b..18f9b98 100644 --- a/third_party/third_party.mk +++ b/third_party/third_party.mk @@ -79,15 +79,18 @@ clean-gtest : $(third_party_gtest_all) $(third_party_gmock_all) ### -# libevhtp (third_party, downloaded on build) +# libevhtp (third_party) -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. +third_party_libevhtp = out/$(BUILD_MODE)/third_party/libevhtp +third_party_libevhtp_lib = $(third_party_libevhtp)/libevhtp.a +third_party_libevhtp_header = $(third_party_libevhtp)/evhtp-config.h + +$(third_party_libevhtp_header) : + mkdir -p $(dir $@) + cd $(dir $@) && cmake -D EVHTP_DISABLE_REGEX:BOOL=ON $(PWD)/third_party/libevhtp + +$(third_party_libevhtp_lib) : $(third_party_libevhtp_header) + $(MAKE) -C $(third_party_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 + rm -rf $(third_party_libevhtp) |