简体   繁体   中英

Cross-compiling librtmp for android

Has anybody out there successfully cross-compiled librtmp for the Android platform? I know that the rtmpdump android download has librtmp.so included, but I think I need librtmp.a also (I am trying to cross-compile ffmpeg with librtmp support).

Anybody had any luck with this? It's driving me bonkers....

Ta

Dan

I* just successfully built librtmp for Android using the Guardian Project's OpenSSL repo . I documented my steps here along with preserved build scripts.

In a nutshell, build OpenSSL per GuardianProject's directions, then run the following script in rtmpdump/librtmp :

#build_librtmp_for_android.sh
NDK=/path/to/android-ndk-r9c
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
OPENSSL_DIR=/path/to/openssl-android/
# Note: Change the above variables for your system. Also ensure you've built openssl-android
function build_one
{
    set -e
    make clean
    ln -s ${SYSROOT}usr/lib/crtbegin_so.o
    ln -s ${SYSROOT}usr/lib/crtend_so.o
    export XLDFLAGS="$ADDI_LDFLAGS -L${OPENSSL_DIR}libs/armeabi -L${SYSROOT}usr/lib "
    export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi-
    export XCFLAGS="${ADDI_CFLAGS} -I${OPENSSL_DIR}include -isysroot ${SYSROOT}"
    export INC="-I${SYSROOT}"
    make prefix=\"${PREFIX}\" OPT= install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm"
build_one

*with the incredible help of my pal Chris .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM