blob: 3e3ef2a41ff367f20adf763555111ab44aec4710 [file] [log] [blame]
Adam Langleyd9e397b2015-01-22 14:27:53 -08001# Note that some host libraries have the same module name as the target
2# libraries. This is currently needed to build, for example, adb. But it's
3# probably something that should be changed.
4
5LOCAL_PATH := $(call my-dir)
6
7## libcrypto
8
9# Target static library
10include $(CLEAR_VARS)
11LOCAL_MODULE_TAGS := optional
12LOCAL_MODULE := libcrypto_static
13LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
14LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk
Adam Langley07f07a82015-02-13 14:47:24 -080015LOCAL_SDK_VERSION := 9
Kenny Roote99801b2015-11-06 15:31:15 -080016LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Adam Langleyaae4cd22015-05-12 19:17:37 -070017# sha256-armv4.S does not compile with clang.
18LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
Dan Alberte25abed2015-08-14 20:11:19 -070019LOCAL_CLANG_ASFLAGS_arm64 += -march=armv8-a+crypto
Adam Langleyd9e397b2015-01-22 14:27:53 -080020include $(LOCAL_PATH)/crypto-sources.mk
21include $(BUILD_STATIC_LIBRARY)
22
23# Target shared library
24include $(CLEAR_VARS)
25LOCAL_MODULE_TAGS := optional
26LOCAL_MODULE := libcrypto
27LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
28LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -080029LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Adam Langley07f07a82015-02-13 14:47:24 -080030LOCAL_SDK_VERSION := 9
Adam Langleyaae4cd22015-05-12 19:17:37 -070031# sha256-armv4.S does not compile with clang.
32LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
Dan Alberte25abed2015-08-14 20:11:19 -070033LOCAL_CLANG_ASFLAGS_arm64 += -march=armv8-a+crypto
Adam Langleyd9e397b2015-01-22 14:27:53 -080034include $(LOCAL_PATH)/crypto-sources.mk
35include $(BUILD_SHARED_LIBRARY)
36
37# Target static tool
38include $(CLEAR_VARS)
39LOCAL_CFLAGS += -Wall -Werror -std=c++0x
40LOCAL_CPP_EXTENSION := cc
41LOCAL_MODULE := bssl
42LOCAL_MODULE_TAGS := optional
43LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -080044LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Adam Langleyd9e397b2015-01-22 14:27:53 -080045LOCAL_SHARED_LIBRARIES=libcrypto libssl
46include $(LOCAL_PATH)/sources.mk
47LOCAL_SRC_FILES = $(tool_sources)
48include $(BUILD_EXECUTABLE)
49
50# Host static library
51include $(CLEAR_VARS)
Dan Willemsen08656b62015-08-18 17:47:53 -070052LOCAL_IS_HOST_MODULE := true
Adam Langleyd9e397b2015-01-22 14:27:53 -080053LOCAL_MODULE := libcrypto_static
Dan Willemsen08656b62015-08-18 17:47:53 -070054LOCAL_MODULE_HOST_OS := darwin linux windows
Adam Langleyd9e397b2015-01-22 14:27:53 -080055LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
56LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -080057LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Kenny Root65073cf2015-12-04 12:52:23 -080058LOCAL_CXX_STL := none
Kenny Root7086cfc2015-03-04 16:00:41 -080059# Windows and Macs both have problems with assembly files
Dan Willemsen08656b62015-08-18 17:47:53 -070060LOCAL_CFLAGS_darwin += -DOPENSSL_NO_ASM
61LOCAL_CFLAGS_windows += -DOPENSSL_NO_ASM
Alex Klyubin55181db2015-12-11 12:45:14 -080062# TODO: b/26097626. ASAN breaks use of this library in JVM.
63# Re-enable sanitization when the issue with making clients of this library
64# preload ASAN runtime is resolved. Without that, clients are getting runtime
65# errors due to unresoled ASAN symbols, such as
66# __asan_option_detect_stack_use_after_return.
67LOCAL_SANITIZE := never
Adam Langleyd9e397b2015-01-22 14:27:53 -080068include $(LOCAL_PATH)/crypto-sources.mk
69include $(BUILD_HOST_STATIC_LIBRARY)
70
71# Host shared library
72include $(CLEAR_VARS)
Dan Willemsen08656b62015-08-18 17:47:53 -070073LOCAL_IS_HOST_MODULE := true
Adam Langleyd9e397b2015-01-22 14:27:53 -080074LOCAL_MODULE := libcrypto-host
75LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
76LOCAL_MULTILIB := both
77LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -080078LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Kenny Root7086cfc2015-03-04 16:00:41 -080079# Windows and Macs both have problems with assembly files
Dan Willemsen08656b62015-08-18 17:47:53 -070080LOCAL_CFLAGS_darwin += -DOPENSSL_NO_ASM
81LOCAL_CFLAGS_windows += -DOPENSSL_NO_ASM
Kenny Root65073cf2015-12-04 12:52:23 -080082LOCAL_LDLIBS_darwin := -lpthread
83LOCAL_LDLIBS_linux := -lpthread
84LOCAL_CXX_STL := none
Adam Langleyd9e397b2015-01-22 14:27:53 -080085include $(LOCAL_PATH)/crypto-sources.mk
86include $(BUILD_HOST_SHARED_LIBRARY)
87
88
89## libssl
90
91# Target static library
92include $(CLEAR_VARS)
93LOCAL_MODULE_TAGS := optional
94LOCAL_MODULE := libssl_static
95LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
96LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk
Adam Langley07f07a82015-02-13 14:47:24 -080097LOCAL_SDK_VERSION := 9
Kenny Roote99801b2015-11-06 15:31:15 -080098LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Adam Langleyd9e397b2015-01-22 14:27:53 -080099include $(LOCAL_PATH)/ssl-sources.mk
100include $(BUILD_STATIC_LIBRARY)
101
102# Target shared library
103include $(CLEAR_VARS)
104LOCAL_MODULE_TAGS := optional
105LOCAL_MODULE := libssl
106LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
107LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -0800108LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Adam Langleyd9e397b2015-01-22 14:27:53 -0800109LOCAL_SHARED_LIBRARIES=libcrypto
Adam Langley07f07a82015-02-13 14:47:24 -0800110LOCAL_SDK_VERSION := 9
Adam Langleyd9e397b2015-01-22 14:27:53 -0800111include $(LOCAL_PATH)/ssl-sources.mk
112include $(BUILD_SHARED_LIBRARY)
113
114# Host static library
115include $(CLEAR_VARS)
116LOCAL_MODULE_TAGS := optional
117LOCAL_MODULE := libssl_static-host
118LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
119LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -0800120LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Kenny Root65073cf2015-12-04 12:52:23 -0800121LOCAL_CXX_STL := none
Alex Klyubin55181db2015-12-11 12:45:14 -0800122# TODO: b/26097626. ASAN breaks use of this library in JVM.
123# Re-enable sanitization when the issue with making clients of this library
124# preload ASAN runtime is resolved. Without that, clients are getting runtime
125# errors due to unresoled ASAN symbols, such as
126# __asan_option_detect_stack_use_after_return.
127LOCAL_SANITIZE := never
Adam Langleyd9e397b2015-01-22 14:27:53 -0800128include $(LOCAL_PATH)/ssl-sources.mk
129include $(BUILD_HOST_STATIC_LIBRARY)
130
Narayan Kamath71a07052015-06-24 10:35:36 +0100131# Host static tool (for linux only).
132ifeq ($(HOST_OS), linux)
133include $(CLEAR_VARS)
134LOCAL_CFLAGS += -Wall -Werror -std=c++0x
135LOCAL_CPP_EXTENSION := cc
136LOCAL_MODULE := bssl
137LOCAL_MODULE_TAGS := optional
138LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -0800139LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Narayan Kamath71a07052015-06-24 10:35:36 +0100140LOCAL_SHARED_LIBRARIES=libcrypto-host libssl-host
141# Needed for clock_gettime.
142LOCAL_LDFLAGS := -lrt
143include $(LOCAL_PATH)/sources.mk
144LOCAL_SRC_FILES = $(tool_sources)
145include $(BUILD_HOST_EXECUTABLE)
146endif # HOST_OS == linux
147
Adam Langleyd9e397b2015-01-22 14:27:53 -0800148# Host shared library
149include $(CLEAR_VARS)
150LOCAL_MODULE_TAGS := optional
151LOCAL_MODULE := libssl-host
152LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include
153LOCAL_MULTILIB := both
154LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk
Kenny Roote99801b2015-11-06 15:31:15 -0800155LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter
Kenny Root65073cf2015-12-04 12:52:23 -0800156LOCAL_CXX_STL := none
Adam Langleyd9e397b2015-01-22 14:27:53 -0800157LOCAL_SHARED_LIBRARIES += libcrypto-host
158include $(LOCAL_PATH)/ssl-sources.mk
159include $(BUILD_HOST_SHARED_LIBRARY)