if[$SRS_TRANSCODE= YES ]; then if[$SRS_FFMPEG_TOOL= RESERVED ]; then SRS_FFMPEG_TOOL=YES; fi fi
if[$SRS_INGEST= YES ]; then if[$SRS_FFMPEG_TOOL= RESERVED ]; then SRS_FFMPEG_TOOL=YES; fi fi
# if http-xxxx specified, open the SRS_HTTP_PARSER
SRS_HTTP_PARSER=NO
if[$SRS_HTTP_CALLBACK= YES ]; then SRS_HTTP_PARSER=YES; fi
if[$SRS_HTTP_SERVER= YES ]; then SRS_HTTP_PARSER=YES; fi
if[$SRS_HTTP_API= YES ]; then SRS_HTTP_PARSER=YES; fi
# parse the jobs for make
if[["" -eq SRS_JOBS ]]; then
export SRS_JOBS="--jobs"
else
export SRS_JOBS="--jobs=${SRS_JOBS}"
fi
# if http-xxxx specified, open the SRS_HTTP_PARSER
SRS_HTTP_PARSER=NO
if[$SRS_HTTP_CALLBACK= YES ]; then SRS_HTTP_PARSER=YES; fi
if[$SRS_HTTP_SERVER= YES ]; then SRS_HTTP_PARSER=YES; fi
if[$SRS_HTTP_API= YES ]; then SRS_HTTP_PARSER=YES; fi
# save all config options to macro to write to auto headers file
SRS_AUTO_USER_CONFIGURE="$opt"
# parse the jobs for make
if[["" -eq SRS_JOBS ]]; then
export SRS_JOBS="--jobs=1"
else
export SRS_JOBS="--jobs=${SRS_JOBS}"
fi
}
apply_user_detail_options
function regenerate_options(){
# save all config options to macro to write to auto headers file
SRS_AUTO_USER_CONFIGURE="$opt"
# regenerate the options for default values.
SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
if[$SRS_HLS= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-hls"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-hls"; fi
if[$SRS_DVR= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-dvr"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-dvr"; fi
if[$SRS_NGINX= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-nginx"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-nginx"; fi
if[$SRS_SSL= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ssl"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ssl"; fi
if[$SRS_FFMPEG_TOOL= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ffmpeg"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ffmpeg"; fi
if[$SRS_TRANSCODE= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-transcode"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-transcode"; fi
if[$SRS_INGEST= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ingest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ingest"; fi
if[$SRS_HTTP_CALLBACK= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-callback"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-callback"; fi
if[$SRS_HTTP_SERVER= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-server"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-server"; fi
if[$SRS_HTTP_API= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-api"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-api"; fi
if[$SRS_LIBRTMP= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-librtmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-librtmp"; fi
if[$SRS_BWTC= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-bwtc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-bwtc"; fi
if[$SRS_RESEARCH= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-research"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-research"; fi
if[$SRS_UTEST= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-utest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-utest"; fi
if[$SRS_GPERF= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gperf"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gperf"; fi
if[$SRS_GPERF_MC= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmc"; fi
if[$SRS_GPERF_MP= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi
if[$SRS_GPERF_CP= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi
if[$SRS_GPROF= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi
if[$SRS_ARM_UBUNTU12= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi
if[$SRS_STATIC= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
echo"Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time";
__check_ok=NO
function check_option_conflicts(){
__check_ok=YES
# check conflict
if[$SRS_GPERF= NO ]; then
if[$SRS_GPERF_MC= YES ]; then echo"gperf-mc depends on gperf, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MP= YES ]; then echo"gperf-mp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_CP= YES ]; then echo"gperf-cp depends on gperf, see: ./configure --help"; __check_ok=NO; fi
fi
fi
# generate the group option: SRS_GPERF
__gperf_slow=NO
if[$SRS_GPERF_MC= YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
if[$SRS_GPERF_MP= YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
if[$SRS_GPERF_CP= YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
if[$__gperf_slow= YES ]; then if[$SRS_GPROF= YES ]; then
echo"gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
fi fi
# check arm, if arm enabled, only allow st/ssl/librtmp,
# user should disable all other features
if[$SRS_ARM_UBUNTU12= YES ]; then
if[$SRS_FFMPEG_TOOL= YES ]; then echo"ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_BWTC= YES ]; then echo"bwtc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_RESEARCH= YES ]; then echo"research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF= YES ]; then echo"gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MC= YES ]; then echo"gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MP= YES ]; then echo"gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_CP= YES ]; then echo"gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPROF= YES ]; then echo"gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
fi
# if x86/x64 or directly build, never use static
if[$SRS_ARM_UBUNTU12= NO ]; then
if[$SRS_PI= NO ]; then
if[$SRS_STATIC= YES ]; then
echo"x86/x64 should never use static, see: ./configure --help"; __check_ok=NO;
if[$SRS_GPERF_MC= YES ]; then
if[$SRS_GPERF_MP= YES ]; then
echo"gperf-mc not compatible with gperf-mp, see: ./configure --help";
echo"Note that since the heap-checker uses the heap-profiling framework internally, it is not possible to run both the heap-checker and heap profiler at the same time";
__check_ok=NO
fi
fi
fi
# generate the group option: SRS_GPERF
__gperf_slow=NO
if[$SRS_GPERF_MC= YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
if[$SRS_GPERF_MP= YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
if[$SRS_GPERF_CP= YES ]; then SRS_GPERF=YES; __gperf_slow=YES; fi
if[$__gperf_slow= YES ]; then if[$SRS_GPROF= YES ]; then
echo"gmc/gmp/gcp not compatible with gprof, see: ./configure --help"; __check_ok=NO;
fi fi
# check variable neccessary
if[$SRS_HLS= RESERVED ]; then echo"you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_DVR= RESERVED ]; then echo"you must specifies the dvr, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_NGINX= RESERVED ]; then echo"you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_SSL= RESERVED ]; then echo"you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_FFMPEG_TOOL= RESERVED ]; then echo"you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_HTTP_CALLBACK= RESERVED ]; then echo"you must specifies the http-callback, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_HTTP_SERVER= RESERVED ]; then echo"you must specifies the http-server, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_HTTP_API= RESERVED ]; then echo"you must specifies the http-api, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_LIBRTMP= RESERVED ]; then echo"you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_BWTC= RESERVED ]; then echo"you must specifies the bwtc, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_RESEARCH= RESERVED ]; then echo"you must specifies the research, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_UTEST= RESERVED ]; then echo"you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF= RESERVED ]; then echo"you must specifies the gperf, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MC= RESERVED ]; then echo"you must specifies the gperf-mc, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MP= RESERVED ]; then echo"you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_CP= RESERVED ]; then echo"you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPROF= RESERVED ]; then echo"you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_ARM_UBUNTU12= RESERVED ]; then echo"you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
if[[ -z $SRS_PREFIX]]; then echo"you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi
if[$__check_ok= NO ]; then
exit 1;
fi
# check arm, if arm enabled, only allow st/ssl/librtmp,
# user should disable all other features
if[$SRS_ARM_UBUNTU12= YES ]; then
if[$SRS_FFMPEG_TOOL= YES ]; then echo"ffmpeg for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_BWTC= YES ]; then echo"bwtc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_RESEARCH= YES ]; then echo"research for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF= YES ]; then echo"gperf for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MC= YES ]; then echo"gmc for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MP= YES ]; then echo"gmp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_CP= YES ]; then echo"gcp for arm is not available, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPROF= YES ]; then echo"gprof for arm is not available, see: ./configure --help"; __check_ok=NO; fi
fi
# if x86/x64 or directly build, never use static
if[$SRS_ARM_UBUNTU12= NO ]; then
if[$SRS_PI= NO ]; then
if[$SRS_STATIC= YES ]; then
echo"x86/x64 should never use static, see: ./configure --help"; __check_ok=NO;
fi
fi
fi
# regenerate the options for default values.
SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
if[$SRS_HLS= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-hls"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-hls"; fi
if[$SRS_DVR= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-dvr"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-dvr"; fi
if[$SRS_NGINX= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-nginx"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-nginx"; fi
if[$SRS_SSL= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ssl"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ssl"; fi
if[$SRS_FFMPEG_TOOL= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ffmpeg"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ffmpeg"; fi
if[$SRS_TRANSCODE= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-transcode"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-transcode"; fi
if[$SRS_INGEST= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-ingest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-ingest"; fi
if[$SRS_HTTP_CALLBACK= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-callback"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-callback"; fi
if[$SRS_HTTP_SERVER= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-server"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-server"; fi
if[$SRS_HTTP_API= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-http-api"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-http-api"; fi
if[$SRS_LIBRTMP= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-librtmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-librtmp"; fi
if[$SRS_BWTC= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-bwtc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-bwtc"; fi
if[$SRS_RESEARCH= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-research"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-research"; fi
if[$SRS_UTEST= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-utest"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-utest"; fi
if[$SRS_GPERF= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gperf"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gperf"; fi
if[$SRS_GPERF_MC= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmc"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmc"; fi
if[$SRS_GPERF_MP= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gmp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gmp"; fi
if[$SRS_GPERF_CP= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi
if[$SRS_GPROF= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi
if[$SRS_ARM_UBUNTU12= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-arm-ubuntu12"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-arm-ubuntu12"; fi
if[$SRS_STATIC= YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi
echo"regenerate config: ${SRS_AUTO_CONFIGURE}"
# check variable neccessary
if[$SRS_HLS= RESERVED ]; then echo"you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_DVR= RESERVED ]; then echo"you must specifies the dvr, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_NGINX= RESERVED ]; then echo"you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_SSL= RESERVED ]; then echo"you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_FFMPEG_TOOL= RESERVED ]; then echo"you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_HTTP_CALLBACK= RESERVED ]; then echo"you must specifies the http-callback, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_HTTP_SERVER= RESERVED ]; then echo"you must specifies the http-server, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_HTTP_API= RESERVED ]; then echo"you must specifies the http-api, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_LIBRTMP= RESERVED ]; then echo"you must specifies the librtmp, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_BWTC= RESERVED ]; then echo"you must specifies the bwtc, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_RESEARCH= RESERVED ]; then echo"you must specifies the research, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_UTEST= RESERVED ]; then echo"you must specifies the utest, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF= RESERVED ]; then echo"you must specifies the gperf, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MC= RESERVED ]; then echo"you must specifies the gperf-mc, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_MP= RESERVED ]; then echo"you must specifies the gperf-mp, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPERF_CP= RESERVED ]; then echo"you must specifies the gperf-cp, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_GPROF= RESERVED ]; then echo"you must specifies the gprof, see: ./configure --help"; __check_ok=NO; fi
if[$SRS_ARM_UBUNTU12= RESERVED ]; then echo"you must specifies the arm-ubuntu12, see: ./configure --help"; __check_ok=NO; fi
if[[ -z $SRS_PREFIX]]; then echo"you must specifies the prefix, see: ./configure --prefix"; __check_ok=NO; fi