1 dnl @synopsis MN_GCC_VERSION
3 dnl Find the version of gcc.
4 dnl @version 1.0 Nov 05 2007
5 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
7 dnl Permission to use, copy, modify, distribute, and sell this file for any
8 dnl purpose is hereby granted without fee, provided that the above copyright
9 dnl and this permission notice appear in all copies. No representations are
10 dnl made about the suitability of this software for any purpose. It is
11 dnl provided "as is" without express or implied warranty.
14 AC_DEFUN([MN_GCC_VERSION],
16 if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then
18 AC_MSG_CHECKING([for version of $CC])
19 GCC_VERSION=`$CC -dumpversion`
20 AC_MSG_RESULT($GCC_VERSION)
23 GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/^[0-9]\+\.//" | sed "s/\..*//"`
24 GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"`
29 AC_SUBST(GCC_MAJOR_VERSION)
30 AC_SUBST(GCC_MINOR_VERSION)