]> git.ipfire.org Git - thirdparty/strongswan.git/blame - Android.mk.in
updated tnc-pdp plugin for 5.0.0
[thirdparty/strongswan.git] / Android.mk.in
CommitLineData
1be32988
TB
1LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3
2e0b478a
TB
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
1cde0a51 11
2e0b478a
TB
12# if you enable starter and/or pluto (see above) uncomment the proper lines here
13# strongswan_BUILD_STARTER := true
fe11d4bd 14# strongswan_BUILD_PLUTO := true
0ad58f01 15
1be32988
TB
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)
9227a3b3 18strongswan_CHARON_PLUGINS := openssl fips-prf random pubkey pkcs1 \
c177076b 19 pem xcbc hmac kernel-netlink socket-default android \
635724f6 20 stroke eap-identity eap-mschapv2 eap-md5
1be32988 21
0ad58f01
TB
22ifneq ($(strongswan_BUILD_PLUTO),)
23# if both daemons are enabled we use raw sockets in charon
24strongswan_CHARON_PLUGINS := $(subst socket-default,socket-raw, \
25 $(strongswan_CHARON_PLUGINS))
9227a3b3
TB
26# plugins loaded by pluto
27strongswan_PLUTO_PLUGINS := openssl fips-prf random pubkey pkcs1 \
28 pem xcbc hmac kernel-netlink xauth
0ad58f01 29endif
9227a3b3 30
bb3357e8
TB
31strongswan_STARTER_PLUGINS := kernel-netlink
32
9227a3b3
TB
33# list of all plugins - used to enable them with the function below
34strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
bb3357e8
TB
35 $(strongswan_PLUTO_PLUGINS) \
36 $(strongswan_STARTER_PLUGINS))
9227a3b3 37
1be32988 38# helper macros to only add source files for plugins included in the list above
0f5a0439 39# source files are relative to the android.mk that called the macro
1be32988
TB
40plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
41add_plugin = $(if $(call plugin_enabled,$(1)), \
0f5a0439
TB
42 $(patsubst $(LOCAL_PATH)/%,%, \
43 $(wildcard \
e3dd6b14
TB
44 $(subst %,$(subst -,_,$(strip $(1))), \
45 $(LOCAL_PATH)/plugins/%/%*.c \
46 ) \
0f5a0439
TB
47 ) \
48 ) \
49 )
1be32988
TB
50
51# includes
551b0202
TB
52strongswan_PATH := $(LOCAL_PATH)
53libvstr_PATH := external/strongswan-support/vstr/include
54libgmp_PATH := external/strongswan-support/gmp
1be32988 55
eae49aff
TB
56# some definitions
57strongswan_VERSION := "@PACKAGE_VERSION@"
58strongswan_DIR := "/system/bin"
59strongswan_SBINDIR := "/system/bin"
60strongswan_PIDDIR := "/data/misc/vpn"
61strongswan_PLUGINDIR := "$(strongswan_IPSEC_DIR)/ipsec"
62strongswan_CONFDIR := "/system/etc"
63strongswan_STRONGSWAN_CONF := "$(strongswan_CONFDIR)/strongswan.conf"
64
1be32988
TB
65# CFLAGS (partially from a configure run using droid-gcc)
66strongswan_CFLAGS := \
67 -Wno-format \
68 -Wno-pointer-sign \
f9622e8c 69 -Wno-pointer-arith \
1be32988
TB
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 \
61c950d9
TB
83 -DOPENSSL_NO_EC \
84 -DOPENSSL_NO_ECDSA \
85 -DOPENSSL_NO_ECDH \
86 -DOPENSSL_NO_ENGINE \
946be4d3
TB
87 -DCAPABILITIES \
88 -DCAPABILITIES_NATIVE \
1be32988
TB
89 -DMONOLITHIC \
90 -DUSE_VSTR \
b66a3b3d 91 -DDEBUG \
1be32988
TB
92 -DROUTING_TABLE=0 \
93 -DROUTING_TABLE_PRIO=220 \
eae49aff 94 -DVERSION=\"$(strongswan_VERSION)\" \
eae49aff
TB
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)\" \
1be32988
TB
100 -DDEV_RANDOM=\"/dev/random\" \
101 -DDEV_URANDOM=\"/dev/urandom\"
102
103# only for Android 2.0+
104strongswan_CFLAGS += \
105 -DHAVE_IN6ADDR_ANY
106
1cde0a51
TB
107strongswan_BUILD := \
108 charon \
109 libcharon \
110 libhydra \
111 libstrongswan \
ba5b559b
TB
112 libtncif \
113 libtnccs
1cde0a51
TB
114
115ifneq ($(strongswan_BUILD_STARTER),)
116strongswan_BUILD += \
117 libfreeswan \
118 starter \
119 stroke \
120 ipsec
121endif
122
123ifneq ($(strongswan_BUILD_PLUTO),)
124strongswan_BUILD += \
125 libfreeswan \
126 pluto \
127 whack
128endif
129
1be32988 130include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
1cde0a51 131 $(sort $(strongswan_BUILD))))