|
|
|
@ -1,5 +1,16 @@
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
OS_IS_OSX=NO
|
|
|
|
|
uname -s|grep Darwin >/dev/null 2>&1
|
|
|
|
|
ret=$?; if [[ 0 -eq $ret ]]; then
|
|
|
|
|
OS_IS_OSX=YES
|
|
|
|
|
fi
|
|
|
|
|
echo "Is OSX: ${OS_IS_OSX}"
|
|
|
|
|
|
|
|
|
|
# the sed command
|
|
|
|
|
SED="sed -i"
|
|
|
|
|
if [ $OS_IS_OSX = YES ]; then SED="sed -i ''"; fi
|
|
|
|
|
|
|
|
|
|
# when export srs-librtmp single files
|
|
|
|
|
# package the whole project to srs_librtmp.h and srs_librtmp.cpp
|
|
|
|
|
#
|
|
|
|
@ -59,7 +70,7 @@ function build_module_hpp()
|
|
|
|
|
for item in ${SRS_LIBRTMP_OBJS[*]}; do
|
|
|
|
|
FILE_NAME="${item%.*}"
|
|
|
|
|
echo "// following is generated by ${FILE_NAME}.hpp" >> $FILE &&
|
|
|
|
|
sed -i "s|#include <srs_|//#include <srs_|g" $SRS_EXPORT_LIBRTMP_SINGLE/${FILE_NAME}.hpp &&
|
|
|
|
|
$SED "s|#include <srs_|//#include <srs_|g" $SRS_EXPORT_LIBRTMP_SINGLE/${FILE_NAME}.hpp &&
|
|
|
|
|
cat $SRS_EXPORT_LIBRTMP_SINGLE/${FILE_NAME}.hpp >>$FILE
|
|
|
|
|
ret=$?; if [[ $ret -ne 0 ]]; then
|
|
|
|
|
echo -e "${RED}failed to generate the srs_librtmp.cpp by ${FILE_NAME}.hpp. {${BLACK}"
|
|
|
|
@ -78,7 +89,7 @@ function build_module_cpp()
|
|
|
|
|
for item in ${SRS_LIBRTMP_OBJS[*]}; do
|
|
|
|
|
FILE_NAME="${item%.*}"
|
|
|
|
|
echo "// following is generated by ${FILE_NAME}.cpp" >> $FILE &&
|
|
|
|
|
sed -i "s|#include <srs_|//#include <srs_|g" $SRS_EXPORT_LIBRTMP_SINGLE/${FILE_NAME}.cpp &&
|
|
|
|
|
$SED "s|#include <srs_|//#include <srs_|g" $SRS_EXPORT_LIBRTMP_SINGLE/${FILE_NAME}.cpp &&
|
|
|
|
|
cat $SRS_EXPORT_LIBRTMP_SINGLE/${FILE_NAME}.cpp >>$FILE
|
|
|
|
|
ret=$?; if [[ $ret -ne 0 ]]; then
|
|
|
|
|
echo -e "${RED}failed to generate the srs_librtmp.cpp by ${FILE_NAME}.cpp. {${BLACK}"
|
|
|
|
|