From 8bb863c8399915913aa830d0ac4e4fb65fedd37d Mon Sep 17 00:00:00 2001 From: midipix Date: Apr 17 2021 15:43:20 +0000 Subject: build system: ccenv: ccenv_set_cxx(): enhanced and corrected logic. --- diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index 67b5720..8a7c4f2 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -604,16 +604,25 @@ ccenv_set_cxx() ccenv_candidates="clang++" ;; *-gcc ) - ccenv_cpp_prefix=${ccenv_cc_cmd%-gcc*}- - ccenv_candidates="${ccenv_cpp_prefix}g++" ;; + ccenv_cxx_prefix=${ccenv_cc_cmd%-gcc*}- + ccenv_candidates="${ccenv_cxx_prefix}g++" ;; *-clang ) - ccenv_cpp_prefix=${ccenv_cc_cmd%-clang*}- - ccenv_candidates="${ccenv_cpp_prefix}clang++" ;; + ccenv_cxx_prefix=${ccenv_cc_cmd%-clang*}- + ccenv_candidates="${ccenv_cxx_prefix}clang++" ;; + + /*cc | /*c99 | /*c11 ) + ccenv_cxx_prefix=${ccenv_cc_cmd%/*} + ccenv_candidates="${ccenv_cxx_prefix}/cxx" + ccenv_candidates="${ccenv_candidates} ${ccenv_cxx_prefix}/c++" ;; + + /*gcc ) + ccenv_cxx_prefix=${ccenv_cc_cmd%/*} + ccenv_candidates="${ccenv_cxx_prefix}/g++" ;; - *cc ) - ccenv_cxx_prefix=${ccenv_cc_cmd%cc*} - ccenv_candidates="${ccenv_cpp_prefix}++" ;; + /*clang ) + ccenv_cxx_prefix=${ccenv_cc_cmd%/*} + ccenv_candidates="${ccenv_cxx_prefix}/clang++" ;; * ) ccenv_cxx="$ccenv_cc -xc++"