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