[Scummvm-cvs-logs] scummvm-tools master -> 683ae8b87c948f82c3124a99c8e90384a8d527b3

digitall dgturner at iee.org
Fri Nov 23 01:57:52 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
683ae8b87c TOOLS: Fix configure compiler tests when cross-compiling.


Commit: 683ae8b87c948f82c3124a99c8e90384a8d527b3
    https://github.com/scummvm/scummvm-tools/commit/683ae8b87c948f82c3124a99c8e90384a8d527b3
Author: D G Turner (digitall at scummvm.org)
Date: 2012-11-22T16:56:10-08:00

Commit Message:
TOOLS: Fix configure compiler tests when cross-compiling.

This is a sync to the scummvm configure script functions and may require
further changes, but trying to ensure native compilation is not
affected.

Changed paths:
    configure



diff --git a/configure b/configure
index 728f454..37cf35d 100755
--- a/configure
+++ b/configure
@@ -509,7 +509,7 @@ echo_n "Looking for C++ compiler... "
 
 # Check whether the given command is a working C++ compiler
 test_compiler() {
-	cat <<EOF >tmp_cxx_compiler.cpp
+	cat > tmp_cxx_compiler.cpp << EOF
 	class Foo { int a; };
 	int main(int argc, char **argv) {
 		Foo *a = new Foo(); delete a; return 0;
@@ -518,7 +518,12 @@ EOF
 
 	echo "testing compiler: $1" >> "$TMPLOG"
 
-	eval "$1 $CXXFLAGS $LDFLAGS -o $TMPO$HOSTEXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "$TMPO$HOSTEXEEXT 2> /dev/null" && cc_check_clean tmp_cxx_compiler.cpp
+	if test -n "$_host"; then
+		# In cross-compiling mode, we cannot run the result
+		eval "$1 $CXXFLAGS $LDFLAGS -o $TMPO.o -c tmp_cxx_compiler.cpp" 2> /dev/null && cc_check_clean tmp_cxx_compiler.cpp
+	else
+		eval "$1 $CXXFLAGS $LDFLAGS -o $TMPO$HOSTEXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "$TMPO$HOSTEXEEXT 2> /dev/null" && cc_check_clean tmp_cxx_compiler.cpp
+	fi
 }
 
 # Prepare a list of candidates for the C++ compiler
@@ -526,7 +531,11 @@ if test -n "$CXX" && test_compiler "$CXX"; then
 	# Use the compiler specified in CXX
 	echo $CXX
 else
-	compilers="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=






More information about the Scummvm-git-logs mailing list