Changeset - r5981:80ca91081637
[Not reviewed]
master
0 1 0
truelight - 18 years ago 2007-02-11 17:39:28
truelight@openttd.org
(svn r8680) [Configure] -Codechange: allow a bit more flexible code in check_compiler
1 file changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -896,22 +896,27 @@ check_compiler() {
 
	# $7 - CC alike to try
 
	# $8 - "0" gcc, "1" g++, "2" windres, "3" strip, "4" lipo
 
	# $9 - What the command is to check for
 

	
 
	if [ -n "$3" ]; then
 
		# Check for system
 
		machine=`$3-$6 $9 2>/dev/null`
 
		if [ -z "$6" ]; then
 
			compiler="$3"
 
		else
 
			compiler="$3-$6"
 
		fi
 
		machine=`eval $compiler $9 2>/dev/null`
 
		ret=$?
 
		eval "$2=$3-$6"
 
		eval "$2=$compiler"
 

	
 
		log 2 "executing $3-$6 $9"
 
		log 2 "executing $compiler $9"
 
		log 2 "  returned $machine"
 
		log 2 "  exit code $ret"
 

	
 
		if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
 
			log 1 "checking $1... $3-$6 not found"
 
			log 1 "checking $1... $compiler not found"
 
			log 1 "I couldn't detect any $6 binary for $3"
 
			exit 1
 
		fi
 

	
 
		if [ "$machine" != "$3" ] && ( [ "$8" = "0" ] || [ "$8" = "1" ] ); then
 
			log 1 "checking $1... expected $3, found $machine"
0 comments (0 inline, 0 general)