Skip to content
Myr

ax_prog_bison_version.m4

This file

Path

m4/ax_prog_bison_version.m4

68 lines · 2.0 KiB

Last changed by

Not known.

History of this file

Take it

1# ===========================================================================2#   Modified from3#   http://www.gnu.org/software/autoconf-archive/ax_prog_perl_version.html4# ===========================================================================5#6# SYNOPSIS7#8#   AX_PROG_BISON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])9#10# DESCRIPTION11#12#   Makes sure that bison supports the version indicated. If true the shell13#   commands in ACTION-IF-TRUE are executed. If not the shell commands in14#   ACTION-IF-FALSE are run. Note if $PERL is not set the macro will fail.15#16#   Example:17#18#     AC_PROG_YACC19#     AX_PROG_BISON_VERSION([3.0.0],[ ... ],[ ... ])20#21#   This will check to make sure that the bison you have supports at least22#   version 3.0.0.23#24#   NOTE: This macro uses the $YACC variable to perform the check.25#   AX_WITH_YACC can be used to set that variable prior to running this26#   macro. The $BISON_VERSION variable will be set with the detected27#   version.28#29# LICENSE30#31#   Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>32#33#   Copying and distribution of this file, with or without modification, are34#   permitted in any medium without royalty provided the copyright notice35#   and this notice are preserved. This file is offered as-is, without any36#   warranty.3738#serial 123940AC_DEFUN([AX_PROG_BISON_VERSION],[41    AC_REQUIRE([AC_PROG_SED])42    AC_REQUIRE([AC_PROG_GREP])4344    AS_IF([test -n "$YACC"],[45        ax_bison_version="$1"4647        AC_MSG_CHECKING([for bison version])48        changequote(<<,>>)49        bison_version=`$YACC --version 2>&1 \50          | $GREP bison \51          | $SED -e 's/^[^0-9]*//' -e 's/[^0-9]*$//'`52        changequote([,])53        AC_MSG_RESULT($bison_version)5455	AC_SUBST([BISON_VERSION],[$bison_version])5657        AX_COMPARE_VERSION([$ax_bison_version],[le],[$bison_version],[58	    :59            $260        ],[61	    :62            $363        ])64    ],[65        AC_MSG_WARN([could not find bison])66        $367    ])68])