forked from luoriloutai/ffmpeg_compile_for_android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
x264.sh
47 lines (38 loc) · 857 Bytes
/
x264.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
#!/bin/bash
ARCH=$1
# 导入配置文件
source config.sh $ARCH
# 输出路径
LIBS_DIR=$(cd `dirname $0`; pwd)/libs/libx264
echo "LIBS_DIR="$LIBS_DIR
# x264源码路径
cd x264
export CC=$CC
export CXX=$CXX
export CXXFLAGS=$FF_EXTRA_CFLAGS
export CFLAGS=$FF_CFLAGS
export AR="${CROSS_PREFIX}ar"
export LD="${CROSS_PREFIX}ld"
export AS="${CROSS_PREFIX}as"
export NM="${CROSS_COMPILE}nm"
export STRIP="${CROSS_COMPILE}strip"
export RANLIB="${CROSS_COMPILE}ranlib"
PREFIX=$LIBS_DIR/$AOSP_ABI
export HOST=$HOST
export CROSS_PREFIX=$CROSS_PREFIX
export SYS_ROOT=$SYS_ROOT
export FF_CFLAGS=$FF_CFLAGS
./configure --prefix=$PREFIX \
--enable-static \
--enable-pic \
--disable-cli \
--disable-asm \
--host=$HOST \
--cross-prefix=$CROSS_PREFIX \
--sysroot=$SYS_ROOT \
--extra-cflags="$FF_CFLAGS" \
--extra-ldflags=""
make clean
make -j2
make install
cd ..