Changeset - r22797:a4370fd284f7
[Not reviewed]
master
0 1 0
Patric Stout - 7 years ago 2018-04-14 18:12:05
truebrain@openttd.org
Change: [Build] prioritize cc-build over build (based on patch by woutershep2) (#6716)

This closes #6414
1 file changed with 16 insertions and 16 deletions:
config.lib
16
16
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1974,13 +1974,28 @@ check_compiler() {
 
	# $5 - Env-setting to try
 
	# $6 - GCC alike to try
 
	# $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
 
	if [ -n "$4" ]; then
 
		# Check for manual compiler
 
		machine=`$4 $9 2>/dev/null`
 
		ret=$?
 
		eval "$2=\"$4\""
 

	
 
		log 2 "executing $4 $9"
 
		log 2 "  returned $machine"
 
		log 2 "  exit code $ret"
 

	
 
		if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
 
			log 1 "checking $1... $4 not found"
 
			log 1 "the selected binary doesn't seem to be a $6 binary"
 
			exit 1
 
		fi
 
	elif [ -n "$3" ]; then
 
		# Check for system
 
		if [ -z "$6" ]; then
 
			compiler="$3"
 
		else
 
			compiler="$3-$6"
 
		fi
 
@@ -2017,27 +2032,12 @@ check_compiler() {
 

	
 
		if [ "$machine" != "$3" ] && ( [ "$8" = "0" ] || [ "$8" = "1" ] ); then
 
			log 1 "checking $1... expected $3, found $machine"
 
			log 1 "the compiler suggests it doesn't build code for the machine you specified"
 
			exit 1
 
		fi
 
	elif [ -n "$4" ]; then
 
		# Check for manual compiler
 
		machine=`$4 $9 2>/dev/null`
 
		ret=$?
 
		eval "$2=\"$4\""
 

	
 
		log 2 "executing $4 $9"
 
		log 2 "  returned $machine"
 
		log 2 "  exit code $ret"
 

	
 
		if ( [ -z "$machine" ] && [ "$8" != "3" ] ) || [ "$ret" != "0" ]; then
 
			log 1 "checking $1... $4 not found"
 
			log 1 "the selected binary doesn't seem to be a $6 binary"
 
			exit 1
 
		fi
 
	else
 
		# Nothing given, autodetect
 

	
 
		if [ -n "$5" ]; then
 
			machine=`$5 $9 2>/dev/null`
 
			ret=$?
0 comments (0 inline, 0 general)