]> git.ipfire.org Git - thirdparty/strongswan.git/blame - Android.mk.in
Check if config.h passed correctly via gcc -include
[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
67307ad7 8# starter - allows to control and configure the daemon from the command line
fff4b74d 9# charon - the IKE daemon
67307ad7 10# scepclient - SCEP client
1cde0a51 11
67307ad7
TB
12# if you enable starter or scepclient (see above) uncomment the proper
13# lines here
2e0b478a 14# strongswan_BUILD_STARTER := true
67307ad7 15# strongswan_BUILD_SCEPCLIENT := true
0ad58f01 16
1be32988
TB
17# this is the list of plugins that are built into libstrongswan and charon
18# also these plugins are loaded by default (if not changed in strongswan.conf)
43d01ab2 19strongswan_CHARON_PLUGINS := openssl fips-prf random nonce pubkey pkcs1 \
c177076b 20 pem xcbc hmac kernel-netlink socket-default android \
635724f6 21 stroke eap-identity eap-mschapv2 eap-md5
1be32988 22
67307ad7
TB
23ifneq ($(strongswan_BUILD_SCEPCLIENT),)
24# plugins loaded by scepclient
25strongswan_SCEPCLIENT_PLUGINS := openssl curl fips-prf random pkcs1 pem
26endif
27
bb3357e8
TB
28strongswan_STARTER_PLUGINS := kernel-netlink
29
9227a3b3
TB
30# list of all plugins - used to enable them with the function below
31strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
67307ad7
TB
32 $(strongswan_STARTER_PLUGINS) \
33 $(strongswan_SCEPCLIENT_PLUGINS))
9227a3b3 34
1be32988 35# helper macros to only add source files for plugins included in the list above
0f5a0439 36# source files are relative to the android.mk that called the macro
1be32988
TB
37plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
38add_plugin = $(if $(call plugin_enabled,$(1)), \
0f5a0439
TB
39 $(patsubst $(LOCAL_PATH)/%,%, \
40 $(wildcard \
e3dd6b14
TB
41 $(subst %,$(subst -,_,$(strip $(1))), \
42 $(LOCAL_PATH)/plugins/%/%*.c \
43 ) \
0f5a0439
TB
44 ) \
45 ) \
46 )
1be32988
TB
47
48# includes
551b0202
TB
49strongswan_PATH := $(LOCAL_PATH)
50libvstr_PATH := external/strongswan-support/vstr/include
197dbf5f 51libcurl_PATH := external/strongswan-support/libcurl/include
551b0202 52libgmp_PATH := external/strongswan-support/gmp
1be32988 53
eae49aff
TB
54# some definitions
55strongswan_VERSION := "@PACKAGE_VERSION@"
56strongswan_DIR := "/system/bin"
57strongswan_SBINDIR := "/system/bin"
58strongswan_PIDDIR := "/data/misc/vpn"
59strongswan_PLUGINDIR := "$(strongswan_IPSEC_DIR)/ipsec"
60strongswan_CONFDIR := "/system/etc"
61strongswan_STRONGSWAN_CONF := "$(strongswan_CONFDIR)/strongswan.conf"
62
1be32988
TB
63# CFLAGS (partially from a configure run using droid-gcc)
64strongswan_CFLAGS := \
65 -Wno-format \
66 -Wno-pointer-sign \
f9622e8c 67 -Wno-pointer-arith \
1be32988
TB
68 -Wno-sign-compare \
69 -Wno-strict-aliasing \
70 -DHAVE___BOOL \
71 -DHAVE_STDBOOL_H \
72 -DHAVE_ALLOCA_H \
73 -DHAVE_ALLOCA \
74 -DHAVE_CLOCK_GETTIME \
75 -DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC \
76 -DHAVE_PRCTL \
77 -DHAVE_LINUX_UDP_H \
78 -DHAVE_STRUCT_SADB_X_POLICY_SADB_X_POLICY_PRIORITY \
79 -DHAVE_IPSEC_MODE_BEET \
80 -DHAVE_IPSEC_DIR_FWD \
61c950d9
TB
81 -DOPENSSL_NO_EC \
82 -DOPENSSL_NO_ECDSA \
83 -DOPENSSL_NO_ECDH \
84 -DOPENSSL_NO_ENGINE \
946be4d3
TB
85 -DCAPABILITIES \
86 -DCAPABILITIES_NATIVE \
1be32988 87 -DMONOLITHIC \
9866c26c 88 -DUSE_IKEV1 \
088020fb 89 -DUSE_IKEV2 \
1be32988 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 += \
1cde0a51
TB
117 starter \
118 stroke \
119 ipsec
120endif
121
67307ad7
TB
122ifneq ($(strongswan_BUILD_SCEPCLIENT),)
123strongswan_BUILD += \
124 scepclient
125endif
126
1be32988 127include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
1cde0a51 128 $(sort $(strongswan_BUILD))))