Skip to content

Commit c3bf0cb

Browse files
committed
For #1547, check options for crossbuild.
1 parent ba61fe8 commit c3bf0cb

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

trunk/auto/options.sh

+9-25
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function apply_user_presets() {
335335
# set default preset if not specifies
336336
if [[ $SRS_PURE_RTMP == NO && $SRS_FAST == NO && $SRS_DISABLE_ALL == NO && $SRS_ENABLE_ALL == NO && \
337337
$SRS_DEV == NO && $SRS_FAST_DEV == NO && $SRS_DEMO == NO && $SRS_PI == NO && $SRS_CUBIE == NO && \
338-
$SRS_X86_X64 == NO && $SRS_OSX == NO \
338+
$SRS_X86_X64 == NO && $SRS_OSX == NO && $SRS_CROSS_BUILD == NO \
339339
]]; then
340340
SRS_X86_X64=YES; opt="--x86-x64 $opt";
341341
fi
@@ -548,40 +548,24 @@ regenerate_options
548548
# check user options
549549
#####################################################################################
550550
function check_option_conflicts() {
551-
if [[ $SRS_TOOL_CC == '' ]]; then
552-
echo "No c compiler"
553-
exit -1
551+
if [[ $SRS_TOOL_CC == '' || $SRS_TOOL_CXX == '' || $SRS_TOOL_AR == '' || $SRS_TOOL_LD == '' || $SRS_TOOL_RANDLIB == '' ]]; then
552+
echo "No crossbuild tools, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR, ld: $SRS_TOOL_LD, randlib: $SRS_TOOL_RANDLIB"; exit -1
554553
fi
555-
if [[ $SRS_TOOL_CXX == '' ]]; then
556-
echo "No c++ compiler"
557-
exit -1
558-
fi
559-
if [[ $SRS_TOOL_AR == '' ]]; then
560-
echo "No arhive tool"
561-
exit -1
562-
fi
563-
if [[ $SRS_TOOL_LD == '' ]]; then
564-
echo "No linker tool"
565-
exit -1
566-
fi
567-
if [[ $SRS_TOOL_RANDLIB == '' ]]; then
568-
echo "No randlib tool"
569-
exit -1
554+
555+
if [[ $SRS_CROSS_BUILD == YES && ($SRS_TOOL_CC == 'gcc' || $SRS_TOOL_CXX == 'g++' || $SRS_TOOL_AR == 'ar') ]]; then
556+
echo "For crossbuild, must not use default toolchain, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR"; exit -1
570557
fi
571558

572559
if [ $SRS_OSX = YES ]; then
573-
echo "We don't support OSX, please use docker https://github.com/ossrs/srs-docker"
574-
exit -1
560+
echo "We don't support OSX, please use docker https://github.com/ossrs/srs-docker"; exit -1
575561
fi
576562

577563
if [[ $SRS_NGINX == YES ]]; then
578-
echo "Don't support building NGINX, please use docker https://github.com/ossrs/srs-docker"
579-
exit -1
564+
echo "Don't support building NGINX, please use docker https://github.com/ossrs/srs-docker"; exit -1
580565
fi
581566

582567
if [[ $SRS_FFMPEG_TOOL == YES ]]; then
583-
echo "Don't support building FFMPEG, please use docker https://github.com/ossrs/srs-docker"
584-
exit -1
568+
echo "Don't support building FFMPEG, please use docker https://github.com/ossrs/srs-docker"; exit -1
585569
fi
586570

587571
# TODO: FIXME: check more os.

0 commit comments

Comments
 (0)