winlin

arm support ssl/hls, change to 0.9.17

1 #!/bin/bash 1 #!/bin/bash
2 2
3 -# variables:  
4 -# SRS_JOBS: the build jobs, parent script must set it. 3 +# variables, parent script must set it:
  4 +# SRS_JOBS: the build jobs.
  5 +# SrsArmMakeOptions: the arm make options for ubuntu12(armhf, v7cpu)
5 6
6 ##################################################################################### 7 #####################################################################################
7 ##################################################################################### 8 #####################################################################################
@@ -33,7 +34,7 @@ function Ubuntu_prepare() @@ -33,7 +34,7 @@ function Ubuntu_prepare()
33 { 34 {
34 uname -v|grep Ubuntu >/dev/null 2>&1 35 uname -v|grep Ubuntu >/dev/null 2>&1
35 ret=$?; if [[ 0 -ne $ret ]]; then 36 ret=$?; if [[ 0 -ne $ret ]]; then
36 - return; 37 + return 0;
37 fi 38 fi
38 39
39 echo "Ubuntu detected, install tools if needed" 40 echo "Ubuntu detected, install tools if needed"
@@ -41,69 +42,80 @@ function Ubuntu_prepare() @@ -41,69 +42,80 @@ function Ubuntu_prepare()
41 gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 42 gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
42 echo "install gcc" 43 echo "install gcc"
43 require_sudoer "sudo apt-get install -y --force-yes gcc" 44 require_sudoer "sudo apt-get install -y --force-yes gcc"
44 - sudo apt-get install -y --force-yes gcc 45 + sudo apt-get install -y --force-yes gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
45 echo "install gcc success" 46 echo "install gcc success"
46 fi 47 fi
47 48
48 g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 49 g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
49 echo "install g++" 50 echo "install g++"
50 require_sudoer "sudo apt-get install -y --force-yes g++" 51 require_sudoer "sudo apt-get install -y --force-yes g++"
51 - sudo apt-get install -y --force-yes g++ 52 + sudo apt-get install -y --force-yes g++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
52 echo "install g++ success" 53 echo "install g++ success"
53 fi 54 fi
54 55
55 make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 56 make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
56 echo "install make" 57 echo "install make"
57 require_sudoer "sudo apt-get install -y --force-yes make" 58 require_sudoer "sudo apt-get install -y --force-yes make"
58 - sudo apt-get install -y --force-yes make 59 + sudo apt-get install -y --force-yes make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
59 echo "install make success" 60 echo "install make success"
60 fi 61 fi
61 62
62 autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 63 autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
63 echo "install autoconf" 64 echo "install autoconf"
64 require_sudoer "sudo apt-get install -y --force-yes autoconf" 65 require_sudoer "sudo apt-get install -y --force-yes autoconf"
65 - sudo apt-get install -y --force-yes autoconf 66 + sudo apt-get install -y --force-yes autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
66 echo "install autoconf success" 67 echo "install autoconf success"
67 fi 68 fi
68 69
69 libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 70 libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
70 echo "install libtool" 71 echo "install libtool"
71 require_sudoer "sudo apt-get install -y --force-yes libtool" 72 require_sudoer "sudo apt-get install -y --force-yes libtool"
72 - sudo apt-get install -y --force-yes libtool 73 + sudo apt-get install -y --force-yes libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
73 echo "install libtool success" 74 echo "install libtool success"
74 fi 75 fi
75 76
76 if [[ ! -f /usr/include/pcre.h ]]; then 77 if [[ ! -f /usr/include/pcre.h ]]; then
77 echo "install libpcre3-dev" 78 echo "install libpcre3-dev"
78 require_sudoer "sudo apt-get install -y --force-yes libpcre3-dev" 79 require_sudoer "sudo apt-get install -y --force-yes libpcre3-dev"
79 - sudo apt-get install -y --force-yes libpcre3-dev 80 + sudo apt-get install -y --force-yes libpcre3-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
80 echo "install libpcre3-dev success" 81 echo "install libpcre3-dev success"
81 fi 82 fi
82 83
83 if [[ ! -f /usr/include/zlib.h ]]; then 84 if [[ ! -f /usr/include/zlib.h ]]; then
84 echo "install zlib1g-dev" 85 echo "install zlib1g-dev"
85 require_sudoer "sudo apt-get install -y --force-yes zlib1g-dev" 86 require_sudoer "sudo apt-get install -y --force-yes zlib1g-dev"
86 - sudo apt-get install -y --force-yes zlib1g-dev 87 + sudo apt-get install -y --force-yes zlib1g-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
87 echo "install zlib1g-dev success" 88 echo "install zlib1g-dev success"
88 fi 89 fi
89 90
90 if [[ ! -d /usr/include/freetype2 ]]; then 91 if [[ ! -d /usr/include/freetype2 ]]; then
91 echo "install libfreetype6-dev" 92 echo "install libfreetype6-dev"
92 require_sudoer "sudo apt-get install -y --force-yes libfreetype6-dev" 93 require_sudoer "sudo apt-get install -y --force-yes libfreetype6-dev"
93 - sudo apt-get install -y --force-yes libfreetype6-dev 94 + sudo apt-get install -y --force-yes libfreetype6-dev; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
94 echo "install libfreetype6-dev success" 95 echo "install libfreetype6-dev success"
95 fi 96 fi
96 97
  98 + # for arm, install the cross build tool chain.
  99 + if [ $SRS_ARM_UBUNTU12 = YES ]; then
  100 + arm-linux-gnueabi-gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
  101 + echo "install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi"
  102 + require_sudoer "sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi"
  103 + sudo apt-get install -y --force-yes gcc-arm-linux-gnueabi g++-arm-linux-gnueabi; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
  104 + echo "install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi success"
  105 + fi
  106 + fi
  107 +
97 echo "Ubuntu install tools success" 108 echo "Ubuntu install tools success"
  109 + return 0
98 } 110 }
99 -Ubuntu_prepare 111 +Ubuntu_prepare; ret=$?; if [[ 0 -ne $ret ]]; then echo "Ubuntu perfapre failed, ret=$ret"; exit $ret; fi
100 ##################################################################################### 112 #####################################################################################
101 # for Centos, auto install tools by yum 113 # for Centos, auto install tools by yum
102 ##################################################################################### 114 #####################################################################################
103 function Centos_prepare() 115 function Centos_prepare()
104 { 116 {
105 if [[ ! -f /etc/redhat-release ]]; then 117 if [[ ! -f /etc/redhat-release ]]; then
106 - return; 118 + return 0;
107 fi 119 fi
108 120
109 echo "Centos detected, install tools if needed" 121 echo "Centos detected, install tools if needed"
@@ -111,83 +123,111 @@ function Centos_prepare() @@ -111,83 +123,111 @@ function Centos_prepare()
111 gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 123 gcc --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
112 echo "install gcc" 124 echo "install gcc"
113 require_sudoer "sudo yum install -y gcc" 125 require_sudoer "sudo yum install -y gcc"
114 - sudo yum install -y gcc 126 + sudo yum install -y gcc; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
115 echo "install gcc success" 127 echo "install gcc success"
116 fi 128 fi
117 129
118 g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 130 g++ --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
119 echo "install gcc-c++" 131 echo "install gcc-c++"
120 require_sudoer "sudo yum install -y gcc-c++" 132 require_sudoer "sudo yum install -y gcc-c++"
121 - sudo yum install -y gcc-c++ 133 + sudo yum install -y gcc-c++; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
122 echo "install gcc-c++ success" 134 echo "install gcc-c++ success"
123 fi 135 fi
124 136
125 make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 137 make --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
126 echo "install make" 138 echo "install make"
127 require_sudoer "sudo yum install -y make" 139 require_sudoer "sudo yum install -y make"
128 - sudo yum install -y make 140 + sudo yum install -y make; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
129 echo "install make success" 141 echo "install make success"
130 fi 142 fi
131 143
132 automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 144 automake --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
133 echo "install automake" 145 echo "install automake"
134 require_sudoer "sudo yum install -y automake" 146 require_sudoer "sudo yum install -y automake"
135 - sudo yum install -y automake 147 + sudo yum install -y automake; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
136 echo "install automake success" 148 echo "install automake success"
137 fi 149 fi
138 150
139 autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 151 autoconf --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
140 echo "install autoconf" 152 echo "install autoconf"
141 require_sudoer "sudo yum install -y autoconf" 153 require_sudoer "sudo yum install -y autoconf"
142 - sudo yum install -y autoconf 154 + sudo yum install -y autoconf; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
143 echo "install autoconf success" 155 echo "install autoconf success"
144 fi 156 fi
145 157
146 libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 158 libtool --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
147 echo "install libtool" 159 echo "install libtool"
148 require_sudoer "sudo yum install -y libtool" 160 require_sudoer "sudo yum install -y libtool"
149 - sudo yum install -y libtool 161 + sudo yum install -y libtool; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
150 echo "install libtool success" 162 echo "install libtool success"
151 fi 163 fi
152 164
153 if [[ ! -f /usr/include/pcre.h ]]; then 165 if [[ ! -f /usr/include/pcre.h ]]; then
154 echo "install pcre-devel" 166 echo "install pcre-devel"
155 require_sudoer "sudo yum install -y pcre-devel" 167 require_sudoer "sudo yum install -y pcre-devel"
156 - sudo yum install -y pcre-devel 168 + sudo yum install -y pcre-devel; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
157 echo "install pcre-devel success" 169 echo "install pcre-devel success"
158 fi 170 fi
159 171
160 if [[ ! -f /usr/include/zlib.h ]]; then 172 if [[ ! -f /usr/include/zlib.h ]]; then
161 echo "install zlib-devel" 173 echo "install zlib-devel"
162 require_sudoer "sudo yum install -y zlib-devel" 174 require_sudoer "sudo yum install -y zlib-devel"
163 - sudo yum install -y zlib-devel 175 + sudo yum install -y zlib-devel; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
164 echo "install zlib-devel success" 176 echo "install zlib-devel success"
165 fi 177 fi
166 178
167 if [[ ! -d /usr/include/freetype2 ]]; then 179 if [[ ! -d /usr/include/freetype2 ]]; then
168 echo "install freetype-devel" 180 echo "install freetype-devel"
169 require_sudoer "sudo yum install -y freetype-devel" 181 require_sudoer "sudo yum install -y freetype-devel"
170 - sudo yum install -y freetype-devel 182 + sudo yum install -y freetype-devel; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi
171 echo "install freetype-devel success" 183 echo "install freetype-devel success"
172 fi 184 fi
173 185
  186 + # for arm, install the cross build tool chain.
  187 + if [ $SRS_ARM_UBUNTU12 = YES ]; then
  188 + echo "arm-ubuntu12 is invalid for CentOS"
  189 + return 1
  190 + fi
  191 +
174 echo "Centos install tools success" 192 echo "Centos install tools success"
  193 + return 0
175 } 194 }
176 -Centos_prepare 195 +Centos_prepare; ret=$?; if [[ 0 -ne $ret ]]; then "CentOS perfapre failed, ret=$ret"; exit $ret; fi
177 196
178 ##################################################################################### 197 #####################################################################################
179 # st-1.9 198 # st-1.9
180 ##################################################################################### 199 #####################################################################################
181 -if [[ -f ${SRS_OBJS}/st-1.9/obj/libst.a && -f ${SRS_OBJS}/st-1.9/obj/libst.so ]]; then  
182 - echo "st-1.9t is ok."; 200 +# check the arm flag file, if flag changed, need to rebuild the st.
  201 +if [ $SRS_ARM_UBUNTU12 = YES ]; then
  202 + # ok, arm specified, if the flag filed does not exists, need to rebuild.
  203 + if [[ -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st-1.9/obj/libst.a && -f ${SRS_OBJS}/st-1.9/obj/libst.so ]]; then
  204 + echo "st-1.9t for arm is ok.";
  205 + else
  206 + # TODO: FIXME: patch the bug.
  207 + # patch st for arm, @see: https://github.com/winlinvip/simple-rtmp-server/wiki/SrsLinuxArm#st-arm-bug-fix
  208 + echo "build st-1.9t for arm";
  209 + (
  210 + rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
  211 + unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&
  212 + make CC=${SrsArmCC} AR=${SrsArmAR} LD=${SrsArmLD} RANDLIB=${SrsArmRANDLIB} linux-debug &&
  213 + cd .. && rm -f st && ln -sf st-1.9/obj st &&
  214 + cd .. && touch ${SRS_OBJS}/_flag.st.arm.tmp
  215 + )
  216 + fi
