Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 1 | # 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 | |
| 5 | LOCAL_PATH := $(call my-dir) |
| 6 | |
| 7 | ## libcrypto |
| 8 | |
| 9 | # Target static library |
| 10 | include $(CLEAR_VARS) |
| 11 | LOCAL_MODULE_TAGS := optional |
| 12 | LOCAL_MODULE := libcrypto_static |
| 13 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 14 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk |
Adam Langley | 07f07a8 | 2015-02-13 14:47:24 -0800 | [diff] [blame] | 15 | LOCAL_SDK_VERSION := 9 |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 16 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Adam Langley | aae4cd2 | 2015-05-12 19:17:37 -0700 | [diff] [blame] | 17 | # sha256-armv4.S does not compile with clang. |
| 18 | LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as |
Dan Albert | e25abed | 2015-08-14 20:11:19 -0700 | [diff] [blame] | 19 | LOCAL_CLANG_ASFLAGS_arm64 += -march=armv8-a+crypto |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 20 | include $(LOCAL_PATH)/crypto-sources.mk |
| 21 | include $(BUILD_STATIC_LIBRARY) |
| 22 | |
| 23 | # Target shared library |
| 24 | include $(CLEAR_VARS) |
| 25 | LOCAL_MODULE_TAGS := optional |
| 26 | LOCAL_MODULE := libcrypto |
| 27 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 28 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 29 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Adam Langley | 07f07a8 | 2015-02-13 14:47:24 -0800 | [diff] [blame] | 30 | LOCAL_SDK_VERSION := 9 |
Adam Langley | aae4cd2 | 2015-05-12 19:17:37 -0700 | [diff] [blame] | 31 | # sha256-armv4.S does not compile with clang. |
| 32 | LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as |
Dan Albert | e25abed | 2015-08-14 20:11:19 -0700 | [diff] [blame] | 33 | LOCAL_CLANG_ASFLAGS_arm64 += -march=armv8-a+crypto |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 34 | include $(LOCAL_PATH)/crypto-sources.mk |
| 35 | include $(BUILD_SHARED_LIBRARY) |
| 36 | |
| 37 | # Target static tool |
| 38 | include $(CLEAR_VARS) |
| 39 | LOCAL_CFLAGS += -Wall -Werror -std=c++0x |
| 40 | LOCAL_CPP_EXTENSION := cc |
| 41 | LOCAL_MODULE := bssl |
| 42 | LOCAL_MODULE_TAGS := optional |
| 43 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 44 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 45 | LOCAL_SHARED_LIBRARIES=libcrypto libssl |
| 46 | include $(LOCAL_PATH)/sources.mk |
| 47 | LOCAL_SRC_FILES = $(tool_sources) |
| 48 | include $(BUILD_EXECUTABLE) |
| 49 | |
| 50 | # Host static library |
| 51 | include $(CLEAR_VARS) |
Dan Willemsen | 08656b6 | 2015-08-18 17:47:53 -0700 | [diff] [blame] | 52 | LOCAL_IS_HOST_MODULE := true |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 53 | LOCAL_MODULE := libcrypto_static |
Dan Willemsen | 08656b6 | 2015-08-18 17:47:53 -0700 | [diff] [blame] | 54 | LOCAL_MODULE_HOST_OS := darwin linux windows |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 55 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 56 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 57 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Kenny Root | 65073cf | 2015-12-04 12:52:23 -0800 | [diff] [blame] | 58 | LOCAL_CXX_STL := none |
Kenny Root | 7086cfc | 2015-03-04 16:00:41 -0800 | [diff] [blame] | 59 | # Windows and Macs both have problems with assembly files |
Dan Willemsen | 08656b6 | 2015-08-18 17:47:53 -0700 | [diff] [blame] | 60 | LOCAL_CFLAGS_darwin += -DOPENSSL_NO_ASM |
| 61 | LOCAL_CFLAGS_windows += -DOPENSSL_NO_ASM |
Alex Klyubin | 55181db | 2015-12-11 12:45:14 -0800 | [diff] [blame] | 62 | # 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. |
| 67 | LOCAL_SANITIZE := never |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 68 | include $(LOCAL_PATH)/crypto-sources.mk |
| 69 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 70 | |
| 71 | # Host shared library |
| 72 | include $(CLEAR_VARS) |
Dan Willemsen | 08656b6 | 2015-08-18 17:47:53 -0700 | [diff] [blame] | 73 | LOCAL_IS_HOST_MODULE := true |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 74 | LOCAL_MODULE := libcrypto-host |
| 75 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 76 | LOCAL_MULTILIB := both |
| 77 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 78 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Kenny Root | 7086cfc | 2015-03-04 16:00:41 -0800 | [diff] [blame] | 79 | # Windows and Macs both have problems with assembly files |
Dan Willemsen | 08656b6 | 2015-08-18 17:47:53 -0700 | [diff] [blame] | 80 | LOCAL_CFLAGS_darwin += -DOPENSSL_NO_ASM |
| 81 | LOCAL_CFLAGS_windows += -DOPENSSL_NO_ASM |
Kenny Root | 65073cf | 2015-12-04 12:52:23 -0800 | [diff] [blame] | 82 | LOCAL_LDLIBS_darwin := -lpthread |
| 83 | LOCAL_LDLIBS_linux := -lpthread |
| 84 | LOCAL_CXX_STL := none |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 85 | include $(LOCAL_PATH)/crypto-sources.mk |
| 86 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 87 | |
| 88 | |
| 89 | ## libssl |
| 90 | |
| 91 | # Target static library |
| 92 | include $(CLEAR_VARS) |
| 93 | LOCAL_MODULE_TAGS := optional |
| 94 | LOCAL_MODULE := libssl_static |
| 95 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 96 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk |
Adam Langley | 07f07a8 | 2015-02-13 14:47:24 -0800 | [diff] [blame] | 97 | LOCAL_SDK_VERSION := 9 |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 98 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 99 | include $(LOCAL_PATH)/ssl-sources.mk |
| 100 | include $(BUILD_STATIC_LIBRARY) |
| 101 | |
| 102 | # Target shared library |
| 103 | include $(CLEAR_VARS) |
| 104 | LOCAL_MODULE_TAGS := optional |
| 105 | LOCAL_MODULE := libssl |
| 106 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 107 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 108 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 109 | LOCAL_SHARED_LIBRARIES=libcrypto |
Adam Langley | 07f07a8 | 2015-02-13 14:47:24 -0800 | [diff] [blame] | 110 | LOCAL_SDK_VERSION := 9 |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 111 | include $(LOCAL_PATH)/ssl-sources.mk |
| 112 | include $(BUILD_SHARED_LIBRARY) |
| 113 | |
| 114 | # Host static library |
| 115 | include $(CLEAR_VARS) |
| 116 | LOCAL_MODULE_TAGS := optional |
| 117 | LOCAL_MODULE := libssl_static-host |
| 118 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 119 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 120 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Kenny Root | 65073cf | 2015-12-04 12:52:23 -0800 | [diff] [blame] | 121 | LOCAL_CXX_STL := none |
Alex Klyubin | 55181db | 2015-12-11 12:45:14 -0800 | [diff] [blame] | 122 | # 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. |
| 127 | LOCAL_SANITIZE := never |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 128 | include $(LOCAL_PATH)/ssl-sources.mk |
| 129 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 130 | |
Narayan Kamath | 71a0705 | 2015-06-24 10:35:36 +0100 | [diff] [blame] | 131 | # Host static tool (for linux only). |
| 132 | ifeq ($(HOST_OS), linux) |
| 133 | include $(CLEAR_VARS) |
| 134 | LOCAL_CFLAGS += -Wall -Werror -std=c++0x |
| 135 | LOCAL_CPP_EXTENSION := cc |
| 136 | LOCAL_MODULE := bssl |
| 137 | LOCAL_MODULE_TAGS := optional |
| 138 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 139 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Narayan Kamath | 71a0705 | 2015-06-24 10:35:36 +0100 | [diff] [blame] | 140 | LOCAL_SHARED_LIBRARIES=libcrypto-host libssl-host |
| 141 | # Needed for clock_gettime. |
| 142 | LOCAL_LDFLAGS := -lrt |
| 143 | include $(LOCAL_PATH)/sources.mk |
| 144 | LOCAL_SRC_FILES = $(tool_sources) |
| 145 | include $(BUILD_HOST_EXECUTABLE) |
| 146 | endif # HOST_OS == linux |
| 147 | |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 148 | # Host shared library |
| 149 | include $(CLEAR_VARS) |
| 150 | LOCAL_MODULE_TAGS := optional |
| 151 | LOCAL_MODULE := libssl-host |
| 152 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include |
| 153 | LOCAL_MULTILIB := both |
| 154 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk |
Kenny Root | e99801b | 2015-11-06 15:31:15 -0800 | [diff] [blame] | 155 | LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION -DOPENSSL_SMALL -Wno-unused-parameter |
Kenny Root | 65073cf | 2015-12-04 12:52:23 -0800 | [diff] [blame] | 156 | LOCAL_CXX_STL := none |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 157 | LOCAL_SHARED_LIBRARIES += libcrypto-host |
| 158 | include $(LOCAL_PATH)/ssl-sources.mk |
| 159 | include $(BUILD_HOST_SHARED_LIBRARY) |