aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2003-06-02 03:01:22 +0000
committerJonathan Gray2003-06-02 03:01:22 +0000
commitd811359226c5e8b9d4815d47ee0ef22f54909f8d (patch)
treea7e64490d1e8d2dad9f0014a90d8c529dc5037a6
parent4292d621afdc57b4e8640b51137d5700def9fd83 (diff)
downloadscummvm-rg350-d811359226c5e8b9d4815d47ee0ef22f54909f8d.tar.gz
scummvm-rg350-d811359226c5e8b9d4815d47ee0ef22f54909f8d.tar.bz2
scummvm-rg350-d811359226c5e8b9d4815d47ee0ef22f54909f8d.zip
add compiler version checking to configure script
svn-id: r8261
-rw-r--r--Makefile.new1
-rwxr-xr-xconfigure48
2 files changed, 49 insertions, 0 deletions
diff --git a/Makefile.new b/Makefile.new
index 02ebfabf36..7b1cb50a9c 100644
--- a/Makefile.new
+++ b/Makefile.new
@@ -33,6 +33,7 @@ include config.mak
# Uncomment this for stricter compile time code verification
# CXXFLAGS+= -Wshadow -Werror
+CXXFLAGS += $(OPTFLAGS)
#######################################################################
# Misc stuff - you should normally never have to edit this #
diff --git a/configure b/configure
index 01fc1ee054..2a604a6222 100755
--- a/configure
+++ b/configure
@@ -20,6 +20,7 @@
TMPC=scummvm-conf.cpp
TMPO=scummvm-conf
TMPLOG=config.log
+CFLAGS=""
# default lib behaviour yes/no/auto
_vorbis=auto
@@ -181,7 +182,53 @@ if test -z $CXX; then
exit 1
fi
+#
+# Determine the compiler version
+
+echocheck "compiler version"
+
+cxx_name=`( $cc -v ) 2>&1 | tail -1 | cut -d ' ' -f 1`
+cxx_version=`( $CXX -dumpversion ) 2>&1`
+if test "$?" -gt 0; then
+ cxx_version="not found"
+fi
+
+case $cxx_version in
+ 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9])
+ _cxx_major=`echo $cxx_version | cut -d '.' -f 1`
+ _cxx_minor=`echo $cxx_version | cut -d '.' -f 2`
+ cxx_version="$cxx_version, ok"
+ cxx_verc_fail=no
+ ;;
+ 'not found')
+ cxx_verc_fail=yes
+ ;;
+ *)
+ cxx_version="$cxx_version, bad"
+ cxx_verc_fail=yes
+ ;;
+esac
+
+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.x or GCC 3.x"
+ exit 1
+fi
+
+#
+# Do CFLAGS now we know the compiler version
+#
+
+if test "$_cxx_major" -ge "3" ; then
+ CFLAGS="$CFLAGS -ansi -W -Wno-unused-parameter"
+fi;
+
+#
# Engine selection
+#
if test "$_build_scumm" = no ; then
_def_scumm='#define DISABLE_SCUMM'
else
@@ -402,6 +449,7 @@ cat > config.mak << EOF
# -------- Generated by configure -----------
CXX := $CXX
+OPTFLAGS := $CFLAGS
LIBS := $LIBS
RANLIB := $_ranlib
BACKEND := $_backend