Cross Compiling libevent for Android

前端 未结 3 908
闹比i
闹比i 2021-02-03 14:50

I\'m stuck trying to cross-compile libevent to Android and I\'d like to know what I\'m doing wrong and get some assistance.

The version I\'m trying to build is libevent-

相关标签:
3条回答
  • 2021-02-03 15:29

    Try this

    ./configure --host=arm-linux-androideabi CC="$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT" CFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
    

    It works for me.

    0 讨论(0)
  • 2021-02-03 15:33

    This project builds libevent as a static library on Android here: https://github.com/ventureresearch/libevent

    It includes the Android.mk and generated config files to build it cleanly.

    Note that we are building it for inclusion into an Android device image, and NOT building through the NDK. It would probably still be a good place to start.

    0 讨论(0)
  • 2021-02-03 15:47

    Try with below configurations:

    ANDROID_SYSROOT=$ANDROID_ROOT/platforms/android-8/arch-arm/
    
    ./configure --host=arm-linux-androideabi CFLAGS=--sysroot=$ANDROID_SYSROOT LDFLAGS=--sysroot=$ANDROID_SYSROOT
    
    0 讨论(0)
提交回复
热议问题