forked from mconf/android-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_mconf.sh
More file actions
73 lines (63 loc) · 2.69 KB
/
build_mconf.sh
File metadata and controls
73 lines (63 loc) · 2.69 KB
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
#!/bin/bash
# using the unofficial Crystax NDK
NDK_DIR=~/codes/android-ndk-r4-crystax
PREBUILT=$NDK_DIR/build/prebuilt/linux-x86/arm-eabi-4.4.0
PLATFORM=$NDK_DIR/build/platforms/android-8/arch-arm
# if you prefer to use the official Android NDK, uncomment the following commands
#NDK_DIR=~/codes/android-ndk-r5b
#PREBUILT=$NDK_DIR/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86
#PLATFORM=$NDK_DIR/platforms/android-8/arch-arm
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/errno.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/posix_types.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/limits.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/stddef.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/fcntl.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/capability.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/stat.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/sockios.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/in.h $PLATFORM/usr/include/linux/
#cp $PLATFORM/../../android-3/arch-arm/usr/include/linux/in6.h $PLATFORM/usr/include/linux/
list_files() {
echo 'LOCAL_SRC_FILES := \' > ../$1_files.mk
# run a fake make
make --dry-run | \
# select the just the files from the wanted library
egrep -i "$1/" | \
# select all the occurrences of .c and .S filenames
grep "[^ ]*\.[cS]" -o | \
# put a \ at the end of each line
sed -e 's:$: \\:g' | \
# put the result on .mk file
sort >> ../$1_files.mk
}
cd jni/ffmpeg
./configure --target-os=linux \
--disable-everything \
--disable-postproc \
--disable-avfilter \
--disable-network \
--disable-ffmpeg \
--disable-ffprobe \
--arch=arm \
--enable-version3 \
--enable-gpl \
--enable-nonfree \
--enable-cross-compile \
--enable-encoder=flv \
--enable-decoder=flv \
--cc=$PREBUILT/bin/arm-eabi-gcc \
--cross-prefix=$PREBUILT/bin/arm-eabi- \
--nm=$PREBUILT/bin/arm-eabi-nm \
--extra-cflags="-fPIC -DANDROID -I$PLATFORM/usr/include" \
--enable-armv5te \
--extra-ldflags="-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib $PREBUILT/lib/gcc/arm-eabi/4.4.0/crtbegin.o $PREBUILT/lib/gcc/arm-eabi/4.4.0/crtend.o -lc -lm -ldl" \
--logfile=../configure.log
list_files 'libavutil'
list_files 'libavcodec'
# point corrections
echo 'libavcodec/rawdec.c \' >> ../libavcodec_files.mk
list_files 'libavformat'
list_files 'libswscale'
cd ../..
$NDK_DIR/ndk-build clean
$NDK_DIR/ndk-build -j 8