mirror of https://github.com/ossrs/srs.git
add library
parent
d5a02a55ee
commit
aa5d28ed85
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# genereate the library header file.
|
||||||
|
|
||||||
|
objs=$1
|
@ -0,0 +1,79 @@
|
|||||||
|
# generate the library for static link.
|
||||||
|
#
|
||||||
|
# params:
|
||||||
|
# $SRS_OBJS the objs directory. ie. objs
|
||||||
|
# $SRS_MAKEFILE the makefile name. ie. Makefile
|
||||||
|
#
|
||||||
|
# $BUILD_KEY a string indicates the build key for Makefile. ie. dump
|
||||||
|
# $LIB_NAME the app name to output. ie. smart_server
|
||||||
|
# $MODULE_OBJS array, the objects to compile the app.
|
||||||
|
# $LINK_OPTIONS the linker options to generate the so(shared library).
|
||||||
|
|
||||||
|
FILE=${SRS_OBJS}/${SRS_MAKEFILE}
|
||||||
|
|
||||||
|
LIB_TARGET="${SRS_OBJS}/${LIB_NAME}"
|
||||||
|
LIB_TAGET_STATIC="${LIB_TARGET}.a"
|
||||||
|
LIB_TAGET_SHARED="${LIB_TARGET}.so"
|
||||||
|
|
||||||
|
echo "generate lib ${LIB_NAME} depends..."
|
||||||
|
|
||||||
|
echo "" >> ${FILE}
|
||||||
|
echo "# archive library ${LIB_TAGET_STATIC}" >> ${FILE}
|
||||||
|
echo "${BUILD_KEY}: ${LIB_TAGET_SHARED}" >> ${FILE}
|
||||||
|
|
||||||
|
# build depends
|
||||||
|
echo -n "${LIB_TAGET_SHARED}: " >> ${FILE}
|
||||||
|
for item in ${MODULE_OBJS[*]}; do
|
||||||
|
FILE_NAME=`basename $item`
|
||||||
|
FILE_NAME=${FILE_NAME%.*}
|
||||||
|
|
||||||
|
if [ ! -f ${item} ]; then
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
|
||||||
|
OBJ_FILE=${SRS_OBJS}/$item
|
||||||
|
OBJ_FILE="${OBJ_FILE%.*}.o"
|
||||||
|
echo -n "${OBJ_FILE} " >> ${FILE}
|
||||||
|
done
|
||||||
|
echo "" >> ${FILE}
|
||||||
|
|
||||||
|
# build header file
|
||||||
|
echo -n " @bash auto/generate_header.sh ${SRS_OBJS}" >> ${FILE}
|
||||||
|
echo "" >> ${FILE}
|
||||||
|
|
||||||
|
# archive librtmp.a
|
||||||
|
echo -n " \$(AR) -rs ${LIB_TAGET_STATIC} " >> ${FILE}
|
||||||
|
for item in ${MODULE_OBJS[*]}; do
|
||||||
|
FILE_NAME=`basename $item`
|
||||||
|
FILE_NAME=${FILE_NAME%.*}
|
||||||
|
|
||||||
|
if [ ! -f ${item} ]; then
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
|
||||||
|
OBJ_FILE=${SRS_OBJS}/$item
|
||||||
|
OBJ_FILE="${OBJ_FILE%.*}.o"
|
||||||
|
echo -n "${OBJ_FILE} " >> ${FILE}
|
||||||
|
done
|
||||||
|
echo "" >> ${FILE}
|
||||||
|
|
||||||
|
echo "generate lib ${LIB_NAME} link...";
|
||||||
|
|
||||||
|
# archive librtmp.so
|
||||||
|
echo -n " \$(GCC) -shared -o ${LIB_TAGET_SHARED} " >> ${FILE}
|
||||||
|
for item in ${MODULE_OBJS[*]}; do
|
||||||
|
FILE_NAME=`basename $item`
|
||||||
|
FILE_NAME=${FILE_NAME%.*}
|
||||||
|
|
||||||
|
if [ ! -f ${item} ]; then
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
|
||||||
|
OBJ_FILE=${SRS_OBJS}/$item
|
||||||
|
OBJ_FILE="${OBJ_FILE%.*}.o"
|
||||||
|
echo -n "${OBJ_FILE} " >> ${FILE}
|
||||||
|
done
|
||||||
|
echo -n "${LINK_OPTIONS} " >> ${FILE}
|
||||||
|
echo "" >> ${FILE}
|
||||||
|
|
||||||
|
echo -n "generate lib ${LIB_NAME} ok"; echo '!';
|
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013-2014 winlin
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <srs_librtmp.hpp>
|
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013-2014 winlin
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRS_LIB_RTMP_HPP
|
||||||
|
#define SRS_LIB_RTMP_HPP
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <srs_librtmp.hpp>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue