X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=m4%2Fax_prog_flex_version.m4;h=6a9bfbe4c86ae9c9f4db157f0afb68ac9bc2d775;hb=7144b5acc3ecac81b0d497b51a864d59a4cca72c;hp=f1ad9ef60cf70cb9b754ff93e797c5748d0adfb3;hpb=33bdeb6a99f5e210dcc8fd4a987508afb059d749;p=babeltrace.git diff --git a/m4/ax_prog_flex_version.m4 b/m4/ax_prog_flex_version.m4 index f1ad9ef6..6a9bfbe4 100644 --- a/m4/ax_prog_flex_version.m4 +++ b/m4/ax_prog_flex_version.m4 @@ -1,46 +1,59 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_prog_flex_version.html +# =========================================================================== +# # SYNOPSIS # # AX_PROG_FLEX_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE]) # # DESCRIPTION # -# Makes sure that flex 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 $FLEX is not set (for example -# by running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail. +# Makes sure that flex 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 $LEX is not +# set (for example by running AC_PROG_LEX or AC_PATH_PROG) the macro +# will fail. # # Example: # -# AC_PATH_PROG([FLEX],[flex]) +# AC_PROG_LEX # AX_PROG_FLEX_VERSION([2.5.39],[ ... ],[ ... ]) # -# This will check to make sure that the flex you have is at least -# version 2.5.39 or greater. +# This will check to make sure that the flex you have is at least version +# 2.5.39 or greater. # -# NOTE: This macro uses the $FLEX variable to perform the check. +# NOTE: This macro uses the $LEX variable to perform the check, if it's +# empty it will failover to the $FLEX 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 1 +#serial 3 AC_DEFUN([AX_PROG_FLEX_VERSION],[ AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_GREP]) - AS_IF([test -n "$FLEX"],[ + AS_IF([test -z "$LEX"],[ + AS_IF([test -n "$FLEX"],[ + LEX=$FLEX + ]) + ]) + + AS_IF([test -n "$LEX"],[ ax_flex_version="$1" AC_MSG_CHECKING([for flex version]) changequote(<<,>>) - flex_version=`$FLEX --version 2>&1 \ + flex_version=`$LEX --version 2>&1 \ | $SED -n -e '/flex /b inspect b : inspect