From 9a582b0e4a59e39d9cac7760217e81dd8e59b360 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 30 Nov 2013 14:12:19 +0800 Subject: [PATCH] refine the configure --- trunk/auto/build_ffmpeg.sh | 14 ++++++++------ trunk/configure | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/trunk/auto/build_ffmpeg.sh b/trunk/auto/build_ffmpeg.sh index 252d7680e..f954f4894 100644 --- a/trunk/auto/build_ffmpeg.sh +++ b/trunk/auto/build_ffmpeg.sh @@ -1,5 +1,7 @@ #!/bin/bash +ff_src_dir="../../3rdparty" + ff_current_dir=$(pwd -P) ff_build_dir="${ff_current_dir}/_build" ff_release_dir="${ff_current_dir}/_release" @@ -18,7 +20,7 @@ if [[ -f ${ff_yasm_bin} ]]; then else echo "build yasm-1.2.0" cd $ff_current_dir && - rm -rf yasm-1.2.0 && unzip -q ../../3rdparty/yasm-1.2.0.zip && + rm -rf yasm-1.2.0 && unzip -q ${ff_src_dir}/yasm-1.2.0.zip && cd yasm-1.2.0 && ./configure --prefix=${ff_release_dir} && make && make install 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 else echo "build yasm-1.2.0" cd $ff_current_dir && - rm -rf libaacplus-2.0.2 && unzip -q ../../3rdparty/libaacplus-2.0.2.zip && - cd libaacplus-2.0.2 && cp ../../../3rdparty/libaacplus-patch-26410-800.zip src/26410-800.zip && + rm -rf libaacplus-2.0.2 && unzip -q ${ff_src_dir}/libaacplus-2.0.2.zip && + cd libaacplus-2.0.2 && cp ../${ff_src_dir}/libaacplus-patch-26410-800.zip src/26410-800.zip && bash autogen.sh && ./configure --prefix=${ff_release_dir} --enable-static && make && make install ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build libaacplus-2.0.2 failed"; exit 1; fi fi @@ -42,7 +44,7 @@ if [[ -f ${ff_release_dir}/lib/libmp3lame.a ]]; then else echo "build lame-3.99.5" cd $ff_current_dir && - rm -rf lame-3.99.5 && unzip -q ../../3rdparty/lame-3.99.5.zip && + rm -rf lame-3.99.5 && unzip -q ${ff_src_dir}/lame-3.99.5.zip && cd lame-3.99.5 && ./configure --prefix=${ff_release_dir} --enable-static && make && make install ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build lame-3.99.5 failed"; exit 1; fi fi @@ -53,7 +55,7 @@ if [[ -f ${ff_release_dir}/lib/libx264.a ]]; then else echo "build x264" cd $ff_current_dir && - rm -rf x264-snapshot-20131129-2245-stable && unzip -q ../../3rdparty/x264-snapshot-20131129-2245-stable.zip && + rm -rf x264-snapshot-20131129-2245-stable && unzip -q ${ff_src_dir}/x264-snapshot-20131129-2245-stable.zip && cd x264-snapshot-20131129-2245-stable && ./configure --prefix=${ff_release_dir} --bit-depth=10 --enable-static && make && make install ret=$?; if [[ 0 -ne ${ret} ]]; then echo "build x264 failed"; exit 1; fi fi @@ -64,7 +66,7 @@ if [[ -f ${ff_release_dir}/bin/ffmpeg ]]; then else echo "build ffmpeg-2.1.1" cd $ff_current_dir && - rm -rf ffmpeg-2.1.1 && unzip -q ../../3rdparty/ffmpeg-2.1.1.zip && + rm -rf ffmpeg-2.1.1 && unzip -q ${ff_src_dir}/ffmpeg-2.1.1.zip && echo "remove all so to force the ffmpeg to build in static" && rm -f ${ff_release_dir}/lib/*.so* && echo "export the dir to enable the build command canbe use." && diff --git a/trunk/configure b/trunk/configure index a7b8d9fb5..989f1ebd6 100755 --- a/trunk/configure +++ b/trunk/configure @@ -6,6 +6,12 @@ SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp" mkdir -p ${SRS_OBJS} +# linux shell color support. +RED="\\e[31m" +GREEN="\\e[32m" +YELLOW="\\e[33m" +BLACK="\\e[0m" + # parse user options. . auto/options.sh @@ -119,11 +125,34 @@ BUILD_KEY="simple_rtmp_server" APP_MAIN="srs_main_server" APP_NAME="simple_rtmp_ echo 'configure ok! ' +# summary +echo "" +echo "configure summary:" +if [ $SRS_HLS = YES ]; then + echo -e "${GREEN}HLS over nginx is enabled${BLACK}" +else + echo -e "warning: without HLS support" +fi +if [ $SRS_SSL = YES ]; then + echo -e "${GREEN}rtmp complex handshake is enabled${BLACK}" +else + echo -e "${YELLOW}warning: without rtmp complex handshake support, donot support h264/aac to adobe flash player${BLACK}" +fi +if [ $SRS_FFMPEG = YES ]; then + echo -e "${GREEN}live stream transcoding over FFMPEG is enabled${BLACK}" +else + echo -e "${YELLOW}warning: without live stream transcoding over FFMPEG support${BLACK}" +fi + # next step. +echo "" echo "you can:" echo "\" make \" to build the srs(simple rtmp server)." echo "\" make help \" to get the usage of make" if [ $SRS_HLS = YES ]; then echo "\" sudo ./objs/nginx/sbin/nginx \" to start the nginx http server for hls" fi +if [ $SRS_FFMPEG = YES ]; then + echo -e "\" ./objs/ffmpeg/bin/ffmpeg \" is used for live stream transcoding" +fi echo "\" ./objs/simple_rtmp_server -c conf/srs.conf \" to start the srs live server"