From 602804efded144af970140446c5010aeacd5c4a5 Mon Sep 17 00:00:00 2001 From: Darren Krahn Date: Fri, 11 Dec 2015 16:59:38 -0800 Subject: Add libchrome-crypto to the Makefile. Also add minor fixes to get the build working with boringssl. BUG=25746269 Change-Id: I4af9850a48a813c1310d7eb7596f7ef79812a57e --- Android.mk | 33 ++++++++++++++++++++++++++++++--- crypto/scoped_openssl_types.h | 3 +++ crypto/secure_hash_openssl.cc | 1 + 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Android.mk b/Android.mk index 6828b6c386..3f8ebbac96 100644 --- a/Android.mk +++ b/Android.mk @@ -377,6 +377,10 @@ libchromeCommonUnittestSrc := \ testing/multiprocess_func_list.cc \ testrunner.cc \ +libchromeCryptoUnittestSrc := \ + crypto/secure_hash_unittest.cc \ + crypto/sha2_unittest.cc \ + libchromeHostCFlags := -D__ANDROID_HOST__ ifeq ($(HOST_OS),linux) @@ -445,7 +449,6 @@ LOCAL_SRC_FILES := \ dbus/values_util.cc \ LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension) -# webservd uses RTTI, so that this library also needs to be built with it. LOCAL_CFLAGS := $(libchromeCommonCFlags) LOCAL_CLANG := $(libchromeUseClang) LOCAL_C_INCLUDES := $(libchromeCommonCIncludes) @@ -460,6 +463,30 @@ include $(BUILD_SHARED_LIBRARY) endif # local_use_dbus == 1 +# libchrome-crypto shared library for target +# ======================================================== +include $(CLEAR_VARS) +LOCAL_MODULE := libchrome-crypto +LOCAL_SRC_FILES := \ + crypto/openssl_util.cc \ + crypto/secure_hash_openssl.cc \ + crypto/secure_util.cc \ + crypto/sha2.cc \ + +LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension) +LOCAL_CFLAGS := $(libchromeCommonCFlags) -Wno-unused-parameter +LOCAL_CPPFLAGS := $(libchromeCommonCppFlags) +LOCAL_CLANG := $(libchromeUseClang) +LOCAL_C_INCLUDES := $(libchromeCommonCIncludes) +LOCAL_SHARED_LIBRARIES := \ + libchrome \ + libcrypto \ + libssl \ + +LOCAL_STATIC_LIBRARIES := +LOCAL_EXPORT_C_INCLUDE_DIRS := $(libchromeExportedCIncludes) +include $(BUILD_SHARED_LIBRARY) + # Helpers needed for unit tests. # ======================================================== include $(CLEAR_VARS) @@ -540,11 +567,11 @@ LOCAL_MODULE := libchrome_test ifdef BRILLO LOCAL_MODULE_TAGS := debug endif -LOCAL_SRC_FILES := $(libchromeCommonUnittestSrc) +LOCAL_SRC_FILES := $(libchromeCryptoUnittestSrc) $(libchromeCommonUnittestSrc) LOCAL_CPP_EXTENSION := $(libchromeCommonCppExtension) LOCAL_CFLAGS := $(libchromeCommonCFlags) $(libchromeTestCFlags) -DUNIT_TEST -DDONT_EMBED_BUILD_METADATA LOCAL_CLANG := $(libchromeUseClang) LOCAL_C_INCLUDES := $(libchromeCommonCIncludes) -LOCAL_SHARED_LIBRARIES := libchrome libevent +LOCAL_SHARED_LIBRARIES := libchrome libchrome-crypto libevent LOCAL_STATIC_LIBRARIES := libgmock libgtest include $(BUILD_NATIVE_TEST) diff --git a/crypto/scoped_openssl_types.h b/crypto/scoped_openssl_types.h index e7b27deeae..33b618d1a3 100644 --- a/crypto/scoped_openssl_types.h +++ b/crypto/scoped_openssl_types.h @@ -11,6 +11,9 @@ #include #include #include +#ifdef OPENSSL_IS_BORINGSSL +#include +#endif #include #include diff --git a/crypto/secure_hash_openssl.cc b/crypto/secure_hash_openssl.cc index 6fede29d99..ec859ff108 100644 --- a/crypto/secure_hash_openssl.cc +++ b/crypto/secure_hash_openssl.cc @@ -4,6 +4,7 @@ #include "crypto/secure_hash.h" +#include #include #include -- cgit v1.2.3