1 dnl @synopsis AX_GCC_VERSION(MAJOR, MINOR, PATCHLEVEL, [ACTION-SUCCESS], [ACTION-FAILURE])
2 dnl @summary check wither gcc is at least version MAJOR.MINOR.PATCHLEVEL
3 dnl @category InstalledPackages
5 dnl Check whether we are using gcc and, if so, whether its version
6 dnl is at least MAJOR.MINOR.PATCHLEVEL
8 dnl ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11 dnl @version 2005-05-30
12 dnl @license GPLWithACException
13 dnl @author Steven G. Johnson <stevenj@alum.mit.edu> and Matteo Frigo.
14 AC_DEFUN([AX_GCC_VERSION],
16 AC_REQUIRE([AC_PROG_CC])
17 AC_CACHE_CHECK(whether we are using gcc $1.$2.$3 or later, ax_cv_gcc_$1_$2_$3,
20 if test "$GCC" = "yes"; then
21 dnl The semicolon after "yes" below is to pacify NeXT's syntax-checking cpp.
24 # if (__GNUC__ > $1) || (__GNUC__ == $1 && __GNUC_MINOR__ > $2) \
25 || (__GNUC__ == $1 && __GNUC_MINOR__ == $2 && __GNUC_PATCHLEVEL__ >= $3)
29 ], [ax_cv_gcc_$1_$2_$3=yes])
32 if test "$ax_cv_gcc_$1_$2_$3" = yes; then