简体   繁体   中英

Android-NDK building using the Bambuser source

I am trying to use the FFmpeg source provided by the Bambuser.

However, I am fail to build the files

I get the following error:

arm-linux-androideabi-gcc is unable to create an executable file. C compiler test failed.

I have already set the NDK path to /home/android-ndk but still get this error

And I am using Android-NDK-r5b

can anyone help? THX

Here is my build.sh

#!/bin/bash

if [ "$NDK" = "" ]; then
    echo NDK variable not set, assuming ${HOME}/android-ndk
    export NDK=${HOME}/android-ndk
fi

SYSROOT=$NDK/platforms/android-3/arch-arm
# Expand the prebuilt/* path into the correct one
TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows`
export PATH=$TOOLCHAIN/bin:$PATH

rm -rf build/ffmpeg
mkdir -p build/ffmpeg
cd ffmpeg

# Don't build any neon version for now
for version in armv5te armv7a; do

    DEST=../build/ffmpeg
    FLAGS="--target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm"
    FLAGS="$FLAGS --sysroot=$SYSROOT"
    FLAGS="$FLAGS --soname-prefix=/data/data/com.streaming.realive/lib/"
    FLAGS="$FLAGS --enable-shared --disable-symver"
    FLAGS="$FLAGS --enable-small --optimization-flags=-O2"
    FLAGS="$FLAGS --enable-encoder=mpeg4 --enable-decoder=mpeg4"
    FLAGS="$FLAGS --enable-encoder=mpeg2video --enable-encoder=nellymoser"
    FLAGS="$FLAGS --enable-protocol=rtp --enable-protocol=rtmp"
    FLAGS="$FLAGS --enable-protocol=http --enable-protocol=tcp --enable-protocol=udp"
    FLAGS="$FLAGS --enable-protocol=file"

    case "$version" in
        neon)
            EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
            EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
            # Runtime choosing neon vs non-neon requires
            # renamed files
            ABI="armeabi-v7a"
            ;;
        armv7a)
            EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp"
            EXTRA_LDFLAGS=""
            ABI="armeabi-v7a"
            ;;
        *)
            EXTRA_CFLAGS=""
            EXTRA_LDFLAGS=""
            ABI="armeabi"
            ;;
    esac
    DEST="$DEST/$ABI"
    FLAGS="$FLAGS --prefix=$DEST"

    mkdir -p $DEST
    echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt
    ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt
    [ $PIPESTATUS == 0 ] || exit 1
    make clean
    make -j4 || exit 1
    make install || exit 1

done

First which platform u use? I suggest Ubuntu.

Second make sure NDK path is correct.

Third FLAGS="$FLAGS --soname-prefix=/data/data/com.streaming.realive/lib/"

maybe you need to create the relative folder in your computer

here my config.log I also get the same issue when using bambuser script. I using ubuntu

type mktemp
mktemp is /bin/mktemp
WARNING: Unknown C compiler arm-linux-androideabi-gcc, unable to select optimal CFLAGS
check_ld
check_cc
BEGIN /tmp/ffconf.ItYaeeJM.c
    1   int main(void){ return 0; }
END /tmp/ffconf.ItYaeeJM.c
arm-linux-androideabi-gcc -c -o /tmp/ffconf.woaTRE0T.o /tmp/ffconf.ItYaeeJM.c
./configure: 572: ./configure: arm-linux-androideabi-gcc: not found
C compiler test failed.

First check your configure.log file in the ffmpeg directory. In that the last few lines indicates the exact error you face. If you post that error, we might be able to help you.

If you are on Windows Operating System then, try to add your toolchain path (used in build.sh ) to the PATH environmental variable (from My Computer 's properties).

For Example:

C:\android-ndk-r7\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin

Try this.

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