183 else 217 else
184 - echo "build st-1.9t";  
185 - (  
186 - rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&  
187 - unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&  
188 - make linux-debug &&  
189 - cd .. && rm -f st && ln -sf st-1.9/obj st  
190 - ) 218 + # arm not specified, if exists flag, need to rebuild for no-arm platform.
  219 + if [[ ! -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/_flag.st.arm.tmp && -f ${SRS_OBJS}/st-1.9/obj/libst.a && -f ${SRS_OBJS}/st-1.9/obj/libst.so ]]; then
  220 + echo "st-1.9t is ok.";
  221 + else
  222 + echo "build st-1.9t";
  223 + (
  224 + rm -rf ${SRS_OBJS}/st-1.9 && cd ${SRS_OBJS} &&
  225 + unzip -q ../3rdparty/st-1.9.zip && cd st-1.9 &&
  226 + make linux-debug &&
  227 + cd .. && rm -f st && ln -sf st-1.9/obj st &&
  228 + cd .. && rm -f ${SRS_OBJS}/_flag.st.arm.tmp
  229 + )
  230 + fi
191 fi 231 fi
192 # check status 232 # check status
193 ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; fi 233 ret=$?; if [[ $ret -ne 0 ]]; then echo "build st-1.9 failed, ret=$ret"; exit $ret; fi
@@ -230,48 +270,50 @@ function write_nginx_html5() @@ -230,48 +270,50 @@ function write_nginx_html5()
230 </video> 270 </video>
231 END 271 END
232 } 272 }
233 -if [ $SRS_HLS = YES ]; then  
234 - if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then  
235 - echo "nginx-1.5.7 is ok.";  
236 - else  
237 - echo "build nginx-1.5.7";  
238 - (  
239 - rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} &&  
240 - unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 &&  
241 - ./configure --prefix=`pwd`/_release && make ${SRS_JOBS} && make install &&  
242 - cd .. && ln -sf nginx-1.5.7/_release nginx  
243 - )  
244 - fi  
245 - # check status  
246 - ret=$?; if [[ $ret -ne 0 ]]; then echo "build nginx-1.5.7 failed, ret=$ret"; exit $ret; fi  
247 - if [ ! -f ${SRS_OBJS}/nginx/sbin/nginx ]; then echo "build nginx-1.5.7 failed."; exit -1; fi 273 +if [ $SRS_ARM_UBUNTU12 = NO ]; then
  274 + if [ $SRS_HLS = YES ]; then
  275 + if [[ -f ${SRS_OBJS}/nginx/sbin/nginx ]]; then
  276 + echo "nginx-1.5.7 is ok.";
  277 + else
  278 + echo "build nginx-1.5.7";
  279 + (
  280 + rm -rf ${SRS_OBJS}/nginx-1.5.7 && cd ${SRS_OBJS} &&
  281 + unzip -q ../3rdparty/nginx-1.5.7.zip && cd nginx-1.5.7 &&
  282 + ./configure --prefix=`pwd`/_release && make ${SRS_JOBS} && make install &&
  283 + cd .. && ln -sf nginx-1.5.7/_release nginx
  284 + )
  285 + fi
  286 + # check status
  287 + ret=$?; if [[ $ret -ne 0 ]]; then echo "build nginx-1.5.7 failed, ret=$ret"; exit $ret; fi
  288 + if [ ! -f ${SRS_OBJS}/nginx/sbin/nginx ]; then echo "build nginx-1.5.7 failed."; exit -1; fi
