Changeset - r9137:e7a782e8be34
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-05-07 21:42:17
rubidium@openttd.org
(svn r12998) -Fix: -Wredundant_decls sees "friend" declarations as redundant declarations in GCC 2.95, so only use if for GCC >= 3.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -900,62 +900,63 @@ make_cflags_and_ldflags() {
 
	if [ "$enable_profiling" != "0" ]; then
 
		CFLAGS="$CFLAGS -p"
 
		LDFLAGS="$LDFLAGS -pg"
 
	fi
 

	
 
	if [ "$with_threads" = "0" ]; then
 
		CFLAGS="$CFLAGS -DNO_THREADS"
 
	fi
 

	
 
	if [ `echo $cc_host | cut -c 1-3` = "icc" ]; then
 
		# Enable some things only for certain ICC versions
 
		cc_version=`$cc_host -dumpversion | cut -c 1-4`
 

	
 

	
 
		if [ "$cc_version" = "10.1" ]; then
 
			CFLAGS="$CFLAGS -Wno-multichar"
 
		fi
 
	else
 
		# Enable some things only for certain GCC versions
 
		cc_version=`$cc_host -dumpversion | cut -c 1,3`
 

	
 
		if [ $cc_version -ge 29 ]; then
 
			CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
 
			CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
 
			CFLAGS="$CFLAGS -Wno-uninitialized -Wredundant-decls"
 
			CFLAGS="$CFLAGS -Wno-uninitialized"
 

	
 
			CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
 
		fi
 

	
 
		gcc295=""
 
		if [ "$cc_version" = 29 ]; then
 
			# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
 
			#  need a lovely hack there to make it compile correctly.
 
			gcc295="1"
 
		fi
 

	
 
		if [ $cc_version -ge 30 ]; then
 
			CFLAGS="$CFLAGS -W -Wno-unused-parameter -Wformat=2"
 
			CFLAGS="$CFLAGS -Wredundant-decls"
 
		fi
 

	
 
		if [ $cc_version -ge 34 ]; then
 
			CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
 
		fi
 

	
 
		if [ "$os" = "CYGWIN" ]; then
 
			CFLAGS="$CFLAGS -mwin32"
 
			LDFLAGS="$LDFLAGS -mwin32"
 
		fi
 
		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
 
			CFLAGS="$CFLAGS -mno-cygwin"
 
			LDFLAGS="$LDFLAGS -mno-cygwin"
 
		fi
 

	
 
		if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
 
			LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
 
			LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
 
		fi
 

	
 
		# 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.
0 comments (0 inline, 0 general)