gcc_version.m4 993 B

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