1 dnl @synopsis XIPH_GCC_VERSION
3 dnl Find the version of gcc.
4 dnl @version 1.0 Nov 05 2007
5 dnl @version 1.1 Mar 10 2013
6 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
8 dnl Permission to use, copy, modify, distribute, and sell this file for any
9 dnl purpose is hereby granted without fee, provided that the above copyright
10 dnl and this permission notice appear in all copies. No representations are
11 dnl made about the suitability of this software for any purpose. It is
12 dnl provided "as is" without express or implied warranty.
15 AC_DEFUN([XIPH_GCC_VERSION],
17 if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then
19 AC_MSG_CHECKING([for version of $CC])
20 GCC_VERSION=`$CC -dumpversion`
21 AC_MSG_RESULT($GCC_VERSION)
23 GCC_MAJOR_VERSION=`echo $GCC_VERSION | cut -d. -f 1`
24 GCC_MINOR_VERSION=`echo $GCC_VERSION | cut -d. -f 2`
28 AC_SUBST(GCC_MAJOR_VERSION)
29 AC_SUBST(GCC_MINOR_VERSION)