forked from LineageOS/android_external_ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-android-configs
executable file
·36 lines (26 loc) · 3.22 KB
/
gen-android-configs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#
# Generate configurations for various FFMPEG targets
TARGETS="armv5te armv7-a armv7-a-neon armv8-a silvermont x86"
SYSROOT_BASE="../../prebuilts/ndk/current/platforms/android-24"
TOOLS_BASE="../../prebuilts/gcc/linux-x86"
BASE_CONFIG="--disable-static --enable-shared --enable-optimizations --disable-symver --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-devices --disable-filters --disable-demuxer=srt --disable-demuxer=microdvd --disable-demuxer=jacosub --disable-demuxer=sami --disable-demuxer=realtext --disable-demuxer=dts --disable-demuxer=subviewer --disable-demuxer=subviewer1 --disable-demuxer=pjs --disable-demuxer=vplayer --disable-demuxer=mpl2 --disable-decoder=ass --disable-decoder=srt --disable-decoder=subrip --disable-decoder=microdvd --disable-decoder=jacosub --disable-decoder=sami --disable-decoder=realtext --disable-decoder=movtext --disable-decoder=subviewer --disable-decoder=subviewer1 --disable-decoder=pjs --disable-decoder=vplayer --disable-decoder=mpl2 --enable-zlib --enable-pic --disable-debug --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages"
OPTS_armv5te="--arch=arm --cpu=armv5te --build_suffix= --cross-prefix=${TOOLS_BASE}/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi- --enable-cross-compile --sysroot=${SYSROOT_BASE}/arch-arm --target-os=linux"
OPTS_armv7_a="--arch=arm --disable-neon --cpu=armv7-a --build_suffix= --cross-prefix=${TOOLS_BASE}/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi- --enable-cross-compile --sysroot=${SYSROOT_BASE}/arch-arm --target-os=linux"
OPTS_armv7_a_neon="--arch=arm --cpu=armv7-a --build_suffix= --cross-prefix=${TOOLS_BASE}/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi- --enable-cross-compile --sysroot=${SYSROOT_BASE}/arch-arm --target-os=linux"
OPTS_armv8_a="--arch=aarch64 --target-os=linux --enable-cross-compile --cross-prefix=${TOOLS_BASE}/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android- --sysroot=${SYSROOT_BASE}/arch-arm64 --target-os=linux"
OPTS_silvermont="--arch=x86 --cpu=silvermont --build_suffix= --cross-prefix=${TOOLS_BASE}/x86/x86_64-linux-android-4.9/bin/x86_64-linux-android- --enable-cross-compile --sysroot=${SYSROOT_BASE}/arch-x86 --target-os=linux --extra-cflags=-m32"
OPTS_x86="--arch=x86 --cpu=i686 --build_suffix= --cross-prefix=${TOOLS_BASE}/x86/x86_64-linux-android-4.9/bin/x86_64-linux-android- --enable-cross-compile --sysroot=${SYSROOT_BASE}/arch-x86 --target-os=linux --extra-cflags=-m32"
for TARGET in $TARGETS;do
echo "Generating configuration for: ${TARGET}"
rm -f config.mak config.h
ARCH_OPTS=OPTS_`echo $TARGET | tr "-" "_"`
echo "configure ${!ARCH_OPTS} $BASE_CONFIG"
./configure ${!ARCH_OPTS} $BASE_CONFIG
cp config.mak android/config-${TARGET}.mak
cat config.h | sed -e "s/^#define \(ARCH_.*\|HAVE_.*\) \(.*\)/#ifdef \1\n#undef \1\n#endif\n#define \1 \2/g" > android/include/config-${TARGET}.h
done
cp config.asm android/include/
cp libavutil/avconfig.h android/include/libavutil/
# Not sure why this gets configured wrong..
perl -pi -e "s/define HAVE_EBP_AVAILABLE 1/define HAVE_EBP_AVAILABLE 0/g" android/include/config-silvermont.h android/include/config-x86.h android/include/config.asm