fdk-aac 编译配置

做些整理 希望对大家有帮助;

代码下载:
        http://sourceforge.net/projects/opencore-amr/files/fdk-aac/

export NDK_HOME=XXX/andorid-ndk-r8   //set by yourself 
------------------------------------------------------------------------------------------------------

#!/bin/sh

ANDROID_API=android-9

SYSROOT=$NDK_HOME/platforms/$ANDROID_API/arch-arm

ANDROID_BIN=$NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/

CROSS_COMPILE=${ANDROID_BIN}/arm-linux-androideabi-

ARM_INC=$SYSROOT/usr/include

ARM_LIB=$SYSROOT/usr/lib

LDFLAGS=" -nostdlib -Bdynamic -Wl,--whole-archive -Wl,--no-undefined -Wl,-z,noexecstack  -Wl,-z,nocopyreloc -Wl,-soname,/system/lib/libz.so -Wl,-rpath-link=$ARM_LIB,-dynamic-linker=/system/bin/linker -L$NDK_HOME/sources/cxx-stl/gnu-libstdc++/libs/armeabi -L$NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/arm-linux-androideabi/lib -L$ARM_LIB  -lc -lgcc -lm -ldl  "

FLAGS="--host=arm-androideabi-linux --enable-static --disable-shared"

export CXX="${CROSS_COMPILE}g++ --sysroot=${SYSROOT}"

export LDFLAGS="$LDFLAGS"

export CC="${CROSS_COMPILE}gcc --sysroot=${SYSROOT}"

 

./configure $FLAGS \

--prefix='/xx/arm/fdk-aac/setup'

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

FFMPEG :
export  NDK_HOME=/xxxx/android-ndk-r8
export FDKAAC_HOME=$(pwd)/../fdk-aac-0.1.3

#!/bin/bash

ANDROID_NDK_ROOT=$NDK_HOME

PREBUILT=$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86

PLATFORM=$ANDROID_NDK_ROOT/platforms/android-8/arch-arm

ARM_LIB=$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3

AAC_HOME=$PROJECT_PATH/third/

 

./configure --target-os=linux \

--arch=arm \

--enable-version3 \

--enable-gpl \

--enable-nonfree \

--disable-shared \

--disable-stripping \

--disable-ffmpeg \

--disable-ffplay \

--disable-ffserver \

--disable-ffprobe \

--disable-protocols \

--enable-protocol=file \

--enable-protocol=udp \

--enable-protocol=tcp \

--enable-protocol=http \

--enable-network \

--enable-encoders \

--enable-decoders \

--enable-muxers \

--disable-avdevice \

--disable-indevs \

--disable-filters \

--disable-devices \

--disable-parsers \

--disable-postproc \

--disable-debug \

--enable-cross-compile \

--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \

--extra-cflags=" -fPIC -DANDROID -I$PLATFORM/usr/include -I$AAC_HOME/dist/include" \

--disable-asm \

--disable-yasm \

--enable-libfdk-aac \

--enable-neon \

--enable-armv5te \

--sysinclude=$PLATFORM/usr/include \

--extra-ldflags="-Wl,-soname,/system/lib/libz.so -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -L$ARM_LIB -lc -lm -ldl -lgcc -L$AAC_HOME/lib" \

--extra-libs="-lgcc" \

 

sed -i 's/HAVE_LRINT 0/HAVE_LRINT 1/g' config.h

sed -i 's/HAVE_LRINTF 0/HAVE_LRINTF 1/g' config.h

sed -i 's/HAVE_ROUND 0/HAVE_ROUND 1/g' config.h

sed -i 's/HAVE_ROUNDF 0/HAVE_ROUNDF 1/g' config.h

sed -i 's/HAVE_TRUNC 0/HAVE_TRUNC 1/g' config.h

sed -i 's/HAVE_TRUNCF 0/HAVE_TRUNCF 1/g' config.h

sed -i 's/restrict restrict/restrict/g' config.h

sed -i 's/HAVE_CBRT 0/HAVE_CBRT 1/g' config.h

sed -i 's/HAVE_CBRTF 0/HAVE_CBRTF 1/g' config.h

sed -i 's/HAVE_ISINF 0/HAVE_ISINF 1/g' config.h

sed -i 's/HAVE_ISNAN 0/HAVE_ISNAN 1/g' config.h

sed -i 's/HAVE_SINF 0/HAVE_SINF 1/g' config.h

sed -i 's/HAVE_RINT 0/HAVE_RINT 1/g' config.h


你可能感兴趣的:(ffmpeg)