1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

copy http-parser-2.1 into srs http stack.

This commit is contained in:
winlin 2015-12-07 11:35:05 +08:00
parent fba1122835
commit b2ae1acaa4
7 changed files with 2638 additions and 178 deletions

View file

@ -439,42 +439,7 @@ fi
#####################################################################################
# check the cross build flag file, if flag changed, need to rebuild the st.
if [ $SRS_HTTP_CORE = YES ]; then
# ok, arm specified, if the flag filed does not exists, need to rebuild.
if [ $SRS_CROSS_BUILD = YES ]; then
if [[ -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then
echo "http-parser-2.1 for arm is ok.";
else
echo "build http-parser-2.1 for arm";
(
rm -rf ${SRS_OBJS}/http-parser-2.1 && cd ${SRS_OBJS} && unzip -q ../3rdparty/http-parser-2.1.zip &&
cd http-parser-2.1 &&
patch -p0 < ../../3rdparty/patches/2.http.parser.patch &&
make CC=${SrsArmCC} AR=${SrsArmAR} package &&
cd .. && rm -rf hp && ln -sf http-parser-2.1 hp &&
cd .. && touch ${SRS_OBJS}/_flag.st.hp.tmp
)
fi
else
# cross build not specified, if exists flag, need to rebuild for no-arm platform.
if [[ ! -f ${SRS_OBJS}/_flag.st.hp.tmp && -f ${SRS_OBJS}/hp/http_parser.h && -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then
echo "http-parser-2.1 is ok.";
else
echo "build http-parser-2.1";
(
rm -rf ${SRS_OBJS}/http-parser-2.1 && cd ${SRS_OBJS} && unzip -q ../3rdparty/http-parser-2.1.zip &&
cd http-parser-2.1 &&
patch -p0 < ../../3rdparty/patches/2.http.parser.patch &&
make package &&
cd .. && rm -rf hp && ln -sf http-parser-2.1 hp &&
cd .. && rm -f ${SRS_OBJS}/_flag.st.hp.tmp
)
fi
fi
# check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "build http-parser-2.1 failed, ret=$ret"; exit $ret; fi
if [[ ! -f ${SRS_OBJS}/hp/http_parser.h ]]; then echo "build http-parser-2.1 failed"; exit -1; fi
if [[ ! -f ${SRS_OBJS}/hp/libhttp_parser.a ]]; then echo "build http-parser-2.1 failed"; exit -1; fi
echo "http-parser is copied into srs_http_stack.*pp"
fi
#####################################################################################