forked from hrydgard/ppsspp-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
android-build.sh
executable file
·105 lines (93 loc) · 2.74 KB
/
android-build.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
#Change NDK to your Android NDK location
NDK=/c/AndroidNDK
PLATFORM=$NDK/platforms/android-8/arch-arm/
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-x86_64
GENERAL="\
--enable-cross-compile \
--extra-libs="-lgcc" \
--arch=arm \
--cc=$PREBUILT/bin/arm-linux-androideabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--nm=$PREBUILT/bin/arm-linux-androideabi-nm"
MODULES="\
--disable-filters \
--disable-programs \
--disable-network \
--disable-avfilter \
--disable-postproc \
--disable-encoders \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-ffmpeg"
VIDEO_DECODERS="\
--enable-decoder=h264 \
--enable-decoder=mpeg2video"
AUDIO_DECODERS="\
--enable-decoder=aac \
--enable-decoder=atrac1 \
--enable-decoder=atrac3 \
--enable-decoder=mp3 \
--enable-decoder=pcm_s16le \
--enable-decoder=pcm_s8"
DEMUXERS="\
--enable-demuxer=h264 \
--enable-demuxer=mpegvideo \
--enable-demuxer=avi \
--enable-demuxer=aac \
--enable-demuxer=oma \
--enable-demuxer=pcm_s16le \
--enable-demuxer=pcm_s8 \
--enable-demuxer=wav"
PARSERS="\
--enable-parser=h264 \
--enable-parser=mpeg4video \
--enable-parser=mpegvideo \
--enable-parser=aac \
--enable-parser=mpegaudio"
function build_ARMv6
{
./configure --target-os=linux \
--prefix=./android/armv6 \
${GENERAL} \
--sysroot=$PLATFORM \
--extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -DCMP_HAVE_VFP -mfloat-abi=softfp -mfpu=vfp -marm -march=armv6" \
--disable-shared \
--enable-static \
--extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \
--enable-zlib \
--disable-everything \
${MODULES} \
${VIDEO_DECODERS} \
${AUDIO_DECODERS} \
${DEMUXERS} \
${PARSERS} \
--disable-neon
make clean
make install
}
function build_ARMv7
{
./configure --target-os=linux \
--prefix=./android/armv7 \
${GENERAL} \
--sysroot=$PLATFORM \
--extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -mfloat-abi=softfp -mfpu=vfp -marm -march=armv7-a" \
--disable-shared \
--enable-static \
--extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \
--enable-zlib \
--disable-everything \
${MODULES} \
${VIDEO_DECODERS} \
${AUDIO_DECODERS} \
${DEMUXERS} \
${PARSERS} \
--disable-neon \
make clean
make install
}
build_ARMv6
build_ARMv7