248 289
249 - # use current user to config nginx,  
250 - # srs will write ts/m3u8 file use current user,  
251 - # nginx default use nobody, so cannot read the ts/m3u8 created by srs.  
252 - cp ${SRS_OBJS}/nginx/conf/nginx.conf ${SRS_OBJS}/nginx/conf/nginx.conf.bk  
253 - sed -i "s/^.user nobody;/user `whoami`;/g" ${SRS_OBJS}/nginx/conf/nginx.conf  
254 -  
255 - # create forward dir  
256 - mkdir -p ${SRS_OBJS}/nginx/html/live &&  
257 - mkdir -p ${SRS_OBJS}/nginx/html/forward/live  
258 -  
259 - # generate default html pages for android.  
260 - html_file=${SRS_OBJS}/nginx/html/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5  
261 - html_file=${SRS_OBJS}/nginx/html/live/livestream_ld.html && hls_stream=livestream_ld.m3u8 && write_nginx_html5  
262 - html_file=${SRS_OBJS}/nginx/html/live/livestream_sd.html && hls_stream=livestream_sd.m3u8 && write_nginx_html5  
263 - html_file=${SRS_OBJS}/nginx/html/forward/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5  
264 - html_file=${SRS_OBJS}/nginx/html/forward/live/livestream_ld.html && hls_stream=livestream_ld.m3u8 && write_nginx_html5  
265 - html_file=${SRS_OBJS}/nginx/html/forward/live/livestream_sd.html && hls_stream=livestream_sd.m3u8 && write_nginx_html5  
266 -  
267 - # copy players to nginx html dir.  
268 - rm -rf ${SRS_OBJS}/nginx/html/players &&  
269 - ln -sf `pwd`/research/players ${SRS_OBJS}/nginx/html/players &&  
270 - rm -f ${SRS_OBJS}/nginx/crossdomain.xml &&  
271 - ln -sf `pwd`/research/players/crossdomain.xml ${SRS_OBJS}/nginx/html/crossdomain.xml  
272 -  
273 - # nginx.html to detect whether nginx is alive  
274 - echo "nginx is ok" > ${SRS_OBJS}/nginx/html/nginx.html 290 + # use current user to config nginx,
  291 + # srs will write ts/m3u8 file use current user,
  292 + # nginx default use nobody, so cannot read the ts/m3u8 created by srs.
  293 + cp ${SRS_OBJS}/nginx/conf/nginx.conf ${SRS_OBJS}/nginx/conf/nginx.conf.bk
  294 + sed -i "s/^.user nobody;/user `whoami`;/g" ${SRS_OBJS}/nginx/conf/nginx.conf
  295 +
  296 + # create forward dir
  297 + mkdir -p ${SRS_OBJS}/nginx/html/live &&
  298 + mkdir -p ${SRS_OBJS}/nginx/html/forward/live
  299 +
  300 + # generate default html pages for android.
  301 + html_file=${SRS_OBJS}/nginx/html/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5
  302 + html_file=${SRS_OBJS}/nginx/html/live/livestream_ld.html && hls_stream=livestream_ld.m3u8 && write_nginx_html5
  303 + html_file=${SRS_OBJS}/nginx/html/live/livestream_sd.html && hls_stream=livestream_sd.m3u8 && write_nginx_html5
  304 + html_file=${SRS_OBJS}/nginx/html/forward/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5
  305 + html_file=${SRS_OBJS}/nginx/html/forward/live/livestream_ld.html && hls_stream=livestream_ld.m3u8 && write_nginx_html5
  306 + html_file=${SRS_OBJS}/nginx/html/forward/live/livestream_sd.html && hls_stream=livestream_sd.m3u8 && write_nginx_html5
  307 +
  308 + # copy players to nginx html dir.
  309 + rm -rf ${SRS_OBJS}/nginx/html/players &&
  310 + ln -sf `pwd`/research/players ${SRS_OBJS}/nginx/html/players &&
  311 + rm -f ${SRS_OBJS}/nginx/crossdomain.xml &&
  312 + ln -sf `pwd`/research/players/crossdomain.xml ${SRS_OBJS}/nginx/html/crossdomain.xml
  313 +
  314 + # nginx.html to detect whether nginx is alive
  315 + echo "nginx is ok" > ${SRS_OBJS}/nginx/html/nginx.html
  316 + fi
