winlin

refine the configure

1 #!/bin/bash 1 #!/bin/bash
2 2
  3 +ff_src_dir="../../3rdparty"
  4 +
3 ff_current_dir=$(pwd -P) 5 ff_current_dir=$(pwd -P)
4 ff_build_dir="${ff_current_dir}/_build" 6 ff_build_dir="${ff_current_dir}/_build"
5 ff_release_dir="${ff_current_dir}/_release" 7 ff_release_dir="${ff_current_dir}/_release"
@@ -18,7 +20,7 @@ if [[ -f ${ff_yasm_bin} ]]; then @@ -18,7 +20,7 @@ if [[ -f ${ff_yasm_bin} ]]; then
18 else 20 else
19 echo "build yasm-1.2.0" 21 echo "build yasm-1.2.0"
20 cd $ff_current_dir && 22 cd $ff_current_dir &&
21 - rm -rf yasm-1.2.0 && unzip -q ../../3rdparty/yasm-1.2.0.zip && 23 + rm -rf yasm-1.2.0 && unzip -q ${ff_src_dir}/yasm-1.2.0.zip &&
22 cd yasm-1.2.0 && ./configure --prefix=${ff_release_dir} && 24 cd yasm-1.2.0 && ./configure --prefix=${ff_release_dir} &&
23 make && make install 25 make && make install
24 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build yasm-1.2.0 failed"; exit 1; fi 26 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build yasm-1.2.0 failed"; exit 1; fi
@@ -30,8 +32,8 @@ if [[ -f ${ff_release_dir}/lib/libaacplus.a ]]; then @@ -30,8 +32,8 @@ if [[ -f ${ff_release_dir}/lib/libaacplus.a ]]; then
30 else 32 else
31 echo "build yasm-1.2.0" 33 echo "build yasm-1.2.0"
32 cd $ff_current_dir && 34 cd $ff_current_dir &&
33 - rm -rf libaacplus-2.0.2 && unzip -q ../../3rdparty/libaacplus-2.0.2.zip &&  
34 - cd libaacplus-2.0.2 && cp ../../../3rdparty/libaacplus-patch-26410-800.zip src/26410-800.zip && 35 + rm -rf libaacplus-2.0.2 && unzip -q ${ff_src_dir}/libaacplus-2.0.2.zip &&
  36 + cd libaacplus-2.0.2 && cp ../${ff_src_dir}/libaacplus-patch-26410-800.zip src/26410-800.zip &&
