mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
Support crossbuild for hisiv500. v5.0.40
This commit is contained in:
parent
d885d574e4
commit
a842c6c32a
8 changed files with 21 additions and 11 deletions
|
@ -743,7 +743,7 @@ if [[ $SRS_FFMPEG_FIT == YES ]]; then
|
|||
# For MIPS, which fail with:
|
||||
# ./libavutil/libm.h:54:32: error: static declaration of 'cbrt' follows non-static declaration
|
||||
# /root/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/math.h:163:13: note: previous declaration of 'cbrt' was here
|
||||
if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" ]]; then
|
||||
if [[ $SRS_CROSS_BUILD_ARCH == "mipsel" || $SRS_CROSS_BUILD_ARCH == "arm" ]]; then
|
||||
sed -i -e 's/#define HAVE_CBRT 0/#define HAVE_CBRT 1/g' config.h &&
|
||||
sed -i -e 's/#define HAVE_CBRTF 0/#define HAVE_CBRTF 1/g' config.h &&
|
||||
sed -i -e 's/#define HAVE_COPYSIGN 0/#define HAVE_COPYSIGN 1/g' config.h &&
|
||||
|
@ -812,12 +812,18 @@ if [[ $SRS_SRT == YES ]]; then
|
|||
exit -1;
|
||||
fi
|
||||
# Always disable c++11 for libsrt, because only the srt-app requres it.
|
||||
LIBSRT_OPTIONS="--disable-apps --enable-static --enable-c++11=0"
|
||||
LIBSRT_OPTIONS="--enable-apps=0 --enable-static=1 --enable-c++11=0"
|
||||
if [[ $SRS_SHARED_SRT == YES ]]; then
|
||||
LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=1"
|
||||
else
|
||||
LIBSRT_OPTIONS="$LIBSRT_OPTIONS --enable-shared=0"
|
||||
fi
|
||||
# For cross-build.
|
||||
if [[ $SRS_CROSS_BUILD == YES ]]; then
|
||||
TOOL_GCC_REALPATH=$(realpath $(which $SRS_TOOL_CC))
|
||||
SRT_COMPILER_PREFIX=$(echo $TOOL_GCC_REALPATH |sed 's/-gcc.*$/-/')
|
||||
LIBSRT_OPTIONS="$LIBSRT_OPTIONS --with-compiler-prefix=$SRT_COMPILER_PREFIX"
|
||||
fi
|
||||
# Start build libsrt.
|
||||
rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/srt-1-fit && cd ${SRS_OBJS}/${SRS_PLATFORM} &&
|
||||
cp -R ../../3rdparty/srt-1-fit srt-1-fit && cd srt-1-fit &&
|
||||
|
|
|
@ -410,11 +410,6 @@ function apply_auto_options() {
|
|||
SRS_X86_X64=YES; opt="--x86-x64 $opt";
|
||||
fi
|
||||
|
||||
# Covert prefix without directory.
|
||||
if [[ $SRS_CROSS_BUILD_PREFIX != "" ]]; then
|
||||
SRS_CROSS_BUILD_PREFIX=$(basename $SRS_CROSS_BUILD_PREFIX)
|
||||
fi
|
||||
|
||||
if [[ $SRS_CROSS_BUILD == YES ]]; then
|
||||
if [[ $SRS_CROSS_BUILD_PREFIX != "" && $SRS_CROSS_BUILD_HOST == "" ]]; then
|
||||
SRS_CROSS_BUILD_HOST=$(echo $SRS_CROSS_BUILD_PREFIX| sed 's/-$//g')
|
||||
|
|
|
@ -20,7 +20,8 @@ fi
|
|||
SRS_PLATFORM="${SRS_PLATFORM}-SRS5-$(uname -m)"
|
||||
|
||||
if [[ $SRS_CROSS_BUILD == YES ]]; then
|
||||
SRS_PLATFORM="${SRS_PLATFORM}-CROSSBUILD-$(echo $SRS_TOOL_CC|awk -F - '{print $1}')"
|
||||
SRS_TOOL_CC_NAME=$(basename $SRS_TOOL_CC)
|
||||
SRS_PLATFORM="${SRS_PLATFORM}-crossbuild-$(echo $SRS_TOOL_CC_NAME|awk -F - '{print $1"-"$2}')"
|
||||
fi
|
||||
|
||||
echo "SRS_WORKDIR: ${SRS_WORKDIR}, SRS_OBJS_DIR: ${SRS_OBJS_DIR}, SRS_OBJS: ${SRS_OBJS}, SRS_PLATFORM: ${SRS_PLATFORM}"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# the config for srs origin-edge cluster
|
||||
# the config for isolated origin server to reuse port.
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port
|
||||
# @see full.conf for detail config.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# the config for srs origin-edge cluster
|
||||
# the config for isolated origin server to reuse port.
|
||||
# @see https://ossrs.net/lts/zh-cn/docs/v4/doc/reuse-port
|
||||
# @see full.conf for detail config.
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ The changelog for SRS.
|
|||
|
||||
## SRS 5.0 Changelog
|
||||
|
||||
* v5.0, 2022-08-12, Support crossbuild for hisiv500. v5.0.40
|
||||
* v5.0, 2022-08-10, Build: Detect OS by packager. v5.0.39
|
||||
* v5.0, 2022-08-06, Support MIPS 64bits for loongson 3A4000/3B3000. v5.0.38
|
||||
* v5.0, 2022-06-29, Support multiple threads by thread pool. v5.0.32
|
||||
|
|
|
@ -44,6 +44,13 @@ using namespace std;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// These functions first appeared in glibc in version 2.12.
|
||||
// See https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html
|
||||
#if defined(SRS_CROSSBUILD) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12))
|
||||
void pthread_setname_np(pthread_t trd, const char* name) {
|
||||
}
|
||||
#endif
|
||||
|
||||
extern ISrsLog* _srs_log;
|
||||
extern ISrsContext* _srs_context;
|
||||
extern SrsConfig* _srs_config;
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 39
|
||||
#define VERSION_REVISION 40
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue