Changeset - r14526:bc6bd0422cf0
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2010-02-12 18:41:46
rubidium@openttd.org
(svn r19107) -Change: GCC 3.2 seems to be having trouble with some templates too
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1105,98 +1105,98 @@ check_params() {
 
	else
 
		log 1 "menu item directory... none"
 
	fi
 
}
 

	
 
make_compiler_cflags() {
 
	# Params:
 
	# $1 - compiler
 
	# $2 - the current cflags
 
	# $3 - variable to finally write cflags to
 
	# $4 - the current cxxflags
 
	# $5 - variable to finally write cxxflags to
 
	# $6 - the current ldflags
 
	# $7 - variable to finally write ldflags to
 

	
 
	flags="$2"
 
	cxxflags="$4"
 
	ldflags="$6"
 

	
 
	if [ `basename $1 | cut -c 1-3` = "icc" ]; then
 
		# Enable some things only for certain ICC versions
 
		cc_version=`$1 -dumpversion | cut -c 1-4 | sed s@\\\.@@g`
 

	
 
		flags="$flags -rdynamic"
 
		ldflags="$ldflags -rdynamic"
 

	
 
		if [ $cc_version -ge 101 ]; then
 
			flags="$flags -Wno-multichar"
 
		fi
 

	
 
		if [ $cc_version -ge 110 ]; then
 
			# vec report defaults to telling where it did loop vectorisation, which is not very important
 
			flags="$flags -vec-report=0 -wd873"
 

	
 
			# Use c++0x mode so static_assert() is available
 
			cxxflags="$cxxflags -std=c++0x"
 
		fi
 

	
 
		has_ipo=`$1 -help ipo | grep '\-ipo'`
 
		if [ "$enable_lto" != "0" ] && [ -n "$has_ipo" ]; then
 
			# Use IPO (only if we see IPO exists and is requested)
 
			flags="$flags -ipo"
 
			ldflags="$ldflags -ipo $CFLAGS"
 
		fi
 
	else
 
		# Enable some things only for certain GCC versions
 
		cc_version=`$1 -dumpversion | cut -c 1,3`
 

	
 
		if [ $cc_version -lt 30 ]; then
 
			log 1 "configure: error: gcc older than 3.0 can't compile OpenTTD because of its poor template support"
 
		if [ $cc_version -lt 32 ]; then
 
			log 1 "configure: error: gcc older than 3.2 can't compile OpenTTD because of its poor template support"
 
			exit 1
 
		fi
 

	
 
		flags="$flags -Wall -Wno-multichar -Wsign-compare -Wundef"
 
		flags="$flags -Wwrite-strings -Wpointer-arith"
 
		flags="$flags -W -Wno-unused-parameter -Wformat=2"
 
		flags="$flags -Wredundant-decls"
 

	
 
		if [ $enable_assert -eq 0 ]; then
 
			# Do not warn about unused variables when building without asserts
 
			flags="$flags -Wno-unused-variable"
 
		fi
 

	
 
		if [ $cc_version -ge 40 ]; then
 
			# GCC 4.0+ complains about that we break strict-aliasing.
 
			#  On most places we don't see how to fix it, and it doesn't
 
			#  break anything. So disable strict-aliasing to make the
 
			#  compiler all happy.
 
			flags="$flags -fno-strict-aliasing"
 
			ldflags="$ldflags -fno-strict-aliasing"
 
			# Warn about casting-out 'const' with regular C-style cast.
 
			#  The preferred way is const_cast<>() which doesn't warn.
 
			flags="$flags -Wcast-qual"
 
		fi
 

	
 
		if [ $cc_version -ge 42 ]; then
 
			# GCC 4.2+ automatically assumes that signed overflows do
 
			# not occur in signed arithmetics, whereas we are not
 
			# sure that they will not happen. It furthermore complains
 
			# about it's own optimized code in some places.
 
			flags="$flags -fno-strict-overflow"
 
			ldflags="$ldflags -fno-strict-overflow"
 
		fi
 

	
 
		if [ $cc_version -ge 43 ]; then
 
			# Use gnu++0x mode so static_assert() is available.
 
			# Don't use c++0x, it breaks mingw (with gcc 4.4.0).
 
			cxxflags="$cxxflags -std=gnu++0x"
 
		fi
 

	
 
		if [ $cc_version -ge 45 ]; then
 
			# Only GCC 4.5+ has (possibly) LTO
 
			has_lto=`$1 -dumpspecs | grep '\%{flto}'`
 
			if [ "$enable_lto" != "0" ] && [ -n "$has_lto" ]; then
 
				# Use LTO only if we see LTO exists and is requested
 
				flags="$flags -flto"
 
				ldflags="$ldflags -flto $2"
 
			fi
0 comments (0 inline, 0 general)