Adding Android.mk files to build charon and libstrongswan with the Android build...
[strongswan.git] / Android.mk
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 := aes des sha1 sha2 md5 fips-prf random x509 pubkey pkcs1 \
7 pem xcbc hmac gmp kernel-netlink socket-default attr android
8
9 # helper macros to only add source files for plugins included in the list above
10 plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
11 add_plugin = $(if $(call plugin_enabled,$(1)), \
12 $(addprefix plugins/$(subst -,_,$(strip $(1))/),$(2)))
13
14 # includes
15 libvstr_PATH = external/strongswan-support/vstr/include
16 libgmp_PATH = external/strongswan-support/gmp
17
18 # CFLAGS (partially from a configure run using droid-gcc)
19 strongswan_CFLAGS := \
20 -Wno-format \
21 -Wno-pointer-sign \
22 -Wno-sign-compare \
23 -Wno-strict-aliasing \
24 -DHAVE___BOOL \
25 -DHAVE_STDBOOL_H \
26 -DHAVE_ALLOCA_H \
27 -DHAVE_ALLOCA \
28 -DHAVE_CLOCK_GETTIME \
29 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
30 -DHAVE_PRCTL \
31 -DHAVE_LINUX_UDP_H \
32 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
33 -DHAVE_IPSEC_MODE_BEET \
34 -DHAVE_IPSEC_DIR_FWD \
35 -DMONOLITHIC \
36 -DUSE_VSTR \
37 -DROUTING_TABLE=0 \
38 -DROUTING_TABLE_PRIO=220 \
39 -DVERSION=\"4.4.0\" \
40 -DPLUGINS='"$(strongswan_PLUGINS)"' \
41 -DIPSEC_DIR=\"/system/bin\" \
42 -DIPSEC_PIDDIR=\"/data/misc/vpn\" \
43 -DSTRONGSWAN_CONF=\"/system/etc/strongswan.conf\" \
44 -DDEV_RANDOM=\"/dev/random\" \
45 -DDEV_URANDOM=\"/dev/urandom\"
46
47 # only for Android 2.0+
48 strongswan_CFLAGS += \
49 -DHAVE_IN6ADDR_ANY
50
51 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
52 charon \
53 libstrongswan \
54 ))