mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +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}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue