1dnl 2dnl Check Bison version 3dnl AC_PROG_BISON([MIN_VERSION=2.4]) 4dnl 5dnl Will define BISON_USE_PARSER_H_EXTENSION if Automake is < 1.11 6dnl for use with .h includes. 7dnl 8 9AC_DEFUN([AC_PROG_BISON], [ 10if test "x$1" = "x" ; then 11 bison_required_version="2.4" 12else 13 bison_required_version="$1" 14fi 15 16AC_CHECK_PROG(have_prog_bison, [bison], [yes],[no]) 17 18AC_DEFINE_UNQUOTED([BISON_VERSION], [0.0], [Bison version if bison is not available]) 19 20#Do not use *.h extension for parser header files, use newer *.hh 21bison_use_parser_h_extension=false 22 23if test "$have_prog_bison" = "yes" ; then 24 AC_MSG_CHECKING([for bison version >= $bison_required_version]) 25 bison_version=`bison --version | head -n 1 | cut '-d ' -f 4` 26 AC_DEFINE_UNQUOTED([BISON_VERSION], [$bison_version], [Defines bison version]) 27 if test "$bison_version" \< "$bison_required_version" ; then 28 BISON=: 29 AC_MSG_RESULT([no]) 30 AC_MSG_ERROR([Bison version $bison_required_version or higher must be installed on the system!]) 31 else 32 AC_MSG_RESULT([yes]) 33 BISON=bison 34 AC_SUBST(BISON) 35 36 #Verify automake version 1.11 headers for yy files are .h, > 1.12 uses .hh 37 automake_version=`automake --version | head -n 1 | cut '-d ' -f 4` 38 AC_DEFINE_UNQUOTED([AUTOMAKE_VERSION], [$automake_version], [Defines automake version]) 39 40 if test "$automake_version" \< "1.12" ; then 41 #Use *.h extension for parser header file 42 bison_use_parser_h_extension=true 43 echo "Automake version < 1.12" 44 AC_DEFINE([BISON_USE_PARSER_H_EXTENSION], [1], [Use *.h extension for parser header file]) 45 fi 46 fi 47else 48 BISON=: 49 AC_MSG_RESULT([NO]) 50fi 51 52AM_CONDITIONAL([BISON_USE_PARSER_H_EXTENSION], [test x$bison_use_parser_h_extension = xtrue]) 53AC_SUBST(BISON) 54]) 55