[Scummvm-git-logs] scummvm master -> fcca692e5621691088ef99256c3b2758e189a4fd

sev- sev at scummvm.org
Mon Nov 1 20:46:20 UTC 2021


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7afd15149c CONFIGURE: Move C++11 test before compiler detection
9d5d7aca6f CONFIGURE: Remove compiler versions checks as they are now outdated
117927ce6c JANITORIAL: Remove unused HAVE_GCC3 variable
fcca692e56 CONFIGURE: Rework strict ANSI and pedantic arguments


Commit: 7afd15149c3b22e945f7f994394596476d2e1b05
    https://github.com/scummvm/scummvm/commit/7afd15149c3b22e945f7f994394596476d2e1b05
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2021-11-01T21:46:15+01:00

Commit Message:
CONFIGURE: Move C++11 test before compiler detection

As C++11 is mandatory now, just ensure we've got a proper compiler

Changed paths:
    configure


diff --git a/configure b/configure
index e8525a6a82..ce547b2a35 100755
--- a/configure
+++ b/configure
@@ -2035,6 +2035,23 @@ fi
 
 LD=$CXX
 
+#
+# Check whether the compiler supports C++11
+#
+echo_n "Checking if compiler supports C++11... "
+have_cxx11=no
+cat > $TMPC << EOF
+int main(int argc, char *argv[]) { if (argv == nullptr) return -1; else return 0; }
+EOF
+cc_check -std=c++11 && have_cxx11=yes
+echo $have_cxx11
+
+if test "$have_cxx11" = "no" ; then
+	echo
+	echo "ScummVM requires C++11 compiler support. Please ensure your compiler supports it"
+	exit 1
+fi
+
 #
 # Determine the compiler version
 #
@@ -2149,23 +2166,6 @@ if test "$cxx_verc_fail" = yes ; then
 	exit 1
 fi
 
-#
-# Check whether the compiler supports C++11
-#
-echo_n "Checking if compiler supports C++11... "
-have_cxx11=no
-cat > $TMPC << EOF
-int main(int argc, char *argv[]) { if (argv == nullptr) return -1; else return 0; }
-EOF
-cc_check -std=c++11 && have_cxx11=yes
-echo $have_cxx11
-
-if test "$have_cxx11" = "no" ; then
-	echo
-	echo "ScummVM requires C++11 compiler support. Please ensure your compiler supports it"
-	exit 1
-fi
-
 #
 # Setup compiler specific CXXFLAGS now that we know the compiler version.
 # Foremost, this means enabling various warnings.


Commit: 9d5d7aca6f71afb8b61f164257052d0a6621b3a5
    https://github.com/scummvm/scummvm/commit/9d5d7aca6f71afb8b61f164257052d0a6621b3a5
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2021-11-01T21:46:15+01:00

Commit Message:
CONFIGURE: Remove compiler versions checks as they are now outdated

C++11 mandatory support expects a recent compiler.
Version parsing is still present to allow adding back tests for more
recent checks.

Changed paths:
    configure


diff --git a/configure b/configure
index ce547b2a35..07e8551a57 100755
--- a/configure
+++ b/configure
@@ -2101,13 +2101,8 @@ if test "$have_gcc" = yes; then
 		cxx_version=`gcc_get_define __clang_version__`
 		cxx_version="`echo "${cxx_version}" | sed -e 's/"\([^ ]*\) .*/\1/'`"
 		cxx_version="clang $cxx_version, ok"
-	elif test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \
-	   test "$_cxx_major" -gt 2 ; then
-		cxx_version="$cxx_version, ok"
-		cxx_verc_fail=no
 	else
-		cxx_version="$cxx_version, bad"
-		cxx_verc_fail=yes
+		cxx_version="GCC $cxx_version, ok"
 	fi
 elif test "$have_icc" = yes; then
 	cxx_version="`( $CXX -dumpversion ) 2>/dev/null`"
@@ -2121,35 +2116,33 @@ else
 		cxx_version="`echo "${cxx_version}" | sed -ne 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/gp'`"
 		if test -z "${cxx_version}"; then
 			cxx_version="not found"
-			cxx_verc_fail=yes
 		fi
 		echo non-gcc compiler version ${cxx_version}
 	else
 		cxx_version="not found"
