Install libtls development headers
[strongswan.git] / Android.mk.in
index b63e0d3..a73981d 100644 (file)
@@ -1,12 +1,37 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
+# the executables that should be installed on the final system have to be added
+# to PRODUCT_PACKAGES in
+#   build/target/product/core.mk
+# possible executables are
+#   starter - allows to control and configure the daemon from the command line
+#   charon - the IKE daemon
+#   scepclient - SCEP client
+
+# if you enable starter or scepclient (see above) uncomment the proper
+# lines here
+# strongswan_BUILD_STARTER := true
+# strongswan_BUILD_SCEPCLIENT := true
+
 # this is the list of plugins that are built into libstrongswan and charon
 # also these plugins are loaded by default (if not changed in strongswan.conf)
-strongswan_PLUGINS := openssl fips-prf random pubkey pkcs1 \
+strongswan_CHARON_PLUGINS := openssl fips-prf random nonce pubkey pkcs1 \
        pem xcbc hmac kernel-netlink socket-default android \
        stroke eap-identity eap-mschapv2 eap-md5
 
+ifneq ($(strongswan_BUILD_SCEPCLIENT),)
+# plugins loaded by scepclient
+strongswan_SCEPCLIENT_PLUGINS := openssl curl fips-prf random pkcs1 pem
+endif
+
+strongswan_STARTER_PLUGINS := kernel-netlink
+
+# list of all plugins - used to enable them with the function below
+strongswan_PLUGINS := $(sort $(strongswan_CHARON_PLUGINS) \
+                            $(strongswan_STARTER_PLUGINS) \
+                            $(strongswan_SCEPCLIENT_PLUGINS))
+
 # helper macros to only add source files for plugins included in the list above
 # source files are relative to the android.mk that called the macro
 plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
@@ -23,6 +48,7 @@ add_plugin = $(if $(call plugin_enabled,$(1)), \
 # includes
 strongswan_PATH := $(LOCAL_PATH)
 libvstr_PATH := external/strongswan-support/vstr/include
+libcurl_PATH := external/strongswan-support/libcurl/include
 libgmp_PATH := external/strongswan-support/gmp
 
 # some definitions
@@ -56,15 +82,17 @@ strongswan_CFLAGS := \
        -DOPENSSL_NO_ECDSA \
        -DOPENSSL_NO_ECDH \
        -DOPENSSL_NO_ENGINE \
+       -DCONFIG_H_INCLUDED \
        -DCAPABILITIES \
        -DCAPABILITIES_NATIVE \
        -DMONOLITHIC \
+       -DUSE_IKEV1 \
+       -DUSE_IKEV2 \
        -DUSE_VSTR \
        -DDEBUG \
        -DROUTING_TABLE=0 \
        -DROUTING_TABLE_PRIO=220 \
        -DVERSION=\"$(strongswan_VERSION)\" \
-       -DPLUGINS='"$(strongswan_PLUGINS)"' \
        -DPLUGINDIR=\"$(strongswan_PLUGINDIR)\" \
        -DIPSEC_DIR=\"$(strongswan_DIR)\" \
        -DIPSEC_PIDDIR=\"$(strongswan_PIDDIR)\" \
@@ -77,15 +105,25 @@ strongswan_CFLAGS := \
 strongswan_CFLAGS += \
        -DHAVE_IN6ADDR_ANY
 
+strongswan_BUILD := \
+       charon \
+       libcharon \
+       libhydra \
+       libstrongswan \
+       libtncif \
+       libtnccs
+
+ifneq ($(strongswan_BUILD_STARTER),)
+strongswan_BUILD += \
+       starter \
+       stroke \
+       ipsec
+endif
+
+ifneq ($(strongswan_BUILD_SCEPCLIENT),)
+strongswan_BUILD += \
+       scepclient
+endif
+
 include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \
-               charon \
-               libcharon \
-               libhydra \
-               libstrongswan \
-               libtncif \
-               libfreeswan \
-               pluto \
-               stroke \
-               starter \
-               ipsec \
-       ))
+               $(sort $(strongswan_BUILD))))