我尝试将 swiften(一个 XMPP 客户端库)编译为 Android JNI 的库,但失败了。有人成功吗?任何建议将不胜感激。
我按照以下步骤编译了 swiften:
- 从http://swift.im/git/swift/commit/?id=13a3f7812520d44e374d7c391daf2128335ac067下载 swiften
- 执行以下文档:http ://swift.im/git/swift/commit/?h=sandbox/tobias/android&id=b8e69ea59b471e1aff9c8db06aceb7108db0657b
- 因为我只需要swiften,所以我编译为:./scons Swiften target=android toolchain=/home/XXX/toolchain
然后我遇到了以下问题:
- 找不到 cryptlib.c,所以我下载了 openssl 并修复了这个。
- 找不到 arpa/nameser_compat.h。然后我将这个头文件从 /usr/include 复制到工具链,并在开头添加了#define BSD 199307。
- 找不到 res_init()、res_query()、dn_expand()、dn_skipname() 的声明。所以我添加了声明。
最后我得到了大小为 260M 的 libSwiften.a。大约有200个链接错误:
AR Swiften/libSwiften.a
RANLIB Swiften/libSwiften.a
LINK Swiften/Examples/BenchTool/BenchTool
3rdParty/OpenSSL/openssl/crypto/objects/obj_dat.c:489: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/objects/obj_dat.c:579: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/objects/obj_dat.c:601: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/bio/bss_file.c:368: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/err/err.c:1104: error: undefined reference to 'BUF_strlcat'
3rdParty/OpenSSL/openssl/crypto/x509v3/v3_enum.c:94: error: undefined reference to 'BUF_strdup'
3rdParty/OpenSSL/openssl/crypto/x509v3/v3_purp.c:199: error: undefined reference to 'BUF_strdup'
3rdParty/OpenSSL/openssl/crypto/x509v3/v3_purp.c:200: error: undefined reference to 'BUF_strdup'
some more......