blob: d1bae6ad5ed9be6c72ea3f75403a0588808371df [file] [log] [blame]
Erik de Castro Lopocaef93e2012-02-26 22:41:44 +11001dnl @synopsis XIPH_GCC_VERSION
2dnl
3dnl Find the version of gcc.
4dnl @version 1.0 Nov 05 2007
5dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
6dnl
7dnl Permission to use, copy, modify, distribute, and sell this file for any
8dnl purpose is hereby granted without fee, provided that the above copyright
9dnl and this permission notice appear in all copies. No representations are
10dnl made about the suitability of this software for any purpose. It is
11dnl provided "as is" without express or implied warranty.
12dnl
13
14AC_DEFUN([XIPH_GCC_VERSION],
15[
16if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then
17
18 AC_MSG_CHECKING([for version of $CC])
19 GCC_VERSION=`$CC -dumpversion`
20 AC_MSG_RESULT($GCC_VERSION)
21
22 changequote(,)dnl
23 GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/^[0-9]\+\.//" | sed "s/\..*//"`
24 GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"`
25 changequote([,])dnl
26 fi
27
28AC_SUBST(GCC_VERSION)
29AC_SUBST(GCC_MAJOR_VERSION)
30AC_SUBST(GCC_MINOR_VERSION)
31
32])# XIPH_GCC_VERSION
33