diff options
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 30 |
1 files changed, 18 insertions, 12 deletions
@@ -874,21 +874,27 @@ EOF } # Prepare a list of candidates for the C++ compiler -if test -n "$_host"; then - compilers="$CXX $_host_alias-g++ $_host_alias-c++ $_host-g++ $_host-c++" +if test -n "$CXX" && test_compiler "$CXX"; then + # Use the compiler specified in CXX + echo $CXX else - compilers="$CXX g++ c++" + if test -n "$_host"; then + compilers="$_host_alias-g++ $_host_alias-c++ $_host-g++ $_host-c++" + else + compilers="g++ c++" + fi + + # Iterate over all candidates, pick the first working one + CXX= + for compiler in $compilers; do + if test_compiler $compiler; then + CXX=$compiler + echo $CXX + break + fi + done fi -# Iterate over all candidates, pick the first working one -CXX= -for compiler in $compilers; do - if test_compiler $compiler; then - CXX=$compiler - echo $CXX - break - fi -done if test -z "$CXX"; then echo "none found!" exit 1 |
