1 # ===========================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_prog_bison.html
3 # ===========================================================================
7 # AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE)
11 # Check whether bison is the parser generator. Run ACTION-IF-TRUE if
12 # successful, ACTION-IF-FALSE otherwise
16 # Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
17 # Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com>
19 # This program is free software; you can redistribute it and/or modify it
20 # under the terms of the GNU General Public License as published by the
21 # Free Software Foundation; either version 2 of the License, or (at your
22 # option) any later version.
24 # This program is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
27 # Public License for more details.
29 # You should have received a copy of the GNU General Public License along
30 # with this program. If not, see <http://www.gnu.org/licenses/>.
32 # As a special exception, the respective Autoconf Macro's copyright owner
33 # gives unlimited permission to copy, distribute and modify the configure
34 # scripts that are the output of Autoconf when processing the Macro. You
35 # need not follow the terms of the GNU General Public License when using
36 # or distributing such scripts, even though portions of the text of the
37 # Macro appear in them. The GNU General Public License (GPL) does govern
38 # all other use of the material that constitutes the Autoconf Macro.
40 # This special exception to the GPL applies to versions of the Autoconf
41 # Macro released by the Autoconf Archive. When you make and distribute a
42 # modified version of the Autoconf Macro, you may extend this special
43 # exception to the GPL to apply to your modified version as well.
48 # Modified YACC assignment to remove -o y.tab.c since we're writing
49 # our own .y/.yy rules.
51 # Replaced m4_ifnblank(...) with m4_ifval(m4_normalize(...), ...)
52 # since m4_ifnblank requires autoconf-2.64.
54 AC_DEFUN([AX_PROG_BISON], [
55 AC_REQUIRE([AC_PROG_YACC])
56 AC_REQUIRE([AC_PROG_EGREP])
58 AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[
59 AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
60 [ax_cv_prog_bison=yes], [ax_cv_prog_bison=no])
62 AS_IF([test "$ax_cv_prog_bison" = "yes"], [
63 dnl replace the yacc-compatible compiler with the real bison, as
64 dnl otherwise autoconf limits us to the POSIX yacc.
65 dnl We also change the generated filename to the old one, so that
66 dnl automake's ylwrap can deal with it.
68 ] m4_ifval(m4_normalize([$1]), [[$1]]),
69 m4_ifval(m4_normalize([$2]), [[$2]])