forked from cine-io/android-ffmpeg-with-rtmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_build_librtmp.sh
34 lines (27 loc) · 1.26 KB
/
_build_librtmp.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
function build_librtmp {
echo "Building librtmp for android ..."
test -d ${src_root}/rtmpdump || \
git clone git://git.ffmpeg.org/rtmpdump ${src_root}/rtmpdump >> ${build_log} 2>&1 || \
die "Couldn't clone rtmpdump repository!"
cd ${src_root}/rtmpdump/librtmp
# patch the Makefile to use an Android-friendly versioning scheme
patch -u Makefile ${patch_root}/librtmp-Makefile.patch >> ${build_log} 2>&1 || \
die "Couldn't patch librtmp Makefile!"
openssl_dir=${src_root}/openssl-android
prefix=${src_root}/rtmpdump/librtmp/android/arm
addi_cflags="-marm"
addi_ldflags=""
test -L "crtbegin_so.o" || ln -s ${SYSROOT}/usr/lib/crtbegin_so.o
test -L "crtend_so.o" || ln -s ${SYSROOT}/usr/lib/crtend_so.o
export XLDFLAGS="$addi_ldflags -L${openssl_dir}/libs/armeabi -L${SYSROOT}/usr/lib"
export CROSS_COMPILE=${TOOLCHAIN}/bin/arm-linux-androideabi-
export XCFLAGS="${addi_cflags} -I${openssl_dir}/include -isysroot ${SYSROOT}"
export INC="-I${SYSROOT}"
make prefix=\"${prefix}\" OPT= install >> ${build_log} 2>&1 || \
die "Couldn't build librtmp for android!"
# copy the versioned libraries
cp ${prefix}/lib/lib*-+([0-9]).so ${dist_lib_root}/.
# copy the headers
cp -r ${prefix}/include/* ${dist_include_root}/.
cd ${top_root}
}