Chris@40: dnl @synopsis MN_GCC_VERSION Chris@40: dnl Chris@40: dnl Find the version of gcc. Chris@40: dnl @version 1.0 Nov 05 2007 Chris@40: dnl @author Erik de Castro Lopo Chris@40: dnl Chris@40: dnl Permission to use, copy, modify, distribute, and sell this file for any Chris@40: dnl purpose is hereby granted without fee, provided that the above copyright Chris@40: dnl and this permission notice appear in all copies. No representations are Chris@40: dnl made about the suitability of this software for any purpose. It is Chris@40: dnl provided "as is" without express or implied warranty. Chris@40: dnl Chris@40: Chris@40: AC_DEFUN([MN_GCC_VERSION], Chris@40: [ Chris@40: if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then Chris@40: Chris@40: AC_MSG_CHECKING([for version of $CC]) Chris@40: GCC_VERSION=`$CC -dumpversion` Chris@40: AC_MSG_RESULT($GCC_VERSION) Chris@40: Chris@40: changequote(,)dnl Chris@40: GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"` Chris@40: GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/$GCC_MAJOR_VERSION\.//" | sed "s/\..*//"` Chris@40: changequote([,])dnl Chris@40: fi Chris@40: Chris@40: AC_SUBST(GCC_VERSION) Chris@40: AC_SUBST(GCC_MAJOR_VERSION) Chris@40: AC_SUBST(GCC_MINOR_VERSION) Chris@40: Chris@40: ])# MN_GCC_VERSION Chris@40: