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