-		cxx_verc_fail=yes
-		echo found non-gcc compiler version ${cxx_version}
+		echo non-gcc compiler version ${cxx_version}
 	fi
+	cxx_verc_fail=yes
 
 	case $_host_os in
 		irix*)
 			case $cxx_version in
 				7.4.4*)
 					# We just assume this is SGI MIPSpro
+					cxx_version="assumed SGI MIPSpro $cxx_version, ok"
+					cxx_verc_fail=no
 					_cxx_major=7
 					_cxx_minor=4
-					cxx_verc_fail=no
 					add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MDupdate "$(*D)/$(DEPDIR)/$(*F).d"'
 					add_line_to_config_mk '-include Makedepend'
 					;;
 				*)
 					cxx_version="$cxx_version, bad"
-					cxx_verc_fail=yes
 					;;
 			esac
 			;;
 		*)
 			cxx_version="$cxx_version, bad"
-			cxx_verc_fail=yes
 			;;
 	esac
 fi
@@ -2162,37 +2155,28 @@ echo "$cxx_version"
 if test "$cxx_verc_fail" = yes ; then
 	echo
 	echo "The version of your compiler is not supported at this time"
-	echo "Please ensure you are using GCC >= 2.95"
 	exit 1
 fi
 
 #
 # Setup compiler specific CXXFLAGS now that we know the compiler version.
 # Foremost, this means enabling various warnings.
-# In addition, we set CXX_UPDATE_DEP_FLAG for GCC >= 3.0 and for ICC.
+# In addition, we set CXX_UPDATE_DEP_FLAG for GCC and ICC.
 #
 if test "$have_gcc" = yes ; then
-	if test "$_cxx_major" -ge "3" ; then
-		case $_host_os in
-		# newlib-based system include files suppress non-C89 function
-		# declarations under __STRICT_ANSI__, undefine it
-		3ds | amigaos* | android | androidsdl | dreamcast | ds | gamecube | mint* | n64 | psp | ps3 | psp2 | switch | wii )
-			append_var CXXFLAGS "-U__STRICT_ANSI__"
-			;;
-		*)
-			;;
-		esac
-		append_var CXXFLAGS "-W -Wno-unused-parameter"
-		add_line_to_config_mk 'HAVE_GCC3 = 1'
-		add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
-	fi;
-
-	if test "$_cxx_major" -eq 4 && test "$_cxx_minor" -ge 3 || \
-	   test "$_cxx_major" -gt 4 ; then
-		append_var CXXFLAGS "-Wno-empty-body"
-	else
-		append_var CXXFLAGS "-Wconversion"
-	fi;
+	case $_host_os in
+	# newlib-based system include files suppress non-C89 function
+	# declarations under __STRICT_ANSI__, undefine it
+	3ds | amigaos* | android | androidsdl | dreamcast | ds | gamecube | mint* | n64 | psp | ps3 | psp2 | switch | wii )
+		append_var CXXFLAGS "-U__STRICT_ANSI__"
+		;;
+	*)
+		;;
+	esac
+	append_var CXXFLAGS "-W -Wno-unused-parameter"
+	add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
+
+	append_var CXXFLAGS "-Wno-empty-body"
 	append_var CXXFLAGS "-fno-operator-names"
 elif test "$have_icc" = yes ; then
 	add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'


Commit: 117927ce6cccc65bd0f67d4ad2a0b2d4a4a9bc1a
    https://github.com/scummvm/scummvm/commit/117927ce6cccc65bd0f67d4ad2a0b2d4a4a9bc1a
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2021-11-01T21:46:15+01:00

Commit Message:
JANITORIAL: Remove unused HAVE_GCC3 variable

Changed paths:
    backends/platform/dc/Makefile
    backends/platform/n64/Makefile
    backends/platform/psp/Makefile


diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile
index 6da32a9049..e36823852c 100644
--- a/backends/platform/dc/Makefile
+++ b/backends/platform/dc/Makefile
@@ -30,7 +30,6 @@ RM = rm -f
 RM_REC = rm -rf
 AR = sh-elf-ar cru
 RANLIB = sh-elf-ranlib
-HAVE_GCC3 = true
 USE_RGB_COLOR = true
 
 ifdef DYNAMIC_MODULES
