OpenSSL in Android 2.1+ lacks Elliptic Curve and ENGINE support.
[strongswan.git] / Android.mk.in
1 LOCAL_PATH := $(call my-dir)
2 include $(CLEAR_VARS)
3
4 # this is the list of plugins that are built into libstrongswan and charon
5 # also these plugins are loaded by default (if not changed in strongswan.conf)
6 strongswan_PLUGINS := openssl fips-prf random x509 pubkey pkcs1 \
7 pem xcbc hmac kernel-netlink socket-default android
8
9 # helper macros to only add source files for plugins included in the list above
10 # source files are relative to the android.mk that called the macro
11 plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
12 add_plugin = $(if $(call plugin_enabled,$(1)), \
13 $(patsubst $(LOCAL_PATH)/%,%, \
14 $(wildcard \
15 $(subst %,$(subst -,_,$(strip $(1))), \
16 $(LOCAL_PATH)/plugins/%/%*.c \
17 ) \
18 ) \
19 ) \
20 )
21
22 # includes
23 strongswan_PATH := $(LOCAL_PATH)
24 libvstr_PATH := external/strongswan-support/vstr/include
25 libgmp_PATH := external/strongswan-support/gmp
26
27 # CFLAGS (partially from a configure run using droid-gcc)
28 strongswan_CFLAGS := \
29 -Wno-format \
30 -Wno-pointer-sign \
31 -Wno-pointer-arith \
32 -Wno-sign-compare \
33 -Wno-strict-aliasing \
34 -DHAVE___BOOL \
35 -DHAVE_STDBOOL_H \
36 -DHAVE_ALLOCA_H \
37 -DHAVE_ALLOCA \
38 -DHAVE_CLOCK_GETTIME \
39 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
40 -DHAVE_PRCTL \
41 -DHAVE_LINUX_UDP_H \
42 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
43 -DHAVE_IPSEC_MODE_BEET \
44 -DHAVE_IPSEC_DIR_FWD \
45 -DOPENSSL_NO_EC \
46 -DOPENSSL_NO_ECDSA \
47 -DOPENSSL_NO_ECDH \
48 -DOPENSSL_NO_ENGINE \
49 -DCAPABILITIES \
50 -DCAPABILITIES_NATIVE \
51 -DMONOLITHIC \
52 -DUSE_VSTR \
53 -DROUTING_TABLE=0 \
54 -DROUTING_TABLE_PRIO=220 \
55 -DVERSION=\"@PACKAGE_VERSION@\" \
56 -DPLUGINS='"$(strongswan_PLUGINS)"' \
57 -DIPSEC_DIR=\"/system/bin\" \
58 -DIPSEC_PIDDIR=\"/data/misc/vpn\" \
59 -DSTRONGSWAN_CONF=\"/system/etc/strongswan.conf\" \
60 -DDEV_RANDOM=\"/dev/random\" \
61 -DDEV_URANDOM=\"/dev/urandom\"
62
63 # only for Android 2.0+
64 strongswan_CFLAGS += \
65 -DHAVE_IN6ADDR_ANY
66
67 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
68 charon \
69 libcharon \
70 libhydra \
71 libstrongswan \
72 ))