Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 1 | dnl @synopsis XIPH_GCC_VERSION |
| 2 | dnl |
| 3 | dnl Find the version of gcc. |
| 4 | dnl @version 1.0 Nov 05 2007 |
Erik de Castro Lopo | 11efaa3 | 2013-03-10 12:30:49 +1100 | [diff] [blame] | 5 | dnl @version 1.1 Mar 10 2013 |
Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 6 | dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 7 | dnl |
| 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. |
| 13 | dnl |
| 14 | |
| 15 | AC_DEFUN([XIPH_GCC_VERSION], |
| 16 | [ |
| 17 | if 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 | |
Erik de Castro Lopo | 11efaa3 | 2013-03-10 12:30:49 +1100 | [diff] [blame] | 23 | GCC_MAJOR_VERSION=`echo $GCC_VERSION | cut -d. -f 1` |
| 24 | GCC_MINOR_VERSION=`echo $GCC_VERSION | cut -d. -f 2` |
sezero | d4a1b34 | 2019-10-08 20:25:55 +0300 | [diff] [blame] | 25 | else |
| 26 | GCC_MAJOR_VERSION=0 |
| 27 | GCC_MINOR_VERSION=0 |
Erik de Castro Lopo | caef93e | 2012-02-26 22:41:44 +1100 | [diff] [blame] | 28 | fi |
| 29 | |
| 30 | AC_SUBST(GCC_VERSION) |
| 31 | AC_SUBST(GCC_MAJOR_VERSION) |
| 32 | AC_SUBST(GCC_MINOR_VERSION) |
| 33 | |
| 34 | ])# XIPH_GCC_VERSION |