Fix compiler detection if CXX is preset to a working compiler but contains a space

svn-id: r39634
This commit is contained in:
Max Horn 2009-03-23 15:47:45 +00:00
parent 3b5a14916d
commit 082c1f782d

22
configure vendored
View file

@ -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++"
fi
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
# 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
done
fi
if test -z "$CXX"; then
echo "none found!"
exit 1