1#
2# These flags represent the build-time configuration of OpenSSL for android
3#
4# The value of $(openssl_cflags) was pruned from the Makefile generated
5# by running ./Configure from import_openssl.sh.
6#
7# This script performs minor but required patching for the Android build.
8#
9
10# Directories for ENGINE shared libraries
11openssl_cflags_32 += \
12  -DOPENSSLDIR="\"/system/lib/ssl\"" \
13  -DENGINESDIR="\"/system/lib/ssl/engines\""
14openssl_cflags_static_32 += \
15  -DOPENSSLDIR="\"/system/lib/ssl\"" \
16  -DENGINESDIR="\"/system/lib/ssl/engines\""
17openssl_cflags_64 += \
18  -DOPENSSLDIR="\"/system/lib64/ssl\"" \
19  -DENGINESDIR="\"/system/lib64/ssl/engines\""
20openssl_cflags_static_64 += \
21  -DOPENSSLDIR="\"/system/lib64/ssl\"" \
22  -DENGINESDIR="\"/system/lib64/ssl/engines\""
23
24# Intentionally excluded http://b/7079965
25ifneq (,$(filter -DZLIB, $(openssl_cflags_32) $(openssl_cflags_64) \
26    $(openssl_cflags_static_32) $(openssl_cflags_static_64)))
27$(error ZLIB should not be enabled in openssl configuration)
28endif
29
30LOCAL_CFLAGS_32 += $(openssl_cflags_32)
31LOCAL_CFLAGS_64 += $(openssl_cflags_64)
32
33LOCAL_CFLAGS_32 := $(filter-out -DTERMIO, $(LOCAL_CFLAGS_32))
34LOCAL_CFLAGS_64 := $(filter-out -DTERMIO, $(LOCAL_CFLAGS_64))
35# filter out static flags too
36openssl_cflags_static_32 := $(filter-out -DTERMIO, $(openssl_cflags_static_32))
37openssl_cflags_static_64 := $(filter-out -DTERMIO, $(openssl_cflags_static_64))
38
39ifeq ($(HOST_OS),windows)
40LOCAL_CFLAGS_32 := $(filter-out -DDSO_DLFCN -DHAVE_DLFCN_H,$(LOCAL_CFLAGS_32))
41LOCAL_CFLAGS_64 := $(filter-out -DDSO_DLFCN -DHAVE_DLFCN_H,$(LOCAL_CFLAGS_64))
42endif
43
44LOCAL_CFLAGS += -Wno-missing-field-initializers -Wno-unused-parameter
45
46# Debug
47# LOCAL_CFLAGS += -DCIPHER_DEBUG
48
49# Add clang here when it works on host
50# LOCAL_CLANG := true
51