-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·60 lines (53 loc) · 1.3 KB
/
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
#!/bin/bash
# Pull ffmpeg source
git submodule init
git submodule update
cd ffmpeg
#Android NDK Location
if [ -z "$NDK_ROOT" ]; then
echo "Need to set NDK_ROOT"
exit 1
fi
ANDROID_API=android-9
SYSROOT=${NDK_ROOT}/platforms/${ANDROID_API}/arch-arm
PREBUILT=${NDK_ROOT}/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
CROSS_PREFIX=${PREBUILT}/bin/arm-linux-androideabi-
ARM_INCLUDE=${SYSROOT}/usr/include
ARM_LIB=${SYSROOT}/usr/lib
PREFIX=$(pwd)/../build
OPTIMIZE_CFLAGS=" -marm -march=armv6 "
ADDITIONAL_CONFIGURE_FLAG=
# mp3lame static installation
MP3LAME=../libmp3lame
./configure \
--arch=arm \
--target-os=linux \
--enable-cross-compile \
--cross-prefix=${CROSS_PREFIX} \
--prefix=${PREFIX} \
--sysroot=${SYSROOT} \
--extra-cflags=" -I${ARM_INCLUDE} -I${MP3LAME}/include -DANDROID ${OPTIMIZE_CFLAGS}" \
--extra-ldflags=" -L${ARM_LIB} -L${MP3LAME}/lib" \
--disable-debug \
--enable-shared \
--enable-static \
--enable-libmp3lame \
--enable-ffplay \
--enable-ffprobe \
--enable-ffserver \
--enable-avfilter \
--enable-decoders \
--enable-demuxers \
--enable-encoders \
--enable-filters \
--enable-indevs \
--enable-network \
--enable-parsers \
--enable-protocols \
--enable-swscale \
--enable-gpl \
--enable-nonfree \
${ADDITIONAL_CONFIGURE_FLAG}
make -j
make install
cd ..