275 fi 317 fi
276 318
277 if [ $SRS_HLS = YES ]; then 319 if [ $SRS_HLS = YES ]; then
@@ -320,28 +362,30 @@ ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forwa @@ -320,28 +362,30 @@ ln -sf `pwd`/${SRS_OBJS}/nginx/html/forward research/api-server/static-dir/forwa
320 362
321 # only when the nginx is ok, 363 # only when the nginx is ok,
322 # if api-server not enalbed, use nginx as demo. 364 # if api-server not enalbed, use nginx as demo.
323 -if [ $SRS_HLS = YES ]; then  
324 - if [ $SRS_HTTP_CALLBACK = YES ]; then  
325 - # override the default index.  
326 - rm -f ${SRS_OBJS}/nginx/html/index.html &&  
327 - ln -sf `pwd`/research/players/nginx_index.html ${SRS_OBJS}/nginx/html/index.html  
328 - else  
329 - rm -f ${SRS_OBJS}/nginx/html/index.html &&  
330 - cat<<END >> ${SRS_OBJS}/nginx/html/index.html  
331 -<!DOCTYPE html>  
332 -<html>  
333 -<head>  
334 - <title>SRS</title>  
335 - <meta charset="utf-8">  
336 -</head>  
337 -<body>  
338 - <script type="text/javascript">  
339 - setTimeout(function(){  
340 - window.location.href = "players/index.html" + window.location.search;  
341 - }, 500);  
342 - </script>  
343 -</body> 365 +if [ $SRS_ARM_UBUNTU12 = NO ]; then
  366 + if [ $SRS_HLS = YES ]; then
  367 + if [ $SRS_HTTP_CALLBACK = YES ]; then
  368 + # override the default index.
  369 + rm -f ${SRS_OBJS}/nginx/html/index.html &&
  370 + ln -sf `pwd`/research/players/nginx_index.html ${SRS_OBJS}/nginx/html/index.html
  371 + else
  372 + rm -f ${SRS_OBJS}/nginx/html/index.html &&
  373 + cat<<END >> ${SRS_OBJS}/nginx/html/index.html
  374 + <!DOCTYPE html>
  375 + <html>
  376 + <head>
  377 + <title>SRS</title>
  378 + <meta charset="utf-8">
  379 + </head>
  380 + <body>
  381 + <script type="text/javascript">
  382 + setTimeout(function(){
  383 + window.location.href = "players/index.html" + window.location.search;
  384 + }, 500);
  385 + </script>
  386 + </body>
