add compiler version checking to configure script
svn-id: r8261
This commit is contained in:
parent
4292d621af
commit
d811359226
2 changed files with 49 additions and 0 deletions
|
@ -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 #
|
||||
|
|
48
configure
vendored
48
configure
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue