Ver Fonte

add default toolchains

ruki há 2 anos atrás
pai
commit
dad044d5b2
1 ficheiros alterados com 16 adições e 7 exclusões
  1. 16 7
      configure

+ 16 - 7
configure

@@ -205,14 +205,14 @@ is_host()
 os_arch=`uname -m | tr '[A-Z]' '[a-z]'`
 
 # set the default target platform and architecture
-_target_plat=${os_host}
-_target_arch=${os_arch}
+_target_plat_default=${os_host}
+_target_arch_default=${os_arch}
 
 # set the default target toolchain
 if is_host "macosx"; then
-    _target_toolchain="clang"
+    _target_toolchain_default="clang"
 else
-    _target_toolchain="gcc"
+    _target_toolchain_default="gcc"
 fi
 
 # determining target platform
@@ -555,21 +555,21 @@ Common options:
   --help                  Print this message.
   --version               Only print version information.
   --verbose               Display more information.
-  --plat=PLAT             Compile for the given platform. (default: '"${_target_plat}"')
+  --plat=PLAT             Compile for the given platform. (default: '"${_target_plat_default}"')
                               - msys
                               - cross
                               - bsd
                               - mingw
                               - macosx
                               - linux
-  --arch=ARCH             Compile for the given architecture. (default: '"${_target_arch}"')
+  --arch=ARCH             Compile for the given architecture. (default: '"${_target_arch_default}"')
                               - msys: i386 x86_64
                               - cross: i386 x86_64 arm arm64 mips mips64 riscv riscv64 s390x ppc ppc64 sh4
                               - bsd: i386 x86_64
                               - mingw: i386 x86_64 arm arm64
                               - macosx: x86_64 arm64
                               - linux: i386 x86_64 armv7 armv7s arm64-v8a mips mips64 mipsel mips64el
-  --toolchain=TOOLCHAIN   Set toolchain name. (default: '"${_target_toolchain}"')
+  --toolchain=TOOLCHAIN   Set toolchain name. (default: '"${_target_toolchain_default}"')
                               - clang
                               - gcc
 
@@ -646,6 +646,12 @@ done
 # check platform
 _check_platform()
 {
+    if test "x${_target_plat}" = "x"; then
+        _target_plat=${_target_plat_default}
+    fi
+    if test "x${_target_arch}" = "x"; then
+        _target_arch=${_target_arch_default}
+    fi
     echo "checking for platform ... ${_target_plat}"
     echo "checking for architecture ... ${_target_arch}"
 }
@@ -653,6 +659,9 @@ _check_platform()
 # check toolchain
 _check_toolchain()
 {
+    if test "x${_target_toolchain}" = "x"; then
+        _target_toolchain=${_target_toolchain_default}
+    fi
     echo "checking for toolchain ... ${_target_toolchain}"
 }