I tried to compile swiften (a XMPP client library) into a lib for Android JNI but failed. Is there anyone successed? Any suggestion would be appreciated.
I compiled swiften as follow steps:
- Downloaded swiften from http://swift.im/git/swift/commit/?id=13a3f7812520d44e374d7c391daf2128335ac067
- Do as follow document: http://swift.im/git/swift/commit/?h=sandbox/tobias/android&id=b8e69ea59b471e1aff9c8db06aceb7108db0657b
- since I only need swiften, so I compile as: ./scons Swiften target=android toolchain=/home/XXX/toolchain
Then I got follow problems:
- can't find cryptlib.c, so I downloaded openssl and this fixed.
- can't find arpa/nameser_compat.h. Then I copied this header files from /usr/include to tool-chain, and added #define BSD 199307 at the begining.
- can't find the declarations of res_init(), res_query(), dn_expand(), dn_skipname(). So I added the declarations.
And finally I got libSwiften.a which the size is 260M. And there are about 200 link errors:
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......