35 bash autogen.sh && ./configure --prefix=${ff_release_dir} --enable-static && make && make install 37 bash autogen.sh && ./configure --prefix=${ff_release_dir} --enable-static && make && make install
36 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build libaacplus-2.0.2 failed"; exit 1; fi 38 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build libaacplus-2.0.2 failed"; exit 1; fi
37 fi 39 fi
@@ -42,7 +44,7 @@ if [[ -f ${ff_release_dir}/lib/libmp3lame.a ]]; then @@ -42,7 +44,7 @@ if [[ -f ${ff_release_dir}/lib/libmp3lame.a ]]; then
42 else 44 else
43 echo "build lame-3.99.5" 45 echo "build lame-3.99.5"
44 cd $ff_current_dir && 46 cd $ff_current_dir &&
45 - rm -rf lame-3.99.5 && unzip -q ../../3rdparty/lame-3.99.5.zip && 47 + rm -rf lame-3.99.5 && unzip -q ${ff_src_dir}/lame-3.99.5.zip &&
46 cd lame-3.99.5 && ./configure --prefix=${ff_release_dir} --enable-static && make && make install 48 cd lame-3.99.5 && ./configure --prefix=${ff_release_dir} --enable-static && make && make install
47 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build lame-3.99.5 failed"; exit 1; fi 49 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build lame-3.99.5 failed"; exit 1; fi
48 fi 50 fi
@@ -53,7 +55,7 @@ if [[ -f ${ff_release_dir}/lib/libx264.a ]]; then @@ -53,7 +55,7 @@ if [[ -f ${ff_release_dir}/lib/libx264.a ]]; then
53 else 55 else
54 echo "build x264" 56 echo "build x264"
55 cd $ff_current_dir && 57 cd $ff_current_dir &&
56 - rm -rf x264-snapshot-20131129-2245-stable && unzip -q ../../3rdparty/x264-snapshot-20131129-2245-stable.zip && 58 + rm -rf x264-snapshot-20131129-2245-stable && unzip -q ${ff_src_dir}/x264-snapshot-20131129-2245-stable.zip &&
57 cd x264-snapshot-20131129-2245-stable && ./configure --prefix=${ff_release_dir} --bit-depth=10 --enable-static && make && make install 59 cd x264-snapshot-20131129-2245-stable && ./configure --prefix=${ff_release_dir} --bit-depth=10 --enable-static && make && make install
58 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build x264 failed"; exit 1; fi 60 ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build x264 failed"; exit 1; fi
59 fi 61 fi
@@ -64,7 +66,7 @@ if [[ -f ${ff_release_dir}/bin/ffmpeg ]]; then @@ -64,7 +66,7 @@ if [[ -f ${ff_release_dir}/bin/ffmpeg ]]; then
64 else 66 else
65 echo "build ffmpeg-2.1.1" 67 echo "build ffmpeg-2.1.1"
66 cd $ff_current_dir && 68 cd $ff_current_dir &&
67 - rm -rf ffmpeg-2.1.1 && unzip -q ../../3rdparty/ffmpeg-2.1.1.zip && 69 + rm -rf ffmpeg-2.1.1 && unzip -q ${ff_src_dir}/ffmpeg-2.1.1.zip &&
68 echo "remove all so to force the ffmpeg to build in static" && 70 echo "remove all so to force the ffmpeg to build in static" &&
69 rm -f ${ff_release_dir}/lib/*.so* && 71 rm -f ${ff_release_dir}/lib/*.so* &&
70 echo "export the dir to enable the build command canbe use." && 72 echo "export the dir to enable the build command canbe use." &&
@@ -6,6 +6,12 @@ SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp" @@ -6,6 +6,12 @@ SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp"
6 6
7 mkdir -p ${SRS_OBJS} 7 mkdir -p ${SRS_OBJS}
8 8
  9 +# linux shell color support.
  10 +RED="\\e[31m"
  11 +GREEN="\\e[32m"
  12 +YELLOW="\\e[33m"
  13 +BLACK="\\e[0m"
  14 +
9 # parse user options. 15 # parse user options.
10 . auto/options.sh 16 . auto/options.sh
11 17
@@ -119,11 +125,34 @@ BUILD_KEY="simple_rtmp_server" APP_MAIN="srs_main_server" APP_NAME="simple_rtmp_ @@ -119,11 +125,34 @@ BUILD_KEY="simple_rtmp_server" APP_MAIN="srs_main_server" APP_NAME="simple_rtmp_
119 125
120 echo 'configure ok! ' 126 echo 'configure ok! '
121 127
  128 +# summary
  129 +echo ""
  130 +echo "configure summary:"
  131 +if [ $SRS_HLS = YES ]; then
  132 + echo -e "${GREEN}HLS over nginx is enabled${BLACK}"
  133 +else
  134 + echo -e "warning: without HLS support"
  135 +fi
  136 +if [ $SRS_SSL = YES ]; then
  137 + echo -e "${GREEN}rtmp complex handshake is enabled${BLACK}"
  138 +else
  139 + echo -e "${YELLOW}warning: without rtmp complex handshake support, donot support h264/aac to adobe flash player${BLACK}"
  140 +fi
  141 +if [ $SRS_FFMPEG = YES ]; then
  142 + echo -e "${GREEN}live stream transcoding over FFMPEG is enabled${BLACK}"
  143 +else
  144 + echo -e "${YELLOW}warning: without live stream transcoding over FFMPEG support${BLACK}"
  145 +fi
  146 +
122 # next step. 147 # next step.
  148 +echo ""
123 echo "you can:" 149 echo "you can:"
124 echo "\" make \" to build the srs(simple rtmp server)." 150 echo "\" make \" to build the srs(simple rtmp server)."
125 echo "\" make help \" to get the usage of make" 151 echo "\" make help \" to get the usage of make"
126 if [ $SRS_HLS = YES ]; then 152 if [ $SRS_HLS = YES ]; then
127 echo "\" sudo ./objs/nginx/sbin/nginx \" to start the nginx http server for hls" 153 echo "\" sudo ./objs/nginx/sbin/nginx \" to start the nginx http server for hls"
128 fi 154 fi
  155 +if [ $SRS_FFMPEG = YES ]; then
  156 + echo -e "\" ./objs/ffmpeg/bin/ffmpeg \" is used for live stream transcoding"
  157 +fi
129 echo "\" ./objs/simple_rtmp_server -c conf/srs.conf \" to start the srs live server" 158 echo "\" ./objs/simple_rtmp_server -c conf/srs.conf \" to start the srs live server"