winlin

for #155, osx(darwin) enable http api and stat, rusage is ok.

@@ -266,15 +266,6 @@ function OSX_prepare() @@ -266,15 +266,6 @@ function OSX_prepare()
266 echo "OSX detected, must specifies the --osx" 266 echo "OSX detected, must specifies the --osx"
267 exit 1 267 exit 1
268 fi 268 fi
269 - # TODO: FIXME: support following features.  
270 - if [ $SRS_HTTP_API = YES ]; then  
271 - echo "OSX does not support http-api, use --without-http-api"  
272 - exit 1  
273 - fi  
274 - if [ $SRS_STAT = YES ]; then  
275 - echo "OSX does not support stat, use --without-stat"  
276 - exit 1  
277 - fi  
278 fi 269 fi
279 270
280 brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then 271 brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then
@@ -592,12 +592,12 @@ function apply_user_presets() { @@ -592,12 +592,12 @@ function apply_user_presets() {
592 SRS_FFMPEG_TOOL=NO 592 SRS_FFMPEG_TOOL=NO
593 SRS_TRANSCODE=YES 593 SRS_TRANSCODE=YES
594 SRS_INGEST=YES 594 SRS_INGEST=YES
595 - SRS_STAT=NO 595 + SRS_STAT=YES
596 SRS_HTTP_PARSER=YES 596 SRS_HTTP_PARSER=YES
597 SRS_HTTP_CALLBACK=YES 597 SRS_HTTP_CALLBACK=YES
598 SRS_HTTP_SERVER=YES 598 SRS_HTTP_SERVER=YES
599 SRS_STREAM_CASTER=NO 599 SRS_STREAM_CASTER=NO
600 - SRS_HTTP_API=NO 600 + SRS_HTTP_API=YES
601 SRS_LIBRTMP=YES 601 SRS_LIBRTMP=YES
602 SRS_RESEARCH=NO 602 SRS_RESEARCH=NO
603 SRS_UTEST=NO 603 SRS_UTEST=NO
@@ -836,6 +836,7 @@ int SrsServer::do_cycle() @@ -836,6 +836,7 @@ int SrsServer::do_cycle()
836 srs_info("update resource info, rss."); 836 srs_info("update resource info, rss.");
837 srs_update_system_rusage(); 837 srs_update_system_rusage();
838 } 838 }
  839 +#ifndef SRS_OSX
839 if ((i % SRS_SYS_CPU_STAT_RESOLUTION_TIMES) == 0) { 840 if ((i % SRS_SYS_CPU_STAT_RESOLUTION_TIMES) == 0) {
840 srs_info("update cpu info, cpu usage."); 841 srs_info("update cpu info, cpu usage.");
841 srs_update_proc_stat(); 842 srs_update_proc_stat();
@@ -869,6 +870,7 @@ int SrsServer::do_cycle() @@ -869,6 +870,7 @@ int SrsServer::do_cycle()
869 } 870 }
870 #endif 871 #endif
871 #endif 872 #endif
  873 +#endif
872 srs_info("server main thread loop"); 874 srs_info("server main thread loop");
873 } 875 }
874 } 876 }