344 END 387 END
  388 + fi
345 fi 389 fi
346 fi 390 fi
347 391
@@ -349,17 +393,37 @@ fi @@ -349,17 +393,37 @@ fi
349 # openssl, for rtmp complex handshake 393 # openssl, for rtmp complex handshake
350 ##################################################################################### 394 #####################################################################################
351 if [ $SRS_SSL = YES ]; then 395 if [ $SRS_SSL = YES ]; then
352 - if [[ -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then  
353 - echo "openssl-1.0.1f is ok."; 396 + # check the arm flag file, if flag changed, need to rebuild the st.
  397 + if [ $SRS_ARM_UBUNTU12 = YES ]; then
  398 + # ok, arm specified, if the flag filed does not exists, need to rebuild.
  399 + if [[ -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
  400 + echo "openssl-1.0.1f for arm is ok.";
  401 + else
  402 + echo "build openssl-1.0.1f for arm";
  403 + (
  404 + rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&
  405 + unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&
  406 + ./Configure --prefix=`pwd`/_release -no-shared no-asm linux-armv4 &&
  407 + make CC=${SrsArmCC} GCC=${SrsArmGCC} AR="${SrsArmAR} r" KD=${SrsArmLD} LINK=${SrsArmLINK} RANDLIB=${SrsArmRANDLIB} && make install &&
  408 + cd .. && ln -sf openssl-1.0.1f/_release openssl &&
  409 + cd .. && touch ${SRS_OBJS}/_flag.ssl.arm.tmp
  410 + )
  411 + fi
354 else 412 else
355 - echo "build openssl-1.0.1f";  
356 - (  
357 - rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&  
358 - unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&  
359 - ./config --prefix=`pwd`/_release -no-shared &&  
360 - make && make install &&  
361 - cd .. && ln -sf openssl-1.0.1f/_release openssl  
362 - ) 413 + # arm not specified, if exists flag, need to rebuild for no-arm platform.
  414 + if [[ ! -f ${SRS_OBJS}/_flag.ssl.arm.tmp && -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
  415 + echo "openssl-1.0.1f is ok.";
  416 + else
  417 + echo "build openssl-1.0.1f";
  418 + (
  419 + rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&
  420 + unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&
  421 + ./config --prefix=`pwd`/_release -no-shared &&
  422 + make && make install &&
  423 + cd .. && ln -sf openssl-1.0.1f/_release openssl &&
  424 + cd .. && rm -f ${SRS_OBJS}/_flag.ssl.arm.tmp
  425 + )
  426 + fi
363 fi 427 fi
364 # check status 428 # check status
365 ret=$?; if [[ $ret -ne 0 ]]; then echo "build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi 429 ret=$?; if [[ $ret -ne 0 ]]; then echo "build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi
@@ -471,3 +535,12 @@ if [ $SRS_GPERF_CP = YES ]; then @@ -471,3 +535,12 @@ if [ $SRS_GPERF_CP = YES ]; then
471 else 535 else
472 echo "#undef SRS_GPERF_CP" >> $SRS_AUTO_HEADERS_H 536 echo "#undef SRS_GPERF_CP" >> $SRS_AUTO_HEADERS_H
473 fi 537 fi
  538 +
  539 +#####################################################################################
  540 +# for arm.
  541 +#####################################################################################
  542 +if [ $SRS_ARM_UBUNTU12 = YES ]; then
  543 + echo "#define SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H
  544 +else
  545 + echo "#undef SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H
  546 +fi
@@ -24,24 +24,10 @@ SRS_GPERF_MC=RESERVED # gperf memory check @@ -24,24 +24,10 @@ SRS_GPERF_MC=RESERVED # gperf memory check
24 SRS_GPERF_MP=RESERVED # gperf memory profile 24 SRS_GPERF_MP=RESERVED # gperf memory profile
25 SRS_GPERF_CP=RESERVED # gperf cpu profile 25 SRS_GPERF_CP=RESERVED # gperf cpu profile
26 SRS_GPROF=RESERVED # gprof 26 SRS_GPROF=RESERVED # gprof
  27 +SRS_ARM_UBUNTU12=RESERVED # armhf(v7cpu) built on ubuntu12
27 # arguments 28 # arguments
28 SRS_JOBS=1 29 SRS_JOBS=1
29 30
30 -# TODO: remove the default to yes.  
31 -SRS_HLS=YES  
32 -SRS_SSL=YES  
33 -SRS_FFMPEG=YES  
34 -SRS_HTTP_CALLBACK=YES  
35 -SRS_LIBRTMP=YES  
36 -SRS_BWTC=NO  
37 -SRS_RESEARCH=NO  
38 -SRS_UTEST=YES  
39 -SRS_GPERF=NO  
40 -SRS_GPERF_MC=NO  
41 -SRS_GPERF_MP=NO  
42 -SRS_GPERF_CP=NO  
43 -SRS_GPROF=NO  
44 -  
45 ##################################################################################### 31 #####################################################################################
46 # parse options 32 # parse options
47 ##################################################################################### 33 #####################################################################################
@@ -75,6 +61,7 @@ do @@ -75,6 +61,7 @@ do
75 --with-gmp) SRS_GPERF_MP=YES ;; 61 --with-gmp) SRS_GPERF_MP=YES ;;
76 --with-gcp) SRS_GPERF_CP=YES ;; 62 --with-gcp) SRS_GPERF_CP=YES ;;
77 --with-gprof) SRS_GPROF=YES ;; 63 --with-gprof) SRS_GPROF=YES ;;
  64 + --with-arm-ubuntu12) SRS_ARM_UBUNTU12=YES ;;
