Home | History | Annotate | Line # | Download | only in m4
ax_gcc_version.m4 revision 1.1.1.1
      1  1.1  mrg # ===========================================================================
      2  1.1  mrg #      http://www.gnu.org/software/autoconf-archive/ax_gcc_version.html
      3  1.1  mrg # ===========================================================================
      4  1.1  mrg #
      5  1.1  mrg # SYNOPSIS
      6  1.1  mrg #
      7  1.1  mrg #   AX_GCC_VERSION
      8  1.1  mrg #
      9  1.1  mrg # DESCRIPTION
     10  1.1  mrg #
     11  1.1  mrg #   This macro retrieves the gcc version and returns it in the GCC_VERSION
     12  1.1  mrg #   variable if available, an empty string otherwise.
     13  1.1  mrg #
     14  1.1  mrg # LICENSE
     15  1.1  mrg #
     16  1.1  mrg #   Copyright (c) 2009 Francesco Salvestrini <salvestrini (a] users.sourceforge.net>
     17  1.1  mrg #
     18  1.1  mrg #   This program is free software; you can redistribute it and/or modify it
     19  1.1  mrg #   under the terms of the GNU General Public License as published by the
     20  1.1  mrg #   Free Software Foundation; either version 2 of the License, or (at your
     21  1.1  mrg #   option) any later version.
     22  1.1  mrg #
     23  1.1  mrg #   This program is distributed in the hope that it will be useful, but
     24  1.1  mrg #   WITHOUT ANY WARRANTY; without even the implied warranty of
     25  1.1  mrg #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
     26  1.1  mrg #   Public License for more details.
     27  1.1  mrg #
     28  1.1  mrg #   You should have received a copy of the GNU General Public License along
     29  1.1  mrg #   with this program. If not, see <http://www.gnu.org/licenses/>.
     30  1.1  mrg #
     31  1.1  mrg #   As a special exception, the respective Autoconf Macro's copyright owner
     32  1.1  mrg #   gives unlimited permission to copy, distribute and modify the configure
     33  1.1  mrg #   scripts that are the output of Autoconf when processing the Macro. You
     34  1.1  mrg #   need not follow the terms of the GNU General Public License when using
     35  1.1  mrg #   or distributing such scripts, even though portions of the text of the
     36  1.1  mrg #   Macro appear in them. The GNU General Public License (GPL) does govern
     37  1.1  mrg #   all other use of the material that constitutes the Autoconf Macro.
     38  1.1  mrg #
     39  1.1  mrg #   This special exception to the GPL applies to versions of the Autoconf
     40  1.1  mrg #   Macro released by the Autoconf Archive. When you make and distribute a
     41  1.1  mrg #   modified version of the Autoconf Macro, you may extend this special
     42  1.1  mrg #   exception to the GPL to apply to your modified version as well.
     43  1.1  mrg 
     44  1.1  mrg #serial 7
     45  1.1  mrg 
     46  1.1  mrg AC_DEFUN([AX_GCC_VERSION], [
     47  1.1  mrg   GCC_VERSION=""
     48  1.1  mrg   AX_GCC_OPTION([-dumpversion],[],[],[
     49  1.1  mrg     ax_gcc_version_option=yes
     50  1.1  mrg   ],[
     51  1.1  mrg     ax_gcc_version_option=no
     52  1.1  mrg   ])
     53  1.1  mrg   AS_IF([test "x$GCC" = "xyes"],[
     54  1.1  mrg     AS_IF([test "x$ax_gcc_version_option" != "xno"],[
     55  1.1  mrg       AC_CACHE_CHECK([gcc version],[ax_cv_gcc_version],[
     56  1.1  mrg         ax_cv_gcc_version="`$CC -dumpversion`"
     57  1.1  mrg         AS_IF([test "x$ax_cv_gcc_version" = "x"],[
     58  1.1  mrg           ax_cv_gcc_version=""
     59  1.1  mrg         ])
     60  1.1  mrg       ])
     61  1.1  mrg       GCC_VERSION=$ax_cv_gcc_version
     62  1.1  mrg     ])
     63  1.1  mrg   ])
     64  1.1  mrg   AC_SUBST([GCC_VERSION])
     65  1.1  mrg ])
     66