diff --git a/backends/platform/n64/Makefile b/backends/platform/n64/Makefile
index f7341eedd4..61d328f244 100644
--- a/backends/platform/n64/Makefile
+++ b/backends/platform/n64/Makefile
@@ -44,7 +44,6 @@ RM = rm -f
 RM_REC = rm -rf
 
 VERBOSE_BUILD=1
-HAVE_GCC3=1
 USE_RGB_COLOR=0
 
 ENABLED=STATIC_PLUGIN
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index d11c2be38a..1b9932113e 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -79,7 +79,6 @@ AR      = psp-ar cru
 RANLIB  = psp-ranlib
 AS      = psp-gcc
 LD      = psp-gcc
-HAVE_GCC3 = true
 CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP
 
 # Variables for dynamic plugin building


Commit: fcca692e5621691088ef99256c3b2758e189a4fd
    https://github.com/scummvm/scummvm/commit/fcca692e5621691088ef99256c3b2758e189a4fd
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2021-11-01T21:46:15+01:00

Commit Message:
CONFIGURE: Rework strict ANSI and pedantic arguments

Changed paths:
    configure


diff --git a/configure b/configure
index 07e8551a57..b4fa60a2e3 100755
--- a/configure
+++ b/configure
@@ -2163,12 +2163,25 @@ fi
 # Foremost, this means enabling various warnings.
 # In addition, we set CXX_UPDATE_DEP_FLAG for GCC and ICC.
 #
+# By default compile with strict C++
+std_variant=c++
+pedantic=no
 if test "$have_gcc" = yes ; then
+	# By default, we add -pedantic to the CXXFLAGS to catch some potentially
+	# non-portable constructs, like use of GNU extensions.
+	# However, some platforms use GNU extensions in system header files, so
+	# for these we must not use -pedantic.
+	pedantic=yes
+
 	case $_host_os in
 	# newlib-based system include files suppress non-C89 function
 	# declarations under __STRICT_ANSI__, undefine it
-	3ds | amigaos* | android | androidsdl | dreamcast | ds | gamecube | mint* | n64 | psp | ps3 | psp2 | switch | wii )
-		append_var CXXFLAGS "-U__STRICT_ANSI__"
+	3ds | android | androidsdl | gamecube | psp | switch | wii)
+		std_variant=gnu++
+		pedantic=no
+		;;
+	amigaos* | dreamcast | ds | mint* | n64 | ps3 | psp2)
+		std_variant=gnu++
 		;;
 	*)
 		;;
@@ -2179,13 +2192,19 @@ if test "$have_gcc" = yes ; then
 	append_var CXXFLAGS "-Wno-empty-body"
 	append_var CXXFLAGS "-fno-operator-names"
 elif test "$have_icc" = yes ; then
+	# ICC does not support pedantic, while GCC and clang do.
 	add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
 fi;
 
 #
 # Set status about C++11 mode
 #
-append_var CXXFLAGS "-std=c++11"
+append_var CXXFLAGS "-std=${std_variant}11"
+
+if test "$pedantic" = yes ; then
+	# We *do* want the 'long long' extension.
+	append_var CXXFLAGS "-pedantic -Wno-long-long"
+fi
 
 #
 # Additional tests for C++11 features that may not be present
@@ -2280,22 +2299,6 @@ if test "$_release_build" = yes; then
 	append_var DEFINES "-DRELEASE_BUILD"
 fi
 
-# By default, we add -pedantic to the CXXFLAGS to catch some potentially
-# non-portable constructs, like use of GNU extensions.
-# However, some platforms use GNU extensions in system header files, so
-# for these we must not use -pedantic.
-case $_host_os in
-3ds | android | androidsdl | gamecube | psp | switch | wii)
-	;;
-*)
-	# ICC does not support pedantic, while GCC and clang do.
-	if test "$have_icc" = no ; then
-		# We *do* want the 'long long' extension.
-		append_var CXXFLAGS "-pedantic -Wno-long-long"
-	fi
-	;;
-esac
-
 # If possible, we want to use -Wglobal-constructors
 # However, not all compilers support that, so check whether the active one does.
 echocheck "whether C++ compiler accepts -Wglobal-constructors"




More information about the Scummvm-git-logs mailing list