mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine the configure, add comments
This commit is contained in:
parent
25cb3054d5
commit
cd7e6cc321
2 changed files with 30 additions and 21 deletions
|
@ -1,5 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
function require_sudoer()
|
||||||
|
{
|
||||||
|
sudo echo "" >/dev/null 2>&1
|
||||||
|
|
||||||
|
ret=$?; if [[ 0 -ne $ret ]]; then
|
||||||
|
echo "\"$1\" require sudoer failed. ret=$ret";
|
||||||
|
exit $ret;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# TODO: check gcc/g++
|
# TODO: check gcc/g++
|
||||||
echo "check gcc/g++/gdb/make/openssl-devel"
|
echo "check gcc/g++/gdb/make/openssl-devel"
|
||||||
echo "depends tools are ok"
|
echo "depends tools are ok"
|
||||||
|
|
41
trunk/configure
vendored
41
trunk/configure
vendored
|
@ -1,36 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SRS_MAKEFILE="Makefile"
|
#####################################################################################
|
||||||
|
# the main output dir, all configure and make output are in this dir.
|
||||||
|
#####################################################################################
|
||||||
|
# create the main objs
|
||||||
SRS_OBJS="objs"
|
SRS_OBJS="objs"
|
||||||
SRS_AUTO_HEADERS_H="${SRS_OBJS}/srs_auto_headers.hpp"
|
|
||||||
|
|
||||||
mkdir -p ${SRS_OBJS}
|
mkdir -p ${SRS_OBJS}
|
||||||
|
|
||||||
# linux shell color support.
|
#####################################################################################
|
||||||
RED="\\e[31m"
|
# parse user options, set the variables like SRS_SSL/SRS_HLS/SRS_FFMPEG/SRS_HTTP
|
||||||
GREEN="\\e[32m"
|
#####################################################################################
|
||||||
YELLOW="\\e[33m"
|
# parse options, exit with error when parse options invalid.
|
||||||
BLACK="\\e[0m"
|
|
||||||
|
|
||||||
# parse user options.
|
|
||||||
. auto/options.sh
|
. auto/options.sh
|
||||||
|
|
||||||
function require_sudoer()
|
|
||||||
{
|
|
||||||
sudo echo "" >/dev/null 2>&1
|
|
||||||
|
|
||||||
ret=$?; if [[ 0 -ne $ret ]]; then
|
|
||||||
echo "\"$1\" require sudoer failed. ret=$ret";
|
|
||||||
exit $ret;
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# clean the exists
|
# clean the exists
|
||||||
|
# do this only when the options is ok.
|
||||||
if [[ -f Makefile ]]; then
|
if [[ -f Makefile ]]; then
|
||||||
make clean
|
make clean
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# generate the audo headers file.
|
#####################################################################################
|
||||||
|
# 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_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_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H
|
||||||
echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H
|
echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H
|
||||||
|
@ -46,6 +39,7 @@ echo "" >> $SRS_AUTO_HEADERS_H
|
||||||
#####################################################################################
|
#####################################################################################
|
||||||
echo "generate Makefile"
|
echo "generate Makefile"
|
||||||
|
|
||||||
|
SRS_MAKEFILE="Makefile"
|
||||||
cat << END > ${SRS_MAKEFILE}
|
cat << END > ${SRS_MAKEFILE}
|
||||||
.PHONY: default help clean server bandwidth _prepare_dir
|
.PHONY: default help clean server bandwidth _prepare_dir
|
||||||
default: server bandwidth
|
default: server bandwidth
|
||||||
|
@ -152,6 +146,11 @@ BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" SO_PATH
|
||||||
|
|
||||||
echo 'configure ok! '
|
echo 'configure ok! '
|
||||||
|
|
||||||
|
# linux shell color support.
|
||||||
|
RED="\\e[31m"
|
||||||
|
GREEN="\\e[32m"
|
||||||
|
YELLOW="\\e[33m"
|
||||||
|
BLACK="\\e[0m"
|
||||||
# summary
|
# summary
|
||||||
echo ""
|
echo ""
|
||||||
echo "configure summary:"
|
echo "configure summary:"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue