forked from samiamwork/Movist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_libav.sh
executable file
·94 lines (78 loc) · 1.73 KB
/
build_libav.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#/bin/bash
set -e
if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]
then
echo MACOSX_DEPLOYMENT_TARGET not set
exit 1
fi
GUARD_FILE=build/guard_4
if [[ -e $GUARD_FILE ]]
then
echo libav is up to date
exit 0
fi
if [[ ! -e "libav/configure" ]]
then
echo init libav submodule
pushd ..
git submodule init
git submodule update
popd
else
# Even if we have the files it's possible that
# we've moved to a new commit for the submodule
echo update libav submodule
pushd ..
git submodule update
popd
fi
ORIGINAL_PATH="$PATH"
build_libav()
{
(cd libav && \
./configure \
--arch=$THEARC \
--cpu=$THECPU \
--cc=clang \
--enable-decoders \
--disable-vda \
--disable-encoders \
--enable-demuxers \
--disable-muxers \
--enable-parsers \
--disable-avdevice \
--enable-postproc \
--disable-network \
--enable-pthreads \
--enable-gpl \
--disable-avconv \
--disable-ffmpeg \
--disable-avprobe \
--disable-avserver \
--disable-avplay \
--extra-ldflags="-L$PREFIX/../lib -arch $THEARC -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" \
--extra-cflags="-isystem $PREFIX/../include -arch $THEARC -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -Wno-deprecated-declarations $THEOPT " \
--enable-protocol=file \
--prefix=$PREFIX \
&& make clean && make && make install-libs && make install-headers)
}
########## INTEL i386 ###########
PREFIX="$(cd build;pwd)/i386"
PATH="$(cd build;pwd)/bin:$PREFIX/bin:$ORIGINAL_PATH"
THEARC="i386"
THECPU="pentium-m"
THEOPT=""
export PATH
build_libav
########## INTEL x86_64 ###########
PREFIX="$(cd build;pwd)/x86_64"
PATH="$(cd build;pwd)/bin:$PREFIX/bin:$ORIGINAL_PATH"
THEARC="x86_64"
THECPU="core2"
THEOPT="-mtune=core2"
export PATH
build_libav
## Relocate headers
cp -R $PREFIX/include/* $PREFIX/../include
./make_univlib.sh
touch $GUARD_FILE