diff options
author | Rechi <Rechi@users.noreply.github.com> | 2019-07-19 12:46:37 +0200 |
---|---|---|
committer | Rechi <Rechi@users.noreply.github.com> | 2019-07-19 12:46:37 +0200 |
commit | e124e4af8c878d4ba6549dd16a97c26241e19dc2 (patch) | |
tree | 16376435390e885924b4fe2e76fedf5143251135 /tools | |
parent | 3712c60761dca4ca13444781c85cc27f134964ba (diff) |
[depends] configure: move checking host programs up
Diffstat (limited to 'tools')
-rw-r--r-- | tools/depends/configure.ac | 74 |
1 files changed, 32 insertions, 42 deletions
diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac index d486c7f50c..e3addf669e 100644 --- a/tools/depends/configure.ac +++ b/tools/depends/configure.ac @@ -116,24 +116,6 @@ AC_ARG_WITH([ffmpeg-options], [ffmpeg_options=default]) -OLD_PATH="${PATH}" -if test -n "$use_toolchain"; then - PATH="${use_toolchain}/bin:${use_toolchain}/usr/bin:$PATH" - case $host in - arm*-*linux-android*|aarch64*-*linux-android*) - COMPILER_LIST="clang++ gcc g++" - ;; - *) - COMPILER_LIST="" - ;; - esac -fi -AC_PROG_CXX([$COMPILER_LIST]) -AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) -c11_flags=$(echo "$CFLAGS" | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ //g') -cxx11_flags=$(echo "$CXXFLAGS" | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ //g') -PATH="${OLD_PATH}" - if test "$use_ccache" = "yes"; then AC_CHECK_PROG(HAVE_CCACHE,ccache,"yes","no",) if test "x$HAVE_CCACHE" = "xno" ; then @@ -169,9 +151,6 @@ deps_dir=$use_host-$build_type tool_dir=$build_cpu-$build_os-native cross_compiling="yes" -platform_cc=gcc -platform_cxx=g++ - case $build in arm*-*-linux-gnu*|arm*-*-linux-uclibc*) build_os="linux" @@ -210,10 +189,42 @@ AC_PATH_PROG([CC_FOR_BUILD],[gcc llvm-gcc $platform_cc], gcc, $PATH_FOR_BUILD) AC_PATH_PROG([CXX_FOR_BUILD],[g++ llvm-g++ $platform_cxx], g++, $PATH_FOR_BUILD) +platform_cc=gcc +platform_cxx=g++ + case $host in *-*linux-android*) + *darwin*) + use_toolchain="${use_xcodepath}/Toolchains/XcodeDefault.xctoolchain" platform_cc=clang platform_cxx=clang++ +esac + +if test -n $use_build_toolchain; then + PATH_FOR_HOST=$use_toolchain:$use_toolchain/usr/bin:$use_toolchain/bin:$PATH +else + PATH_FOR_HOST=$PATH +fi + +AC_PATH_TOOL([RANLIB], [ranlib],, $PATH_FOR_HOST) +AC_PATH_TOOL([LD], [ld],, $PATH_FOR_HOST) +AC_PATH_TOOL([AR], [ar],, $PATH_FOR_HOST) +AC_PATH_TOOL([READELF], [readelf],, $PATH_FOR_HOST) +AC_PATH_TOOL([STRIP], [strip],, $PATH_FOR_HOST) +AC_PATH_TOOL([AS], [as],, $PATH_FOR_HOST) +AC_PATH_TOOL([NM], [nm],, $PATH_FOR_HOST) +AC_PATH_TOOL([OBJDUMP], [objdump],, $PATH_FOR_HOST) +AC_PATH_TOOL([CC],[$platform_cc],,$PATH_FOR_HOST) +AC_PATH_TOOL([CXX],[$platform_cxx],,$PATH_FOR_HOST) +AC_PROG_CPP + +AX_CXX_COMPILE_STDCXX_11([noext],[mandatory]) +c11_flags=$(echo "$CFLAGS" | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ //g') +cxx11_flags=$(echo "$CXXFLAGS" | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ //g') + + +case $host in + *-*linux-android*) deps_dir="$use_host-$use_ndk_api-$build_type" platform_cflags="-DANDROID -D__ANDROID_API__=$use_ndk_api -fexceptions -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fPIC -DPIC" optimize_flags="-Os" @@ -279,13 +290,10 @@ case $host in use_xcodebuild=$use_xcodepath/usr/bin/xcodebuild AC_MSG_RESULT(found xcodebuild at $use_xcodebuild) - use_toolchain="${use_xcodepath}/Toolchains/XcodeDefault.xctoolchain" # darwin builds are always cross cross_compiling="yes" - platform_cc=clang - platform_cxx=clang++ platform_cflags="-fheinous-gnu-extensions -no-cpp-precomp" platform_ldflags="-Wl,-search_paths_first" platform_cxxflags="-no-cpp-precomp" @@ -478,24 +486,6 @@ fi XBMC_SETUP_ARCH_DEFINES() -if test -n $use_build_toolchain; then - PATH_FOR_HOST=$use_toolchain:$use_toolchain/usr/bin:$use_toolchain/bin:$PATH -else - PATH_FOR_HOST=$PATH -fi - -AC_PATH_TOOL([RANLIB], [ranlib],, $PATH_FOR_HOST) -AC_PATH_TOOL([LD], [ld],, $PATH_FOR_HOST) -AC_PATH_TOOL([AR], [ar],, $PATH_FOR_HOST) -AC_PATH_TOOL([READELF], [readelf],, $PATH_FOR_HOST) -AC_PATH_TOOL([STRIP], [strip],, $PATH_FOR_HOST) -AC_PATH_TOOL([AS], [as],, $PATH_FOR_HOST) -AC_PATH_TOOL([NM], [nm],, $PATH_FOR_HOST) -AC_PATH_TOOL([OBJDUMP], [objdump],, $PATH_FOR_HOST) -AC_PATH_TOOL([CC],[$platform_cc],,$PATH_FOR_HOST) -AC_PATH_TOOL([CXX],[$platform_cxx],,$PATH_FOR_HOST) -AC_PROG_CPP - AC_SEARCH_LIBS([iconv_open],iconv, link_iconv=$ac_cv_search_iconv_open, link_iconv=-liconv; AC_MSG_WARN("No iconv support in toolchain. Will build libiconv."); need_libiconv=1) AC_TRY_LINK([#include <locale.h>],[struct lconv* test=localeconv();], has_localeconv=yes, AC_MSG_WARN("No localeconv support in toolchain. Using replacement."); has_localeconv=no) |