X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=m4%2Fax_prog_bison_version.m4;h=5a8888dea2cc73fcf7cf1c871e448b2d140302d0;hb=540d833dfbe259815a0aec6a231dbe54a74aec4e;hp=6b95585560d160dc8e3435a1775596d8caad2424;hpb=2b4887a2a361c2eb166ab67c5c3ff9276a59bdf2;p=babeltrace.git diff --git a/m4/ax_prog_bison_version.m4 b/m4/ax_prog_bison_version.m4 index 6b955855..5a8888de 100644 --- a/m4/ax_prog_bison_version.m4 +++ b/m4/ax_prog_bison_version.m4 @@ -1,46 +1,59 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_bison_version.html +# =========================================================================== +# # SYNOPSIS # # AX_PROG_BISON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE]) # # DESCRIPTION # -# Makes sure that bison version is greater or equal to the version indicated. -# If true the shell commands in ACTION-IF-TRUE are executed. If not the shell -# commands in commands in ACTION-IF-TRUE are executed. If not the shell -# commands in ACTION-IF-FALSE are run. Note if $BISON is not set (for example -# by running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail. +# Makes sure that bison version is greater or equal to the version +# indicated. If true the shell commands in ACTION-IF-TRUE are executed. If +# not the shell commands in commands in ACTION-IF-TRUE are executed. If +# not the shell commands in ACTION-IF-FALSE are run. Note if $YACC is not +# set (for example by running AC_PROG_YACC or AC_PATH_PROG) the macro +# will fail. # # Example: # -# AC_PATH_PROG([BISON],[bison]) +# AC_PROG_YACC # AX_PROG_BISON_VERSION([3.0.2],[ ... ],[ ... ]) # -# This will check to make sure that the bison you have is at least -# version 3.0.2 or greater. +# This will check to make sure that the bison you have is at least version +# 3.0.2 or greater. # -# NOTE: This macro uses the $BISON variable to perform the check. +# NOTE: This macro uses the $YACC variable to perform the check, if it's +# empty it will failover to the $BISON variable for backwards compatibility. # # LICENSE # # Copyright (c) 2015 Jonathan Rajotte-Julien +# 2017 Michael Jeanson # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 12 +#serial 4 AC_DEFUN([AX_PROG_BISON_VERSION],[ AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_GREP]) - AS_IF([test -n "$BISON"],[ + AS_IF([test -z "$YACC"],[ + AS_IF([test -n "$BISON"],[ + YACC=$BISON + ]) + ]) + + AS_IF([test -n "$YACC"],[ ax_bison_version="$1" AC_MSG_CHECKING([for bison version]) changequote(<<,>>) - bison_version=`$BISON --version 2>&1 \ + bison_version=`$YACC --version 2>&1 \ | $SED -n -e '/bison (GNU Bison)/b inspect b : inspect