1# Version 2.96 of gcc (shipped with RedHat Linux 7.[01] and Mandrake) had
2# serious problems.
3AC_DEFUN(AC_GCC_CONFIG1, [
4AC_CACHE_CHECK([whether we are using gcc version 2.96],
5db_cv_gcc_2_96, [
6db_cv_gcc_2_96=no
7if test "$GCC" = "yes"; then
8	GCC_VERSION=`${MAKEFILE_CC} --version`
9	case ${GCC_VERSION} in
10	2.96*)
11		db_cv_gcc_2_96=yes;;
12	esac
13fi])
14if test "$db_cv_gcc_2_96" = "yes"; then
15	CFLAGS=`echo "$CFLAGS" | sed 's/-O2/-O/'`
16	CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2/-O/'`
17	AC_MSG_WARN([INSTALLED GCC COMPILER HAS SERIOUS BUGS; PLEASE UPGRADE.])
18	AC_MSG_WARN([GCC OPTIMIZATION LEVEL SET TO -O.])
19fi])
20
21# Versions of g++ up to 2.8.0 required -fhandle-exceptions, but it is
22# renamed as -fexceptions and is the default in versions 2.8.0 and after.
23AC_DEFUN(AC_GCC_CONFIG2, [
24AC_CACHE_CHECK([whether g++ requires -fhandle-exceptions],
25db_cv_gxx_except, [
26db_cv_gxx_except=no;
27if test "$GXX" = "yes"; then
28	GXX_VERSION=`${MAKEFILE_CXX} --version`
29	case ${GXX_VERSION} in
30	1.*|2.[[01234567]].*|*-1.*|*-2.[[01234567]].*)
31		db_cv_gxx_except=yes;;
32	esac
33fi])
34if test "$db_cv_gxx_except" = "yes"; then
35	CXXFLAGS="$CXXFLAGS -fhandle-exceptions"
36fi])
37