From d89d16ca1eb3b49047e74e12a3ec1e4533021dbe Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 19 Mar 2014 10:51:33 +0800 Subject: [PATCH] print the system info when startup main --- trunk/auto/depends.sh | 4 ++++ trunk/auto/options.sh | 3 +++ trunk/configure | 19 ++++++++++--------- trunk/src/main/srs_main_server.cpp | 4 ++++ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 313bf4e6a..fdac236e3 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -3,6 +3,7 @@ # variables, parent script must set it: # SRS_JOBS: the build jobs. # SrsArmMakeOptions: the arm make options for ubuntu12(armhf, v7cpu) +# SRS_AUTO_HEADERS_H: the auto generated header file. ##################################################################################### ##################################################################################### @@ -542,3 +543,6 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then else echo "#undef SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H fi + +# new empty line to auto headers file. +echo "" >> $SRS_AUTO_HEADERS_H diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 9b3c48377..a345aaeb7 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -1,5 +1,8 @@ #!/bin/bash +# variables, parent script must set it: +# SRS_AUTO_HEADERS_H: the auto generated header file. + ##################################################################################### ##################################################################################### # parse user options, do this at first diff --git a/trunk/configure b/trunk/configure index aa96125e6..8602252ea 100755 --- a/trunk/configure +++ b/trunk/configure @@ -19,6 +19,7 @@ BLACK="\\e[0m" # srs features: SRS_SSL/SRS_HLS/SRS_FFMPEG/SRS_HTTP_CALLBACK/SRS_RESEARCH/SRS_UTEST # build options: SRS_JOBS ##################################################################################### +SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp" # parse options, exit with error when parse options invalid. . auto/options.sh @@ -28,15 +29,18 @@ if [[ -f Makefile ]]; then make clean fi +# write user options to headers +echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H +echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H +echo "#define SRS_UNAME \"`uname -a`\"" >> $SRS_AUTO_HEADERS_H +echo "#define SRS_CONFIGURE \"${SRS_CONFIGURE}\"" >> $SRS_AUTO_HEADERS_H + +# new empty line to auto headers file. +echo "" >> $SRS_AUTO_HEADERS_H + ##################################################################################### # generate auto headers file, depends on the finished of options.sh ##################################################################################### -# write user options to headers -SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp" -echo "#define SRS_CONFIGURE \"${SRS_CONFIGURE}\"" > $SRS_AUTO_HEADERS_H -echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H -echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H - # the arm-ubuntu12 options for make for depends SrsArmCC="arm-linux-gnueabi-gcc" SrsArmGCC="arm-linux-gnueabi-gcc" @@ -48,9 +52,6 @@ SrsArmRANDLIB="arm-linux-gnueabi-ranlib" # apply user options. . auto/depends.sh -# new empty line to auto headers file. -echo "" >> $SRS_AUTO_HEADERS_H - ##################################################################################### # generate Makefile. ##################################################################################### diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 271a876ec..3e179d591 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -80,6 +80,10 @@ int main(int argc, char** argv) return -1; #endif #endif + + srs_trace("uname: "SRS_UNAME); + srs_trace("build: %s, %s", SRS_BUILD_DATE, srs_is_little_endian()? "little-endian":"big-endian"); + srs_trace("configure: "SRS_CONFIGURE); if ((ret = _srs_server->initialize()) != ERROR_SUCCESS) { return ret;