一 过程
过程参考:https://wiki.strongswan.org/projects/strongswan/wiki/AndroidVPNClientBuild
1 准备工作:
安装所需要的软件包:参考:https://wiki.strongswan.org/projects/strongswan/repository/entry/HACKING
For interested developers, we have a public repository. To check out and compile
the code, you need the following tools:
- Git
- a recent GNU C compiler (>= 3.x)
- automake
- autoconf
- libtool
- pkg-config
- gettext
- perl
- python
- lex/flex
- yacc/bison
- gperf
注意:缺少一个软件包都不能编译成功
2 下载
1)下载strongswan:
路径下面两个都可以:
git://git.strongswan.org/strongswan.git
https://github.com/strongswan/strongswan/tree/master
git clone git://git.strongswan.org/strongswan.git
2)下载openssl:
我直接从其他地方下载的,复制到/strongswan/src/frontends/android/app/src/main/jni目录下
也可以按照文档中说的:
git clone git://git.strongswan.org/android-ndk-openssl.git -b ndk-static jni/openssl
3) 开始编译
cd strongswan
./autogen.sh
./configure
make dist编译成功后导入android studio中编译运行,在这个过程,我遇到了好多问题,主要原因都是第一步准备工作中的软件包没有下载完全。
二 问题
1 在android studio编译的时候报错:
1)缺少oid.h文件
Error:make: *** No rule to make target `/strongswan/src/front

本文档详细介绍了在Android上编译strongswan的完整过程,包括准备工作、下载strongswan和openssl源码,以及编译过程中可能遇到的错误和解决方法。在编译过程中,需要安装Git、GNU C编译器、automake、autoconf等工具,并解决automake库缺失、宏未定义等问题。此外,还提到了在android studio编译时的oid.h文件缺失问题及bison语法差异导致的编译错误。
最低0.47元/天 解锁文章
1874





