aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure30
1 files changed, 18 insertions, 12 deletions
diff --git a/configure b/configure
index 4112231eee..36c5a172c7 100755
--- a/configure
+++ b/configure
@@ -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