K
K
Kyborg20112011-04-23 09:45:27
Android
Kyborg2011, 2011-04-23 09:45:27

Android NDK and cross compilation?

It is required to port one Linux library to Android (to use in your application). I so understood that it is necessary to carry out a cross compilation under AWP.
Here is the build script I wrote:

PREBUILT=/home/user/android-ndk/build/prebuilt/linux-x86/arm-eabi-4.4.0<br/>
PLATFORM=/home/user/android-ndk/build/platforms/android-3/arch-arm<br/>
INSTALL=/home/user/test-14.3.2/com5<br/>
<br/>
./configure --build=arm \<br/>
--prefix=$INSTALL \<br/>
<br/>
--with-flac=dyn \<br/>
<br/>
--enable-shared \<br/>
<br/>
CC=$PREBUILT/bin/arm-eabi-gcc \<br/>
CFLAGS=&quot;-fPIC -DANDROID&quot; \<br/>
LDFLAGS=&quot;-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib $PREBUILT/lib/gcc/arm-eabi/4.4.0/crtbegin.o $PREBUILT/lib/gcc/arm-eabi/4.4.0/crtend.o -lc -lm -ldl&quot;

The question is: is this assembly option correct in this case (theoretically)? If yes, then is it possible to use the resulting compiled libraries in Android NDK by running ./make and make install, or do I still need to build via ndk-build and write multiple Android.mk?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
moadib, 2011-04-23
@moadib

Why multiple? One library - one Android.mk, especially since it is easy to write.
I would recommend using ndk-build.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question