About arm-eabi-gcc and cross-compiling

后端 未结 1 666
醉梦人生
醉梦人生 2021-01-30 15:35

I have a complicated open source library that needs to be ported to Android NDK. First, I need to configure (. / Configure). I understand: I have to do cross-compile with / ho

相关标签:
1条回答
  • 2021-01-30 15:58

    I think it is hard (or even impossible) to use ./configure script to build library for Android. Android has its own building system Android.mk for native code and I think this will be the easiest way to go. You have to prepare such makefile manually and then use ndk-build script that come with NDK. Together with NDK samples are installed and you can check there how such file may look like.

    If you want to just run configure to generate config.h please follow this link http://warpedtimes.wordpress.com/2010/02/03/building-open-source-libraries-with-android-ndk/. It contains information that following set of parameters for ./configure might 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 “
    
    0 讨论(0)
提交回复
热议问题