Added support for the curl plugin on Android
[strongswan.git] / Android.mk.in
1 LOCAL_PATH := $(call my-dir)
2 include $(CLEAR_VARS)
3
4 # the executables that should be installed on the final system have to be added
5 # to PRODUCT_PACKAGES in
6 # build/target/product/core.mk
7 # possible executables are
8 # starter - allows to control and configure the daemons from the command line
9 # charon - the IKE daemon
10
11 # if you enable starter (see above) uncomment this line too
12 # strongswan_BUILD_STARTER := true
13
14 # this is the list of plugins that are built into libstrongswan and charon
15 # also these plugins are loaded by default (if not changed in strongswan.conf)
16 strongswan_CHARON_PLUGINS := openssl fips-prf random pubkey pkcs1 \
17 pem xcbc hmac kernel-netlink socket-default android \
18 stroke eap-identity eap-mschapv2 eap-md5
19
20 strongswan_STARTER_PLUGINS := kernel-netlink
21
22 # list of all plugins - used to enable them with the function below
23 strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
24 $(strongswan_STARTER_PLUGINS))
25
26 # helper macros to only add source files for plugins included in the list above
27 # source files are relative to the android.mk that called the macro
28 plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
29 add_plugin = $(if $(call plugin_enabled,$(1)), \
30 $(patsubst $(LOCAL_PATH)/%,%, \
31 $(wildcard \
32 $(subst %,$(subst -,_,$(strip $(1))), \
33 $(LOCAL_PATH)/plugins/%/%*.c \
34 ) \
35 ) \
36 ) \
37 )
38
39 # includes
40 strongswan_PATH := $(LOCAL_PATH)
41 libvstr_PATH := external/strongswan-support/vstr/include
42 libcurl_PATH := external/strongswan-support/libcurl/include
43 libgmp_PATH := external/strongswan-support/gmp
44
45 # some definitions
46 strongswan_VERSION := "@PACKAGE_VERSION@"
47 strongswan_DIR := "/system/bin"
48 strongswan_SBINDIR := "/system/bin"
49 strongswan_PIDDIR := "/data/misc/vpn"
50 strongswan_PLUGINDIR := "$(strongswan_IPSEC_DIR)/ipsec"
51 strongswan_CONFDIR := "/system/etc"
52 strongswan_STRONGSWAN_CONF := "$(strongswan_CONFDIR)/strongswan.conf"
53
54 # CFLAGS (partially from a configure run using droid-gcc)
55 strongswan_CFLAGS := \
56 -Wno-format \
57 -Wno-pointer-sign \
58 -Wno-pointer-arith \
59 -Wno-sign-compare \
60 -Wno-strict-aliasing \
61 -DHAVE___BOOL \
62 -DHAVE_STDBOOL_H \
63 -DHAVE_ALLOCA_H \
64 -DHAVE_ALLOCA \
65 -DHAVE_CLOCK_GETTIME \
66 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
67 -DHAVE_PRCTL \
68 -DHAVE_LINUX_UDP_H \
69 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
70 -DHAVE_IPSEC_MODE_BEET \
71 -DHAVE_IPSEC_DIR_FWD \
72 -DOPENSSL_NO_EC \
73 -DOPENSSL_NO_ECDSA \
74 -DOPENSSL_NO_ECDH \
75 -DOPENSSL_NO_ENGINE \
76 -DCAPABILITIES \
77 -DCAPABILITIES_NATIVE \
78 -DMONOLITHIC \
79 -DUSE_IKEV2 \
80 -DUSE_VSTR \
81 -DDEBUG \
82 -DROUTING_TABLE=0 \
83 -DROUTING_TABLE_PRIO=220 \
84 -DVERSION=\"$(strongswan_VERSION)\" \
85 -DPLUGINDIR=\"$(strongswan_PLUGINDIR)\" \
86 -DIPSEC_DIR=\"$(strongswan_DIR)\" \
87 -DIPSEC_PIDDIR=\"$(strongswan_PIDDIR)\" \
88 -DIPSEC_CONFDIR=\"$(strongswan_CONFDIR)\" \
89 -DSTRONGSWAN_CONF=\"$(strongswan_STRONGSWAN_CONF)\" \
90 -DDEV_RANDOM=\"/dev/random\" \
91 -DDEV_URANDOM=\"/dev/urandom\"
92
93 # only for Android 2.0+
94 strongswan_CFLAGS += \
95 -DHAVE_IN6ADDR_ANY
96
97 strongswan_BUILD := \
98 charon \
99 libcharon \
100 libhydra \
101 libstrongswan \
102 libtncif \
103 libtnccs
104
105 ifneq ($(strongswan_BUILD_STARTER),)
106 strongswan_BUILD += \
107 starter \
108 stroke \
109 ipsec
110 endif
111
112 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
113 $(sort $(strongswan_BUILD))))