Changeset - r23106:15a707dfb449
[Not reviewed]
master
0 1 0
Charles Pigott - 6 years ago 2018-11-25 11:27:08
charlespigott@googlemail.com
Codechange: Always compile with C++11
1 file changed with 3 insertions and 14 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1314,14 +1314,12 @@ make_compiler_cflags() {
 
			flags="$flags -vec-report=0 "
 
		fi
 

	
 
		if [ $cc_version -ge 110 ]; then
 
			# remark #2259: non-pointer conversion from ... to ... may lose significant bits
 
			flags="$flags -wd2259"
 
			# Use c++0x mode so static_assert() is available
 
			cxxflags="$cxxflags -std=c++0x"
 
		fi
 

	
 
		if [ "$enable_lto" != "0" ]; then
 
			has_ipo=`$1 -help ipo | grep '\-ipo'`
 
			if [ -n "$has_ipo" ]; then
 
				# Use IPO (only if we see IPO exists and is requested)
 
@@ -1377,17 +1375,12 @@ make_compiler_cflags() {
 

	
 
		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 "33" ]; then
 
			# clang completed C++11 support in version 3.3
 
			flags="$flags -std=c++11"
 
		fi
 

	
 
		# rdynamic is used to get useful stack traces from crash reports.
 
		ldflags="$ldflags -rdynamic"
 

	
 
	# Assume gcc, since it just uses argv[0] in its --version output
 
	else
 
		# Enable some things only for certain GCC versions
 
@@ -1440,18 +1433,12 @@ make_compiler_cflags() {
 
			flags="$flags -fno-strict-overflow"
 
			# GCC 4.2 no longer includes -Wnon-virtual-dtor in -Wall.
 
			# Enable it in order to be consistent with older GCC versions.
 
			flags="$flags -Wnon-virtual-dtor"
 
		fi
 

	
 
		if [ $cc_version -ge 403 ] && [ $cc_version -lt 600 ]; 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 -eq 405 ]; then
 
			# Prevent optimisation supposing enums are in a range specified by the standard
 
			# For details, see http://gcc.gnu.org/PR43680
 
			flags="$flags -fno-tree-vrp"
 
		fi
 

	
 
@@ -1467,13 +1454,13 @@ make_compiler_cflags() {
 
			flags="$flags -Wno-free-nonheap-object"
 
		fi
 

	
 
		if [ $cc_version -ge 600 ]; then
 
			# -flifetime-dse=2 (default since GCC 6) doesn't play
 
			# well with our custom pool item allocator
 
			cxxflags="$cxxflags -flifetime-dse=1 -std=gnu++14"
 
			cxxflags="$cxxflags -flifetime-dse=1"
 
		fi
 

	
 
		if [ "$enable_lto" != "0" ]; then
 
			# GCC 4.5 outputs '%{flto}', GCC 4.6 outputs '%{flto*}'
 
			has_lto=`$1 -dumpspecs | grep '\%{flto'`
 
			if [ -n "$has_lto" ]; then
 
@@ -1530,12 +1517,14 @@ make_cflags_and_ldflags() {
 

	
 
	make_compiler_cflags "$cc_build" "CFLAGS_BUILD" "CXXFLAGS_BUILD" "LDFLAGS_BUILD" "FEATURES_BUILD"
 
	make_compiler_cflags "$cc_host" "CFLAGS" "CXXFLAGS" "LDFLAGS" "FEATURES"
 

	
 
	CFLAGS="$CFLAGS -D$os"
 
	CFLAGS_BUILD="$CFLAGS_BUILD -D$os"
 
	CXXFLAGS="$CXXFLAGS -std=c++11"
 
	CXXFLAGS_BUILD="$CXXFLAGS_BUILD -std=c++11"
 

	
 
	if [ "$enable_debug" = "0" ]; then
 
		# No debug, add default stuff
 
		OBJS_SUBDIR="release"
 
		if [ "$os" = "MORPHOS" ]; then
 
			CFLAGS="-I/gg/os-include -noixemul -fstrict-aliasing -fexpensive-optimizations -mcpu=604 -fno-inline -mstring -mmultiple $CFLAGS"
0 comments (0 inline, 0 general)