78 65
79 --without-ssl) SRS_SSL=NO ;; 66 --without-ssl) SRS_SSL=NO ;;
80 --without-hls) SRS_HLS=NO ;; 67 --without-hls) SRS_HLS=NO ;;
@@ -89,6 +76,7 @@ do @@ -89,6 +76,7 @@ do
89 --without-gmp) SRS_GPERF_MP=NO ;; 76 --without-gmp) SRS_GPERF_MP=NO ;;
90 --without-gcp) SRS_GPERF_CP=NO ;; 77 --without-gcp) SRS_GPERF_CP=NO ;;
91 --without-gprof) SRS_GPROF=NO ;; 78 --without-gprof) SRS_GPROF=NO ;;
  79 + --without-arm-ubuntu12) SRS_ARM_UBUNTU12=NO ;;
92 80
93 --jobs) SRS_JOBS=${value} ;; 81 --jobs) SRS_JOBS=${value} ;;
94 82
@@ -99,6 +87,42 @@ do @@ -99,6 +87,42 @@ do
99 esac 87 esac
100 done 88 done
101 89
  90 +#####################################################################################
  91 +# apply the default value when user donot specified.
  92 +#####################################################################################
  93 +# if arm specified, set some default to disabled.
  94 +if [ $SRS_ARM_UBUNTU12 = YES ]; then
  95 + if [ $SRS_HLS = RESERVED ]; then SRS_HLS=NO; fi
  96 + if [ $SRS_SSL = RESERVED ]; then SRS_SSL=NO; fi
  97 + if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=NO; fi
  98 + if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=NO; fi
  99 + if [ $SRS_LIBRTMP = RESERVED ]; then SRS_LIBRTMP=NO; fi
  100 + if [ $SRS_BWTC = RESERVED ]; then SRS_BWTC=NO; fi
  101 + if [ $SRS_RESEARCH = RESERVED ]; then SRS_RESEARCH=NO; fi
  102 + if [ $SRS_UTEST = RESERVED ]; then SRS_UTEST=NO; fi
  103 + if [ $SRS_GPERF = RESERVED ]; then SRS_GPERF=NO; fi
  104 + if [ $SRS_GPERF_MC = RESERVED ]; then SRS_GPERF_MC=NO; fi
  105 + if [ $SRS_GPERF_MP = RESERVED ]; then SRS_GPERF_MP=NO; fi
  106 + if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi
  107 + if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi
  108 + if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi
  109 +else
  110 + if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi
  111 + if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi
  112 + if [ $SRS_FFMPEG = RESERVED ]; then SRS_FFMPEG=YES; fi
  113 + if [ $SRS_HTTP_CALLBACK = RESERVED ]; then SRS_HTTP_CALLBACK=YES; fi
  114 + if [ $SRS_LIBRTMP = RESERVED ]; then SRS_LIBRTMP=YES; fi
  115 + if [ $SRS_BWTC = RESERVED ]; then SRS_BWTC=NO; fi
  116 + if [ $SRS_RESEARCH = RESERVED ]; then SRS_RESEARCH=NO; fi
  117 + if [ $SRS_UTEST = RESERVED ]; then SRS_UTEST=YES; fi
  118 + if [ $SRS_GPERF = RESERVED ]; then SRS_GPERF=NO; fi
  119 + if [ $SRS_GPERF_MC = RESERVED ]; then SRS_GPERF_MC=NO; fi
  120 + if [ $SRS_GPERF_MP = RESERVED ]; then SRS_GPERF_MP=NO; fi
  121 + if [ $SRS_GPERF_CP = RESERVED ]; then SRS_GPERF_CP=NO; fi
  122 + if [ $SRS_GPROF = RESERVED ]; then SRS_GPROF=NO; fi
  123 + if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then SRS_ARM_UBUNTU12=NO; fi
  124 +fi
  125 +
102 # parse the jobs for make 126 # parse the jobs for make
103 if [[ "" -eq SRS_JOBS ]]; then 127 if [[ "" -eq SRS_JOBS ]]; then
104 export SRS_JOBS="--jobs" 128 export SRS_JOBS="--jobs"
@@ -120,7 +144,7 @@ if [ $help = yes ]; then @@ -120,7 +144,7 @@ if [ $help = yes ]; then
120 --with-ssl enable rtmp complex handshake, requires openssl-devel installed. 144 --with-ssl enable rtmp complex handshake, requires openssl-devel installed.
121 to delivery h264 video and aac audio to flash player. 145 to delivery h264 video and aac audio to flash player.
122 --with-hls enable hls streaming, build nginx as http server for hls. 146 --with-hls enable hls streaming, build nginx as http server for hls.
123 - --with-http-callback enable http hooks, build cherrypy as demo api server. 147 + --with-http-callback enable http hooks, build cherrypy as demo api server.
124 srs will call the http hooks, such as: on_connect. 148 srs will call the http hooks, such as: on_connect.
125 --with-ffmpeg enable transcoding with ffmpeg. 149 --with-ffmpeg enable transcoding with ffmpeg.
126 --with-librtmp enable srs-librtmp, library for client. 150 --with-librtmp enable srs-librtmp, library for client.
@@ -132,10 +156,11 @@ if [ $help = yes ]; then @@ -132,10 +156,11 @@ if [ $help = yes ]; then
132 --with-gmp build memory profile for srs with gperf tools. 156 --with-gmp build memory profile for srs with gperf tools.
133 --with-gcp build cpu profile for srs with gperf tools. 157 --with-gcp build cpu profile for srs with gperf tools.
134 --with-gprof build srs with gprof(GNU profile tool). 158 --with-gprof build srs with gprof(GNU profile tool).
  159 + --with-arm-ubuntu12 build srs on ubuntu12 for armhf(v7cpu).
