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