winlin

use local openssl and link libssl.a

不能预览此文件类型
@@ -6,6 +6,9 @@ nginx-1.5.7.zip @@ -6,6 +6,9 @@ nginx-1.5.7.zip
6 6
7 st-1.9.zip 7 st-1.9.zip
8 basic framework for srs. 8 basic framework for srs.
  9 +
  10 +openssl-1.0.1f.zip
  11 + openssl for SRS(with-ssl) RTMP complex handshake to delivery h264+aac stream.
9 12
10 CherryPy-3.2.4.zip 13 CherryPy-3.2.4.zip
11 sample api server for srs. 14 sample api server for srs.
@@ -44,4 +47,7 @@ links: @@ -44,4 +47,7 @@ links:
44 cherrypy: 47 cherrypy:
45 http://www.cherrypy.org/ 48 http://www.cherrypy.org/
46 https://pypi.python.org/pypi/CherryPy/3.2.4 49 https://pypi.python.org/pypi/CherryPy/3.2.4
  50 + openssl:
  51 + http://www.openssl.org/
  52 + http://www.openssl.org/source/openssl-1.0.1f.tar.gz
47 53
@@ -21,7 +21,7 @@ function require_sudoer() @@ -21,7 +21,7 @@ function require_sudoer()
21 } 21 }
22 22
23 # TODO: check gcc/g++ 23 # TODO: check gcc/g++
24 -echo "check gcc/g++/gdb/make/openssl-devel" 24 +echo "check gcc/g++/gdb/make"
25 echo "depends tools are ok" 25 echo "depends tools are ok"
26 ##################################################################################### 26 #####################################################################################
27 # for Ubuntu, auto install tools by apt-get 27 # for Ubuntu, auto install tools by apt-get
@@ -91,13 +91,6 @@ function Ubuntu_prepare() @@ -91,13 +91,6 @@ function Ubuntu_prepare()
91 echo "install libfreetype6-dev success" 91 echo "install libfreetype6-dev success"
92 fi 92 fi
93 93
94 - if [[ ! -d /usr/include/openssl ]]; then  
95 - echo "install libssl-dev"  
96 - require_sudoer "sudo apt-get install -y libssl-dev"  
97 - sudo apt-get install -y libssl-dev  
98 - echo "install libssl-dev success"  
99 - fi  
100 -  
101 echo "Ubuntu install tools success" 94 echo "Ubuntu install tools success"
102 } 95 }
103 Ubuntu_prepare 96 Ubuntu_prepare
@@ -175,13 +168,6 @@ function Centos_prepare() @@ -175,13 +168,6 @@ function Centos_prepare()
175 echo "install freetype-devel success" 168 echo "install freetype-devel success"
176 fi 169 fi
177 170
178 - if [[ ! -d /usr/include/openssl ]]; then  
179 - echo "install openssl-devel"  
180 - require_sudoer "sudo yum install -y openssl-devel"  
181 - sudo yum install -y openssl-devel  
182 - echo "install openssl-devel success"  
183 - fi  
184 -  
185 echo "Centos install tools success" 171 echo "Centos install tools success"
186 } 172 }
187 Centos_prepare 173 Centos_prepare
@@ -356,6 +342,23 @@ fi @@ -356,6 +342,23 @@ fi
356 # openssl, for rtmp complex handshake 342 # openssl, for rtmp complex handshake
357 ##################################################################################### 343 #####################################################################################
358 if [ $SRS_SSL = YES ]; then 344 if [ $SRS_SSL = YES ]; then
  345 + if [[ -f ${SRS_OBJS}/openssl/lib/libssl.a ]]; then
  346 + echo "openssl-1.0.1f is ok.";
  347 + else
  348 + echo "build openssl-1.0.1f";
  349 + (
  350 + rm -rf ${SRS_OBJS}/openssl-1.0.1f && cd ${SRS_OBJS} &&
  351 + unzip -q ../3rdparty/openssl-1.0.1f.zip && cd openssl-1.0.1f &&
  352 + ./config --prefix=`pwd`/_release -no-shared && make && make install &&
  353 + cd .. && ln -sf openssl-1.0.1f/_release openssl
  354 + )
  355 + fi
  356 + # check status
  357 + ret=$?; if [[ $ret -ne 0 ]]; then echo "build openssl-1.0.1f failed, ret=$ret"; exit $ret; fi
  358 + if [ ! -f ${SRS_OBJS}/openssl/lib/libssl.a ]; then echo "build openssl-1.0.1f failed."; exit -1; fi
  359 +fi
  360 +
  361 +if [ $SRS_SSL = YES ]; then
359 echo "#define SRS_SSL" >> $SRS_AUTO_HEADERS_H 362 echo "#define SRS_SSL" >> $SRS_AUTO_HEADERS_H
360 else 363 else
361 echo "#undef SRS_SSL" >> $SRS_AUTO_HEADERS_H 364 echo "#undef SRS_SSL" >> $SRS_AUTO_HEADERS_H
@@ -151,7 +151,7 @@ fi @@ -151,7 +151,7 @@ fi
151 # all depends objects 151 # all depends objects
152 MODULE_OBJS="${CORE_OBJS[@]} ${CONFIG_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}" 152 MODULE_OBJS="${CORE_OBJS[@]} ${CONFIG_OBJS[@]} ${PROTOCOL_OBJS[@]} ${MAIN_OBJS[@]}"
153 if [ $SRS_SSL = YES ]; then 153 if [ $SRS_SSL = YES ]; then
154 - LINK_OPTIONS="-ldl -lssl -lcrypto" 154 + LINK_OPTIONS="-ldl ${SRS_OBJS}/openssl/lib/libssl.a ${SRS_OBJS}/openssl/lib/libcrypto.a"
155 else 155 else
156 LINK_OPTIONS="-ldl" 156 LINK_OPTIONS="-ldl"
157 fi 157 fi