135 160
136 --without-ssl disable rtmp complex handshake. 161 --without-ssl disable rtmp complex handshake.
137 --without-hls disable hls, rtmp streaming only. 162 --without-hls disable hls, rtmp streaming only.
138 - --without-http-callback disable http, http hooks callback. 163 + --without-http-callback disable http, http hooks callback.
139 --without-ffmpeg disable the ffmpeg transcoding feature. 164 --without-ffmpeg disable the ffmpeg transcoding feature.
140 --without-librtmp disable srs-librtmp, library for client. 165 --without-librtmp disable srs-librtmp, library for client.
141 --without-bwtc disable srs bandwidth test client tool. 166 --without-bwtc disable srs bandwidth test client tool.
@@ -146,6 +171,7 @@ if [ $help = yes ]; then @@ -146,6 +171,7 @@ if [ $help = yes ]; then
146 --without-gmp do not build memory profile for srs with gperf tools. 171 --without-gmp do not build memory profile for srs with gperf tools.
147 --without-gcp do not build cpu profile for srs with gperf tools. 172 --without-gcp do not build cpu profile for srs with gperf tools.
148 --without-gprof do not build srs with gprof(GNU profile tool). 173 --without-gprof do not build srs with gprof(GNU profile tool).
  174 + --without-arm-ubuntu12 do not build srs on ubuntu12 for armhf(v7cpu).
149 175
150 --jobs[=N] Allow N jobs at once; infinite jobs with no arg. 176 --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
151 used for make in the configure, for example, to make ffmpeg. 177 used for make in the configure, for example, to make ffmpeg.
@@ -181,6 +207,21 @@ if [ $__gperf_slow = YES ]; then if [ $SRS_GPROF = YES ]; then @@ -181,6 +207,21 @@ if [ $__gperf_slow = YES ]; then if [ $SRS_GPROF = YES ]; then
181 echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO; 207 echo "gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
182 fi fi 208 fi fi
183 209
  210 +# check arm, if arm enabled, only allow st/ssl/librtmp,
  211 +# user should disable all other features
  212 +if [ $SRS_ARM_UBUNTU12 = YES ]; then
  213 + if [ $SRS_FFMPEG = YES ]; then echo "ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  214 + if [ $SRS_HTTP_CALLBACK = YES ]; then echo "http-callback for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  215 + if [ $SRS_BWTC = YES ]; then echo "bwtc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  216 + if [ $SRS_RESEARCH = YES ]; then echo "research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  217 + if [ $SRS_UTEST = YES ]; then echo "utest for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  218 + if [ $SRS_GPERF = YES ]; then echo "gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  219 + if [ $SRS_GPERF_MC = YES ]; then echo "gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  220 + if [ $SRS_GPERF_MP = YES ]; then echo "gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  221 + if [ $SRS_GPERF_CP = YES ]; then echo "gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  222 + if [ $SRS_GPROF = YES ]; then echo "gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
  223 +fi
  224 +
184 # check variable neccessary 225 # check variable neccessary
185 if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi 226 if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
186 if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi 227 if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
@@ -195,6 +236,7 @@ if [ $SRS_GPERF_MC = RESERVED ]; then echo "you must specifies the gperf-mc, see @@ -195,6 +236,7 @@ if [ $SRS_GPERF_MC = RESERVED ]; then echo "you must specifies the gperf-mc, see
195 if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi 236 if [ $SRS_GPERF_MP = RESERVED ]; then echo "you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
196 if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi 237 if [ $SRS_GPERF_CP = RESERVED ]; then echo "you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
197 if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi 238 if [ $SRS_GPROF = RESERVED ]; then echo "you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
  239 +if [ $SRS_ARM_UBUNTU12 = RESERVED ]; then echo "you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
