-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·77 lines (68 loc) · 1.73 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
# Based on https://github.com/zimbatm/ffmpeg-static
set -e
set -u
cd `dirname $0`
ENV_ROOT=`pwd`
BUILD_DIR="$ENV_ROOT/native"
TARGET_DIR="$ENV_ROOT/target/native"
BIN_DIR="$TARGET_DIR/bin"
JVAL=5
export LDFLAGS="-L${TARGET_DIR}/lib"
export DYLD_LIBRARY_PATH="${TARGET_DIR}/lib"
export PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig"
#export CFLAGS="-I${TARGET_DIR}/include $LDFLAGS -static-libgcc -Wl,-Bstatic -lc"
export CFLAGS="-I${TARGET_DIR}/include $LDFLAGS"
export PATH="${TARGET_DIR}/bin:${PATH}"
# Force PATH cache clearing
hash -r
mkdir -p "$TARGET_DIR" "$BIN_DIR"
echo "#### FFmpeg static build ####"
echo "*** Building x264 ***"
cd $BUILD_DIR/x264
PATH="$BIN_DIR:$PATH" ./configure \
--prefix=$TARGET_DIR \
--enable-static --disable-opencl \
--enable-pic --disable-asm
PATH="$BIN_DIR:$PATH" make -j $JVAL
make install
echo "*** Building mp3lame ***"
cd $BUILD_DIR/lame*
./configure --prefix=$TARGET_DIR \
--enable-nasm \
--disable-shared \
--with-pic=yes
make
make install
echo "*** Building FFmpeg ***"
cd $BUILD_DIR/ffmpeg
PATH="$BIN_DIR:$PATH" \
PKG_CONFIG_PATH="$TARGET_DIR/lib/pkgconfig" ./configure \
--prefix="$TARGET_DIR" \
--pkg-config-flags="--static" \
--extra-cflags="-I$TARGET_DIR/include" \
--extra-ldflags="-L$TARGET_DIR/lib" \
--bindir="$BIN_DIR" \
--disable-programs \
--disable-doc \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--enable-pic \
--disable-asm \
--disable-d3d11va \
--disable-dxva2 \
--disable-vaapi \
--disable-vda \
--disable-vdpau \
--disable-devices \
--enable-avresample \
--disable-bzlib \
--disable-lzma \
--disable-zlib \
--enable-libmp3lame \
--enable-libx264
PATH="$BIN_DIR:$PATH" make
make install
make distclean
hash -r