2
0
ruki 2 жил өмнө
parent
commit
44c650b58c
1 өөрчлөгдсөн 20 нэмэгдсэн , 6 устгасан
  1. 20 6
      configure

+ 20 - 6
configure

@@ -2568,6 +2568,18 @@ done
 # detect platform and toolchains
 # detect platform and toolchains
 #
 #
 
 
+# envs toolchain
+toolchain "envs"
+    set_toolset "as" "$CC" "$CXX" "$AS"
+    set_toolset "cc" "$CC"
+    set_toolset "cxx" "$CC" "$CXX"
+    set_toolset "mm" "$CC" "$CXX"
+    set_toolset "mxx" "$CC" "$CXX"
+    set_toolset "ld" "$CXX" "$CC" "$LD"
+    set_toolset "sh" "$CXX" "$CC" "$LD"
+    set_toolset "ar" "$AR"
+toolchain_end
+
 # clang toolchain
 # clang toolchain
 toolchain "clang"
 toolchain "clang"
     set_toolset "as" "clang"
     set_toolset "as" "clang"
@@ -2853,10 +2865,12 @@ _toolchain_try_toolset() {
             key="${key}_${idx}"
             key="${key}_${idx}"
         fi
         fi
         _get_toolchain_toolset "${toolchain}" "${key}"; local program="${_ret}"
         _get_toolchain_toolset "${toolchain}" "${key}"; local program="${_ret}"
-        if _toolchain_try_program "${toolchain}" "${kind}" "${program}"; then
-            _set_toolchain_toolset "${toolchain}" "${kind}" "${program}"
-            echo "checking for the ${description} (${kind}) ... ${program}"
-            return 0
+        if test_nz "${program}"; then
+            if _toolchain_try_program "${toolchain}" "${kind}" "${program}"; then
+                _set_toolchain_toolset "${toolchain}" "${kind}" "${program}"
+                echo "checking for the ${description} (${kind}) ... ${program}"
+                return 0
+            fi
         fi
         fi
     done
     done
     return 1
     return 1
@@ -2923,7 +2937,7 @@ _toolchain_detect() {
     local toolchains="${1}"
     local toolchains="${1}"
     if test "x${toolchains}" = "x"; then
     if test "x${toolchains}" = "x"; then
         if is_plat "macosx"; then
         if is_plat "macosx"; then
-            toolchains="clang gcc"
+            toolchains="envs clang gcc"
         elif is_plat "mingw"; then
         elif is_plat "mingw"; then
             if is_arch "i386"; then
             if is_arch "i386"; then
                 toolchains="i686_w64_mingw32"
                 toolchains="i686_w64_mingw32"
@@ -2931,7 +2945,7 @@ _toolchain_detect() {
                 toolchains="x86_64_w64_mingw32"
                 toolchains="x86_64_w64_mingw32"
             fi
             fi
         else
         else
-            toolchains="gcc clang"
+            toolchains="envs gcc clang"
         fi
         fi
     fi
     fi
     for toolchain in ${toolchains}; do
     for toolchain in ${toolchains}; do