100
113
if test -n "$_host"; then
101
114
# In cross-compiling mode, we cannot run the result
102
eval "$1 -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
115
eval "$1 $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
104
eval "$1 -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
117
eval "$1 $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp 2> /dev/null" && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
121
# Add a line of data to config.mk.
122
add_line_to_config_mk() {
123
_config_mk_data="$_config_mk_data"'
109
129
# Determine sdl-config
377
397
echocheck "compiler version"
379
cxx_name=`( $cc -v ) 2>&1 | tail -n 1 | cut -d ' ' -f 1`
380
cxx_version=`( $CXX -dumpversion ) 2>&1`
381
if test "$?" -gt 0; then
382
cxx_version="not found"
400
cc_check_define __GNUC__ && have_gcc=yes
402
if test "$have_gcc" = yes; then
403
cxx_name=`( $cc -v ) 2>&1 | tail -n 1 | cut -d ' ' -f 1`
404
cxx_version=`( $CXX -dumpversion ) 2>&1`
405
if test "$?" -gt 0; then
406
cxx_version="not found"
410
2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|3.[0-9].[0-9][-.]*|4.[0-9]|4.[0-9].[0-9]|4.[0-9].[0-9][-.]*)
411
_cxx_major=`echo $cxx_version | cut -d '.' -f 1`
412
_cxx_minor=`echo $cxx_version | cut -d '.' -f 2`
413
cxx_version="$cxx_version, ok"
416
# whacky beos version strings
417
2.9-beos-991026*|2.9-beos-000224*)
420
cxx_version="$cxx_version, ok"
431
cxx_version="$cxx_version, bad"
435
if test "$_cxx_major" -ge "3" ; then
437
_make_def_HAVE_GCC3='HAVE_GCC3 = 1'
438
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
440
_make_def_HAVE_GCC='HAVE_GCC = 1'
443
cxx_version=`( $CXX -version ) 2>&1`
444
if test "$?" -eq 0; then
445
cxx_version="`echo "${cxx_version}" | sed -ne 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/gp'`"
446
if test -z "${cxx_version}"; then
447
cxx_version="not found"
450
echo non-gcc compiler version ${cxx_version}
452
cxx_version="not found"
454
echo found non-gcc compiler version ${cxx_version}
462
# We just assume this is SGI MIPSpro
466
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MDupdate "$(*D)/$(DEPDIR)/$(*F).d"'
467
add_line_to_config_mk '-include Makedepend'
470
cxx_version="$cxx_version, bad"
476
cxx_version="$cxx_version, bad"
386
2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|3.[0-9].[0-9][-.]*|4.[0-9]|4.[0-9].[0-9]|4.[0-9].[0-9][-.]*)
387
_cxx_major=`echo $cxx_version | cut -d '.' -f 1`
388
_cxx_minor=`echo $cxx_version | cut -d '.' -f 2`
389
cxx_version="$cxx_version, ok"
392
# whacky beos version strings
393
2.9-beos-991026*|2.9-beos-000224*)
396
cxx_version="$cxx_version, ok"
407
cxx_version="$cxx_version, bad"
414
484
if test "$cxx_verc_fail" = yes ; then
416
486
echo "The version of your compiler is not supported at this time"
417
487
echo "Please ensure you are using GCC 2.95.x or GCC 3.x"
422
492
# Do CXXFLAGS now we know the compiler version
425
if test "$_cxx_major" -ge "3" ; then
427
_make_def_HAVE_GCC3='HAVE_GCC3 = 1'
430
495
if test -n "$_host"; then
431
496
# Cross-compiling mode - add your target here if needed