From 67307ad7242274509b7331e97a3696808d5ad908 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 14 Jun 2012 18:35:58 +0200 Subject: [PATCH] scepclient: Added support to build it on Android --- Android.mk.in | 20 +++++++++++++++++--- src/scepclient/Android.mk | 27 +++++++++++++++++++++++++++ src/scepclient/Makefile.am | 3 ++- 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 src/scepclient/Android.mk diff --git a/Android.mk.in b/Android.mk.in index fe012ace8..40abc846c 100644 --- a/Android.mk.in +++ b/Android.mk.in @@ -5,11 +5,14 @@ include $(CLEAR_VARS) # to PRODUCT_PACKAGES in # build/target/product/core.mk # possible executables are -# starter - allows to control and configure the daemons from the command line +# starter - allows to control and configure the daemon from the command line # charon - the IKE daemon +# scepclient - SCEP client -# if you enable starter (see above) uncomment this line too +# 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) @@ -17,11 +20,17 @@ strongswan_CHARON_PLUGINS := openssl fips-prf random 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_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 @@ -109,5 +118,10 @@ strongswan_BUILD += \ ipsec endif +ifneq ($(strongswan_BUILD_SCEPCLIENT),) +strongswan_BUILD += \ + scepclient +endif + include $(addprefix $(LOCAL_PATH)/src/,$(addsuffix /Android.mk, \ $(sort $(strongswan_BUILD)))) diff --git a/src/scepclient/Android.mk b/src/scepclient/Android.mk new file mode 100644 index 000000000..ea637e78a --- /dev/null +++ b/src/scepclient/Android.mk @@ -0,0 +1,27 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +# copy-n-paste from Makefile.am +LOCAL_SRC_FILES := \ +scepclient.c scep.c scep.h + +# build scepclient ------------------------------------------------------------- + +LOCAL_C_INCLUDES += \ + $(libvstr_PATH) \ + $(strongswan_PATH)/src/libstrongswan + +LOCAL_CFLAGS := $(strongswan_CFLAGS) \ + -DPLUGINS='"$(strongswan_SCEPCLIENT_PLUGINS)"' + +LOCAL_MODULE := scepclient + +LOCAL_MODULE_TAGS := optional + +LOCAL_ARM_MODE := arm + +LOCAL_PRELINK_MODULE := false + +LOCAL_SHARED_LIBRARIES += libstrongswan + +include $(BUILD_EXECUTABLE) \ No newline at end of file diff --git a/src/scepclient/Makefile.am b/src/scepclient/Makefile.am index 7ddec6571..930f3dd80 100644 --- a/src/scepclient/Makefile.am +++ b/src/scepclient/Makefile.am @@ -1,5 +1,6 @@ ipsec_PROGRAMS = scepclient -scepclient_SOURCES = scepclient.c scep.c scep.h +scepclient_SOURCES = \ +scepclient.c scep.c scep.h scepclient.o : $(top_builddir)/config.status