comparison m4/acinclude.m4 @ 18974:d8abf813c69f stable

handle changes in bison 3.x * acinclude.m4 (OCTAVE_PROG_BISON): Also check for the proper way to declare api.prefix. * build-aux/common.mk (BISON_API_PREFIX_DECL_STYLE): New variable. * lex.ll: Conditionally define YYSTYPE. * oct-parse.in.yy (%API_PREFIX_DECL%): Allow for differences in the way api.prefix is specified in different versions of bison. * libinterp/parse-tree/module.mk (parse-tree/oct-parse.yy): Also substitute %API_PREFIX_DECL% in lex.ll.
author John W. Eaton <jwe@octave.org>
date Fri, 01 Aug 2014 08:09:02 -0400
parents 625e3bb65885
children c59745865c7f
comparison
equal deleted inserted replaced
18973:625e3bb65885 18974:d8abf813c69f
1758 1758
1759 case "`$YACC --version`" in 1759 case "`$YACC --version`" in
1760 *bison*) tmp_have_bison=yes ;; 1760 *bison*) tmp_have_bison=yes ;;
1761 *) tmp_have_bison=no ;; 1761 *) tmp_have_bison=no ;;
1762 esac 1762 esac
1763
1764 if test $tmp_have_bison = yes; then
1765 AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration],
1766 [octave_cv_bison_api_prefix_decl_style], [
1767 style="api name"
1768 for s in $style; do
1769 if test $s = "api"; then
1770 def='%define api.prefix "foo_"'
1771 else
1772 def='%name-prefix="foo_"'
1773 fi
1774 cat << EOF > conftest.yy
1775 $def
1776 %start input
1777 %%
1778 input:;
1779 %%
1780 EOF
1781 $YACC conftest.yy > /dev/null 2>&1
1782 ac_status=$?
1783 if test $ac_status -eq 0; then
1784 octave_cv_bison_api_prefix_decl_style="$s"
1785 break
1786 fi
1787 if test $ac_status -eq 0; then
1788 break
1789 fi
1790 done
1791 rm -f conftest.yy y.tab.h y.tab.c
1792 ])
1793 fi
1794
1795 AC_SUBST(BISON_API_PREFIX_DECL_STYLE, $octave_cv_bison_api_prefix_decl_style)
1796
1797 if test -z "$octave_cv_bison_api_prefix_decl_style"; then
1798 YACC=
1799 warn_bison_api_prefix_decl_style="
1800
1801 I wasn't able to find a suitable style for declaring the api prefix
1802 in a bison input file so I'm disabling bison.
1803 "
1804 OCTAVE_CONFIGURE_WARNING([warn_bison_api_prefix_decl_style])
1805 fi
1763 1806
1764 if test $tmp_have_bison = yes; then 1807 if test $tmp_have_bison = yes; then
1765 AC_CACHE_CHECK([syntax of bison push/pull declaration], 1808 AC_CACHE_CHECK([syntax of bison push/pull declaration],
1766 [octave_cv_bison_push_pull_decl_style], [ 1809 [octave_cv_bison_push_pull_decl_style], [
1767 style="dash underscore" 1810 style="dash underscore"