About arm-eabi-gcc and cross-compilation

I have a complex open source library that needs to be ported to Android NDK. First, I need to configure (./Configure). I understand: I have to cross-compile with / home / user / android -ndk / build / prebuilt / Linux-x86 / lever EABI-4.4.0 / bin / arm-EABI-NKU I think, right? Does this utility configure the library correctly? If yes, then question 2:

1. I am trying to compile a library like this: libao. use the following commands:

PREBUILT = / home/user/android-ndk/build/prebuilt/linux-x86/arm- eabi-4.4.0 PLATFORM = / home/user/android-ndk/build/platforms/android-3/arch-arm INSTALL = / home/user/sox-14.3.2/com export CC = "/ home/user/android-ndk/build/prebuilt/linux-x86/arm- eabi-4.4.0/bin/arm-eabi-gcc" export CFLAGS = "-fPIC-DANDROID" export LDFLAGS = "-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 " . / Configure - host = arm - with-gnu-ld - enable-shared \ 

At the end of the build, get the following: configure: error: 16 bits were not found on this platform!

What does this mean? How to fix and properly configure the library? Maybe I can somehow configure the library easier?

+7
source share
1 answer

I think it is difficult (or even impossible) to use. / configure script to build the library for Android. Android has its own system for building Android.mk for its own code, and I think this will be the easiest way. You need to prepare such a makefile manually, and then use the ndk-build script that comes with the NDK. NDKs are installed along with the samples, and you can check how such a file looks.

If you want to just run configure to create config.h, go to this link http://warpedtimes.wordpress.com/2010/02/03/building-open-source-libraries-with-android-ndk/ . It contains information about what the next set of options for. / configure may work

 ./configure โ€“host=arm-eabi CC=arm-eabi-gcc CPPFLAGS="-I$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/include/" CFLAGS="-nostdlib" LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/ -L$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/" LIBS="-lc " 
+7
source

All Articles