From 43c8792b6e589be023ca8009df8b417e801a7ebf Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Wed, 6 Jul 2005 05:25:05 +0000 Subject: [PATCH] Fix detection of GCC versions (J.P. Larocque) --- BasiliskII/src/Unix/configure.ac | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/BasiliskII/src/Unix/configure.ac b/BasiliskII/src/Unix/configure.ac index 57be4622..c4d0d1cf 100644 --- a/BasiliskII/src/Unix/configure.ac +++ b/BasiliskII/src/Unix/configure.ac @@ -1113,20 +1113,22 @@ AC_MSG_RESULT($HAVE_GAS) dnl Check for GCC 2.7 or higher. HAVE_GCC27=no AC_MSG_CHECKING(for GCC 2.7 or higher) -AC_EGREP_CPP(xyes, -[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 - xyes -#endif -], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) + # error gcc < 2.7 + #endif + ]])], + [AC_MSG_RESULT(yes); HAVE_GCC27=yes], + [AC_MSG_RESULT(no)]) dnl Check for GCC 3.0 or higher. HAVE_GCC30=no AC_MSG_CHECKING(for GCC 3.0 or higher) -AC_EGREP_CPP(xyes, -[#if __GNUC__ >= 3 - xyes -#endif -], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) + # error gcc < 3 + #endif + ]])], + [AC_MSG_RESULT(yes); HAVE_GCC30=yes], + [AC_MSG_RESULT(no)]) dnl Check for ICC. AC_MSG_CHECKING(for ICC)