-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_dependencies_mac.sh
executable file
·156 lines (119 loc) · 3.62 KB
/
build_dependencies_mac.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash
export DIR=`dirname $0`
cd $DIR # Go to scripts living directory
export ABSDIR=`cd .;pwd`
echo "ABSDIR=$ABSDIR"
# Fail on errors
set -e
./get_dependencies.sh
# Directories
export SRC_DIR=$ABSDIR/dependencies_source
export INSTALL_DIR=$ABSDIR/dependencies
# Create target directory
mkdir -p $INSTALL_DIR # where to compile to
echo "SRC_DIR: $SRC_DIR"
echo "INSTALL_DIR: $INSTALL_DIR"
cd $SRC_DIR
mkdir -p osx
# pkgconfig
# Download it by hand
# Git version doesn't work, as no autoconf is installed by default
if [ -e $INSTALL_DIR/bin/pkg-config ]; then
echo "pkg-config seems to already exist"
else
cd osx
if [ -d pkg-config-0.28 ]; then
echo "Pkg-Config already downloaded"
else
curl -fL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz > pkg-config-0.28.tar.gz
tar -xzf pkg-config-0.28.tar.gz
fi
echo "Compiling pkg-config"
cd pkg-config-0.28
./configure --prefix=$INSTALL_DIR
make -j2
make install
cd ../..
fi
export PATH=$PATH:$INSTALL_DIR/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$INSTALL_DIR/lib/pkgconfig
# yasm
# download by hand
# git version doesn't work, as no autoconf is installed by default
if [ -e $INSTALL_DIR/bin/yasm ]; then
echo "yasm seems to already exist"
else
cd osx
if [ -d yasm-1.2.0 ]; then
echo "Yasm already downloaded"
else
#wget --no-check-certificate https://github.com/downloads/dozeo/screengrabber/yasm-1.2.0.tar.gz -O yasm-1.2.0.tar.gz
curl -fL https://github.com/downloads/dozeo/screengrabber/yasm-1.2.0.tar.gz > yasm-1.2.0.tar.gz
tar -xzf yasm-1.2.0.tar.gz
fi
echo "Compiling yasm"
cd yasm-1.2.0
./configure --prefix=$INSTALL_DIR
make -j2
make install
cd ../../
fi
# checkout and compile polarssl
if [ -e $INSTALL_DIR/lib/libpolarssl.a ]; then
echo "polarssl seems to already exist"
else
cd polarssl
echo "compiling polarssl"
#make clean
CC=clang make SYS=darwin DESTDIR=$INSTALL_DIR lib
CC=clang make SYS=darwin DESTDIR=$INSTALL_DIR install
cd ../
fi
# rtmpdump
if [ -e $INSTALL_DIR/bin/rtmpdump ]; then
echo "rtmpdump seems to already exist"
else
echo "Compiling rtmpdump"
cd rtmpdump
#make clean
LIBZ="-lssl -lcrypto -ldl" make SYS=darwin CC=clang CRYPTO=POLARSSL prefix=$INSTALL_DIR \
XCFLAGS=-I$INSTALL_DIR/include XLDFLAGS=-L$INSTALL_DIR/lib install
cd ..
fi
# libx264
if [ -e $INSTALL_DIR/bin/x264 ]; then
echo "x264 seems to already exist"
else
echo "Compiling x264"
cd x264
./configure --enable-shared --prefix=$INSTALL_DIR \
--extra-ldflags="-L$INSTALL_DIR/lib" --extra-cflags="-I$INSTALL_DIR/include"
make sys=darwin CC="clang" -j2
make install
cd ..
fi
# ffmpeg, is available as submodule
if [ -e $INSTALL_DIR/bin/ffmpeg ]; then
echo "ffmpeg seems to already exist"
else
echo "Compiling ffmpeg"
cd ffmpeg
./configure --prefix=$INSTALL_DIR --enable-shared \
--enable-gpl --enable-librtmp --enable-libx264 \
--enable-encoder=libx264 \
--enable-protocol=rtmps --enable-protocol=rtp --enable-protocol=rtmp \
--enable-protocol=rtmpte --enable-protocol=rtmpts \
--enable-protocol=tcp --enable-protocol=file \
--extra-ldflags=-L$INSTALL_DIR/lib --extra-cflags=-I$INSTALL_DIR/include --extra-cxxflags=-I$INSTALL_DIR/include
make -j2
make install
cd ..
fi
# gtest
if [ -d gtest-1.7.0 ]; then
echo "gtest 1.7.0 seems already downloaded"
else
curl -fL http://googletest.googlecode.com/files/gtest-1.7.0.zip > gtest-1.7.0.zip
unzip gtest-1.7.0.zip
rm gtest-1.7.0.zip
fi