Adding support for the build of libcharon (and charon) on Android.
[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 := 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 strongswan_PATH := $(LOCAL_PATH)
16 libvstr_PATH := external/strongswan-support/vstr/include
17 libgmp_PATH := external/strongswan-support/gmp
18
19 # CFLAGS (partially from a configure run using droid-gcc)
20 strongswan_CFLAGS := \
21 -Wno-format \
22 -Wno-pointer-sign \
23 -Wno-pointer-arith \
24 -Wno-sign-compare \
25 -Wno-strict-aliasing \
26 -DHAVE___BOOL \
27 -DHAVE_STDBOOL_H \
28 -DHAVE_ALLOCA_H \
29 -DHAVE_ALLOCA \
30 -DHAVE_CLOCK_GETTIME \
31 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
32 -DHAVE_PRCTL \
33 -DHAVE_LINUX_UDP_H \
34 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
35 -DHAVE_IPSEC_MODE_BEET \
36 -DHAVE_IPSEC_DIR_FWD \
37 -DMONOLITHIC \
38 -DUSE_VSTR \
39 -DROUTING_TABLE=0 \
40 -DROUTING_TABLE_PRIO=220 \
41 -DVERSION=\"@PACKAGE_VERSION@\" \
42 -DPLUGINS='"$(strongswan_PLUGINS)"' \
43 -DIPSEC_DIR=\"/system/bin\" \
44 -DIPSEC_PIDDIR=\"/data/misc/vpn\" \
45 -DSTRONGSWAN_CONF=\"/system/etc/strongswan.conf\" \
46 -DDEV_RANDOM=\"/dev/random\" \
47 -DDEV_URANDOM=\"/dev/urandom\"
48
49 # only for Android 2.0+
50 strongswan_CFLAGS += \
51 -DHAVE_IN6ADDR_ANY
52
53 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
54 charon \
55 libcharon \
56 libstrongswan \
57 ))