198 if [ $__check_ok = NO ]; then 240 if [ $__check_ok = NO ]; then
199 exit 1; 241 exit 1;
200 fi 242 fi
@@ -214,5 +256,6 @@ if [ $SRS_GPERF_MC = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmc"; el @@ -214,5 +256,6 @@ if [ $SRS_GPERF_MC = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmc"; el
214 if [ $SRS_GPERF_MP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gmp"; fi 256 if [ $SRS_GPERF_MP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gmp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gmp"; fi
215 if [ $SRS_GPERF_CP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gcp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gcp"; fi 257 if [ $SRS_GPERF_CP = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gcp"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gcp"; fi
216 if [ $SRS_GPROF = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gprof"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gprof"; fi 258 if [ $SRS_GPROF = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-gprof"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-gprof"; fi
  259 +if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-arm-ubuntu12"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-arm-ubuntu12"; fi
217 SRS_CONFIGURE="${SRS_CONFIGURE} ${SRS_JOBS}" 260 SRS_CONFIGURE="${SRS_CONFIGURE} ${SRS_JOBS}"
218 echo "regenerate config: ${SRS_CONFIGURE}" 261 echo "regenerate config: ${SRS_CONFIGURE}"
@@ -37,6 +37,15 @@ echo "#define SRS_CONFIGURE \"${SRS_CONFIGURE}\"" > $SRS_AUTO_HEADERS_H @@ -37,6 +37,15 @@ echo "#define SRS_CONFIGURE \"${SRS_CONFIGURE}\"" > $SRS_AUTO_HEADERS_H
37 echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H 37 echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H
38 echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H 38 echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H
39 39
  40 +# the arm-ubuntu12 options for make for depends
  41 +SrsArmCC="arm-linux-gnueabi-gcc"
  42 +SrsArmGCC="arm-linux-gnueabi-gcc"
  43 +SrsArmCXX="arm-linux-gnueabi-g++"
  44 +SrsArmLINK="arm-linux-gnueabi-g++"
  45 +SrsArmAR="arm-linux-gnueabi-ar"
  46 +SrsArmLD="arm-linux-gnueabi-ld"
  47 +SrsArmRANDLIB="arm-linux-gnueabi-ranlib"
  48 +
40 # apply user options. 49 # apply user options.
41 . auto/depends.sh 50 . auto/depends.sh
42 51
@@ -247,12 +256,25 @@ SrsGperf=""; SrsGperfLink=""; if [ $SRS_GPERF = YES ]; then SrsGperfLink=" -lpth @@ -247,12 +256,25 @@ SrsGperf=""; SrsGperfLink=""; if [ $SRS_GPERF = YES ]; then SrsGperfLink=" -lpth
247 # the cxx flag generated. 256 # the cxx flag generated.
248 CXXFLAGS="${CppStd}${WarnLevel}${GDBDebug}${LibraryCompile}${SrsGprof}" 257 CXXFLAGS="${CppStd}${WarnLevel}${GDBDebug}${LibraryCompile}${SrsGprof}"
249 if [ $SRS_GPERF = YES ]; then CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"; fi 258 if [ $SRS_GPERF = YES ]; then CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"; fi
250 -cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}  
251 -CC ?= gcc  
252 -GCC ?= gcc  
253 -CXX ?= g++  
254 -AR ?= ar  
255 -LINK ?= g++ 259 +# arm or i386/x86_64
  260 +if [ $SRS_ARM_UBUNTU12 = YES ]; then
  261 + cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}
  262 +CC = ${SrsArmCC}
  263 +GCC = ${SrsArmGCC}
  264 +CXX = ${SrsArmCXX}
  265 +AR = ${SrsArmAR}
  266 +LINK = ${SrsArmLINK}
  267 +END
  268 +else
  269 + cat << END > ${SRS_OBJS}/${SRS_MAKEFILE}
  270 +CC = gcc
  271 +GCC = gcc
  272 +CXX = g++
  273 +AR = ar
  274 +LINK = g++
  275 +END
  276 +fi
  277 +cat << END >> ${SRS_OBJS}/${SRS_MAKEFILE}
256 CXXFLAGS = ${CXXFLAGS} 278 CXXFLAGS = ${CXXFLAGS}
257 279
258 .PHONY: default srs bandwidth librtmp 280 .PHONY: default srs bandwidth librtmp
@@ -277,6 +299,8 @@ if [ $SRS_SSL = YES ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile @@ -277,6 +299,8 @@ if [ $SRS_SSL = YES ]; then LibSSLRoot="${SRS_OBJS}/openssl/include"; LibSSLfile
277 # gperftools-2.1, for mem check and mem/cpu profile 299 # gperftools-2.1, for mem check and mem/cpu profile
278 LibGperfRoot=""; LibGperfFile="" 300 LibGperfRoot=""; LibGperfFile=""
279 if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi 301 if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS}/gperf/include"; LibGperfFile="${SRS_OBJS}/gperf/lib/libtcmalloc_and_profiler.a"; fi
  302 +# the link options, if arm, use static link
  303 +SrsLinkOptions="-ldl"; if [ $SRS_ARM_UBUNTU12 = YES ]; then SrsLinkOptions="-ldl -static"; fi
280 304
281 ##################################################################################### 305 #####################################################################################
282 # Modules, compile each module, then link to binary 306 # Modules, compile each module, then link to binary
@@ -344,7 +368,7 @@ MAIN_ENTRANCES=("srs_main_server" "srs_main_bandcheck") @@ -344,7 +368,7 @@ MAIN_ENTRANCES=("srs_main_server" "srs_main_bandcheck")
344 ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile}) 368 ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile} ${LibGperfFile})
345 # all depends objects 369 # all depends objects
346 MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}" 370 MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]} ${MAIN_OBJS[@]}"
347 -LINK_OPTIONS="-ldl${SrsGprofLink}${SrsGperfLink}" 371 +LINK_OPTIONS="${SrsLinkOptions}${SrsGprofLink}${SrsGperfLink}"
348 # 372 #
349 # srs: 373 # srs:
350 # srs(simple rtmp server) over st(state-threads) 374 # srs(simple rtmp server) over st(state-threads)
@@ -447,6 +471,11 @@ if [ $SRS_GPROF = YES ]; then @@ -447,6 +471,11 @@ if [ $SRS_GPROF = YES ]; then
447 else 471 else
448 echo -e "${GREEN}note: gprof(GNU profile tool) for srs are not builded${BLACK}" 472 echo -e "${GREEN}note: gprof(GNU profile tool) for srs are not builded${BLACK}"
449 fi 473 fi
  474 +if [ $SRS_ARM_UBUNTU12 = YES ]; then
  475 + echo -e "${GREEN}arm-ubuntu12(armhf, v7cpu) for srs are builded${BLACK}"
  476 +else
  477 + echo -e "${GREEN}note: arm-ubuntu12(armhf, v7cpu) for srs are not builded${BLACK}"
  478 +fi
450 479
451 ##################################################################################### 480 #####################################################################################
452 # next step 481 # next step
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR "0" 32 #define VERSION_MAJOR "0"
33 #define VERSION_MINOR "9" 33 #define VERSION_MINOR "9"
34 -#define VERSION_REVISION "16" 34 +#define VERSION_REVISION "17"
35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "srs" 37 #define RTMP_SIG_SRS_KEY "srs"