From 314076aefb59dcdd88beb6f23bff2d86c592ed88 Mon Sep 17 00:00:00 2001 From: ubuntu14 Date: Sun, 14 Aug 2016 20:48:30 +0800 Subject: [PATCH] polarssl will be compiled into acl by typing make build_one polarssl=on --- Makefile | 11 +++++++++++ lib_acl_cpp/Makefile | 14 ++++++++++++++ lib_acl_cpp/changes.txt | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/Makefile b/Makefile index 1fcb0e884..2f7bf5c2f 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ MAKE_ARGS = SYSLIB = -lpthread -lz LDFLAGS = -shared +polarssl = ifeq ($(CC),) CC = g++ @@ -43,6 +44,10 @@ ifeq ($(RANLIB),) RANLIB = ranlib endif +ifeq ($(findstring on, $(polarssl)), on) + CFLAGS += -DHAS_POLARSSL +endif + ifeq ($(findstring Linux, $(OSNAME)), Linux) ifeq ($(findstring i686, $(OSTYPE)), i686) RPATH = linux32 @@ -81,9 +86,15 @@ VERSION = 3.1.5 help: @(echo "usage: make help|all|all_lib|all_samples|clean|install|uninstall|uninstall_all|build_bin|build_src|build_one") all_lib: + @if test "$(polarssl)" = "on"; then \ + export ENV_FLAGS=$(ENV_FLAGS):HAS_POLARSSL; \ + else \ + export ENV_FLAGS=$(ENV_FLAGS); \ + fi @(cd lib_acl; make pch) @(cd lib_acl; make $(MAKE_ARGS)) @(cd lib_protocol; make $(MAKE_ARGS)) + @(cd lib_acl_cpp; make check) @(cd lib_acl_cpp; make pch) @(cd lib_acl_cpp; make $(MAKE_ARGS)) @(cd lib_rpc; make $(MAKE_ARGS)) diff --git a/lib_acl_cpp/Makefile b/lib_acl_cpp/Makefile index 50969ae99..c2d7917c1 100644 --- a/lib_acl_cpp/Makefile +++ b/lib_acl_cpp/Makefile @@ -36,6 +36,7 @@ SYSLIB = CHECKSYSRES = @echo "Unknow system type!";exit 1 UNIXNAME = $(shell uname -sm) UNIXTYPE = LINUX +polarssl = ifeq ($(CC),) CC = g++ @@ -51,6 +52,11 @@ endif ifeq ($(findstring HAS_POLARSSL, $(FLAGS)), HAS_POLARSSL) CFLAGS += -DHAS_POLARSSL + polarssl = on +endif + +ifeq ($(findstring on, $(polarssl)), on) + CFLAGS += -DHAS_POLARSSL endif ifeq ($(findstring clang++, $(CC)), clang++) @@ -221,6 +227,14 @@ shared: depends pch $(OBJS_DST) fi depends: $(OBJS_DEF) +check: + @if test -n $(polarssl) && test "$(polarssl)" = "on"; then \ + rm -f Debug/polarssl_io.o; \ + rm -f Debug/polarssl_conf.o; \ + rm -f Debug/polarssl_io.inc; \ + rm -f Debug/polarssl_conf.inc; \ + fi + pch: src/acl_stdafx.hpp rm -f $(PCH) @if test "$(UNIXTYPE)" = "LINUX" || test "$(UNIXTYPE)" = "FREEBSD" \ diff --git a/lib_acl_cpp/changes.txt b/lib_acl_cpp/changes.txt index 4c0634c4a..020a15a96 100644 --- a/lib_acl_cpp/changes.txt +++ b/lib_acl_cpp/changes.txt @@ -1,6 +1,10 @@ 修改历史列表: ----------------------------------------------------------------------- +433) 2016.8.14 +433.1) feature: Makefile 添加条件编译选项:允许在编译时以 make polarssl=on +方式将 POLARSSL 编译进去 + 432) 2016.7.29 432.1) feature: mime 类增加两个方法 get_plain_body/get_html_body 便于提取不同类型的 432.2) feature: json 增加对 double 类型的支持