Don't invoke child_updown hook twice as responder
[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 IKEv2 daemon
10 # pluto - the IKEv1 daemon
11
12 # if you enable starter and/or pluto (see above) uncomment the proper lines here
13 # strongswan_BUILD_STARTER := true
14 # strongswan_BUILD_PLUTO := true
15
16 # this is the list of plugins that are built into libstrongswan and charon
17 # also these plugins are loaded by default (if not changed in strongswan.conf)
18 strongswan_CHARON_PLUGINS := openssl fips-prf random pubkey pkcs1 \
19 pem xcbc hmac kernel-netlink socket-default android \
20 stroke eap-identity eap-mschapv2 eap-md5
21
22 ifneq ($(strongswan_BUILD_PLUTO),)
23 # if both daemons are enabled we use raw sockets in charon
24 strongswan_CHARON_PLUGINS := $(subst socket-default,socket-raw, \
25 $(strongswan_CHARON_PLUGINS))
26 # plugins loaded by pluto
27 strongswan_PLUTO_PLUGINS := openssl fips-prf random pubkey pkcs1 \
28 pem xcbc hmac kernel-netlink xauth
29 endif
30
31 strongswan_STARTER_PLUGINS := kernel-netlink
32
33 # list of all plugins - used to enable them with the function below
34 strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
35 $(strongswan_PLUTO_PLUGINS) \
36 $(strongswan_STARTER_PLUGINS))
37
38 # helper macros to only add source files for plugins included in the list above
39 # source files are relative to the android.mk that called the macro
40 plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
41 add_plugin = $(if $(call plugin_enabled,$(1)), \
42 $(patsubst $(LOCAL_PATH)/%,%, \
43 $(wildcard \
44 $(subst %,$(subst -,_,$(strip $(1))), \
45 $(LOCAL_PATH)/plugins/%/%*.c \
46 ) \
47 ) \
48 ) \
49 )
50
51 # includes
52 strongswan_PATH := $(LOCAL_PATH)
53 libvstr_PATH := external/strongswan-support/vstr/include
54 libgmp_PATH := external/strongswan-support/gmp
55
56 # some definitions
57 strongswan_VERSION := "@PACKAGE_VERSION@"
58 strongswan_DIR := "/system/bin"
59 strongswan_SBINDIR := "/system/bin"
60 strongswan_PIDDIR := "/data/misc/vpn"
61 strongswan_PLUGINDIR := "$(strongswan_IPSEC_DIR)/ipsec"
62 strongswan_CONFDIR := "/system/etc"
63 strongswan_STRONGSWAN_CONF := "$(strongswan_CONFDIR)/strongswan.conf"
64
65 # CFLAGS (partially from a configure run using droid-gcc)
66 strongswan_CFLAGS := \
67 -Wno-format \
68 -Wno-pointer-sign \
69 -Wno-pointer-arith \
70 -Wno-sign-compare \
71 -Wno-strict-aliasing \
72 -DHAVE___BOOL \
73 -DHAVE_STDBOOL_H \
74 -DHAVE_ALLOCA_H \
75 -DHAVE_ALLOCA \
76 -DHAVE_CLOCK_GETTIME \
77 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
78 -DHAVE_PRCTL \
79 -DHAVE_LINUX_UDP_H \
80 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
81 -DHAVE_IPSEC_MODE_BEET \
82 -DHAVE_IPSEC_DIR_FWD \
83 -DOPENSSL_NO_EC \
84 -DOPENSSL_NO_ECDSA \
85 -DOPENSSL_NO_ECDH \
86 -DOPENSSL_NO_ENGINE \
87 -DCAPABILITIES \
88 -DCAPABILITIES_NATIVE \
89 -DMONOLITHIC \
90 -DUSE_VSTR \
91 -DDEBUG \
92 -DROUTING_TABLE=0 \
93 -DROUTING_TABLE_PRIO=220 \
94 -DVERSION=\"$(strongswan_VERSION)\" \
95 -DPLUGINDIR=\"$(strongswan_PLUGINDIR)\" \
96 -DIPSEC_DIR=\"$(strongswan_DIR)\" \
97 -DIPSEC_PIDDIR=\"$(strongswan_PIDDIR)\" \
98 -DIPSEC_CONFDIR=\"$(strongswan_CONFDIR)\" \
99 -DSTRONGSWAN_CONF=\"$(strongswan_STRONGSWAN_CONF)\" \
100 -DDEV_RANDOM=\"/dev/random\" \
101 -DDEV_URANDOM=\"/dev/urandom\"
102
103 # only for Android 2.0+
104 strongswan_CFLAGS += \
105 -DHAVE_IN6ADDR_ANY
106
107 strongswan_BUILD := \
108 charon \
109 libcharon \
110 libhydra \
111 libstrongswan \
112 libtncif \
113 libtnccs
114
115 ifneq ($(strongswan_BUILD_STARTER),)
116 strongswan_BUILD += \
117 libfreeswan \
118 starter \
119 stroke \
120 ipsec
121 endif
122
123 ifneq ($(strongswan_BUILD_PLUTO),)
124 strongswan_BUILD += \
125 libfreeswan \
126 pluto \
127 whack
128 endif
129
130 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
131 $(sort $(strongswan_BUILD))))