Remove part of last name to fit in a 80 character line
[lttng-tools.git] / m4 / ax_prog_bison_version.m4
CommitLineData
926c87ac 1# ===========================================================================
6333b87b 2# https://www.gnu.org/software/autoconf-archive/ax_prog_bison_version.html
926c87ac
JR
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_PROG_BISON_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
8#
9# DESCRIPTION
10#
11# Makes sure that bison version is greater or equal to the version
12# indicated. If true the shell commands in ACTION-IF-TRUE are executed. If
13# not the shell commands in commands in ACTION-IF-TRUE are executed. If
14# not the shell commands in ACTION-IF-FALSE are run. Note if $BISON is not
15# set (for example by running AC_CHECK_PROG or AC_PATH_PROG) the macro
16# will fail.
17#
18# Example:
19#
20# AC_PATH_PROG([BISON],[bison])
21# AX_PROG_BISON_VERSION([3.0.2],[ ... ],[ ... ])
22#
23# This will check to make sure that the bison you have is at least version
24# 3.0.2 or greater.
25#
26# NOTE: This macro uses the $BISON variable to perform the check.
27#
28# LICENSE
29#
4942c256 30# Copyright (c) 2015 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
926c87ac
JR
31#
32# Copying and distribution of this file, with or without modification, are
33# permitted in any medium without royalty provided the copyright notice
34# and this notice are preserved. This file is offered as-is, without any
35# warranty.
36
6333b87b 37#serial 3
926c87ac
JR
38
39AC_DEFUN([AX_PROG_BISON_VERSION],[
40 AC_REQUIRE([AC_PROG_SED])
41 AC_REQUIRE([AC_PROG_GREP])
42
43 AS_IF([test -n "$BISON"],[
44 ax_bison_version="$1"
45
46 AC_MSG_CHECKING([for bison version])
47 changequote(<<,>>)
48 bison_version=`$BISON --version 2>&1 \
49 | $SED -n -e '/bison (GNU Bison)/b inspect
50b
51: inspect
52s/.* (\{0,1\}\([0-9]*\.[0-9]*\.[0-9]*\))\{0,1\}.*/\1/;p'`
53 changequote([,])
54 AC_MSG_RESULT($bison_version)
55
56 AC_SUBST([BISON_VERSION],[$bison_version])
57
58 AX_COMPARE_VERSION([$bison_version],[ge],[$ax_bison_version],[
59 :
60 $2
61 ],[
62 :
63 $3
64 ])
65 ],[
66 AC_MSG_WARN([could not find bison])
67 $3
68 ])
69])
This page took 0.044731 seconds and 5 git commands to generate.