Fix a bunch of compiler warnings (mainly MinGW).
[platform/upstream/flac.git] / m4 / gcc_version.m4
index a643ef2..1c53086 100644 (file)
@@ -2,6 +2,7 @@ dnl @synopsis XIPH_GCC_VERSION
 dnl
 dnl Find the version of gcc.
 dnl @version 1.0       Nov 05 2007
+dnl @version 1.1       Mar 10 2013
 dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
 dnl
 dnl Permission to use, copy, modify, distribute, and sell this file for any
@@ -19,10 +20,8 @@ if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then
        GCC_VERSION=`$CC -dumpversion`
        AC_MSG_RESULT($GCC_VERSION)
 
-       changequote(,)dnl
-       GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"`
-       GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/$GCC_MAJOR_VERSION\.//" | sed "s/\..*//"`
-       changequote([,])dnl
+       GCC_MAJOR_VERSION=`echo $GCC_VERSION | cut -d. -f 1`
+       GCC_MINOR_VERSION=`echo $GCC_VERSION | cut -d. -f 2`
        fi
 
 AC_SUBST(GCC_VERSION)
@@ -30,4 +29,3 @@ AC_SUBST(GCC_MAJOR_VERSION)
 AC_SUBST(GCC_MINOR_VERSION)
 
 ])# XIPH_GCC_VERSION
-