Skip to content

Commit

Permalink
For #1547, check options for crossbuild.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 21, 2020
1 parent ba61fe8 commit c3bf0cb
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function apply_user_presets() {
# set default preset if not specifies
if [[ $SRS_PURE_RTMP == NO && $SRS_FAST == NO && $SRS_DISABLE_ALL == NO && $SRS_ENABLE_ALL == NO && \
$SRS_DEV == NO && $SRS_FAST_DEV == NO && $SRS_DEMO == NO && $SRS_PI == NO && $SRS_CUBIE == NO && \
$SRS_X86_X64 == NO && $SRS_OSX == NO \
$SRS_X86_X64 == NO && $SRS_OSX == NO && $SRS_CROSS_BUILD == NO \
]]; then
SRS_X86_X64=YES; opt="--x86-x64 $opt";
fi
Expand Down Expand Up @@ -548,40 +548,24 @@ regenerate_options
# check user options
#####################################################################################
function check_option_conflicts() {
if [[ $SRS_TOOL_CC == '' ]]; then
echo "No c compiler"
exit -1
if [[ $SRS_TOOL_CC == '' || $SRS_TOOL_CXX == '' || $SRS_TOOL_AR == '' || $SRS_TOOL_LD == '' || $SRS_TOOL_RANDLIB == '' ]]; then
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
fi
if [[ $SRS_TOOL_CXX == '' ]]; then
echo "No c++ compiler"
exit -1
fi
if [[ $SRS_TOOL_AR == '' ]]; then
echo "No arhive tool"
exit -1
fi
if [[ $SRS_TOOL_LD == '' ]]; then
echo "No linker tool"
exit -1
fi
if [[ $SRS_TOOL_RANDLIB == '' ]]; then
echo "No randlib tool"
exit -1

if [[ $SRS_CROSS_BUILD == YES && ($SRS_TOOL_CC == 'gcc' || $SRS_TOOL_CXX == 'g++' || $SRS_TOOL_AR == 'ar') ]]; then
echo "For crossbuild, must not use default toolchain, cc: $SRS_TOOL_CC, cxx: $SRS_TOOL_CXX, ar: $SRS_TOOL_AR"; exit -1
fi

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

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

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

# TODO: FIXME: check more os.
Expand Down

0 comments on commit c3bf0cb

Please sign in to comment.