Reputation: 255
Can somebody help me write Android.mk for LibXtract or point me in correct directoin?
Here is source for lib - https://github.com/jamiebullock/LibXtract.git
Or mayby there is a way to use linux generated shared objects in Android?
Upvotes: 2
Views: 1026
Reputation: 4462
The answer to this question says you could use cmake script to build Android.mk
files - I have not tried this approach.
Upvotes: 0
Reputation: 4462
Especially for bigger established projects, crafting Android.mk
files is quite an effort. More so, if you are not familiar with Android NDK build architecture whose understanding requires digging deep into the documentation and Android NDK make files. I would suggest trying to use existing make files by setting CC
to point to your NDK tool chain, and CFLAGS += -sysroot $(SYSROOT)
where SYSROOT=${NDK_INSTALL_DIR}/platforms/android-<level>/arch-<arch>/
(depending on targeted Android API version and architecture). Even without knowing about your library, I would bet you should have good chance of success this way. Android NDK documentation (${NDK_INSTALL_DIR}/doc/STANDALONE-TOOLCHAIN.html
) details the use of independent tool chain and also instructs how to create a standalone tool chain that will not require the use of -sysroot
argument to xxx-gcc
.
If you decide to use Android.mk
instead, you might check existing projects -CSipSimple comes to my mind (PJSIP converted from standard form GNU make files).
Important is to create the shared objects using Android tool chains. It is possible to build them outside of your application source tree, and then just copy the shared objects into the package source libs/<architecture>/
directory.
Integration with your build system depends on details that are not known (including how smooth you desire this whole integration to be e.g. because of other people working with the same project). If you are creating an application from command line, the easiest would be to have GNU make file or shell script in the package root directory ensure libXtract.so
and your application package is up-to-date by calling libXtract make file and
ant to build and pack your Java application. If you are using ant
there should be a way to specify using make
to take care of libXtract.so
. I am not sure if eclipse is completely relying on ant
for building an application to know if this would be enough for enabling complete build by clicking mouse buttons from within eclipse, too.
Upvotes: 1