# HG changeset patch # User John W. Eaton # Date 1411239694 14400 # Node ID 2036e17079870803c229daf85a5de150fb87a358 # Parent 3ed674758e0d6321de82e46402e104771345c05e# Parent 203431f40cb2aca8cd9644631a90336b72ca9ccb maint: Periodic merge of stable to gui-release. diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -6d4e36653a40da6604507406f2a97e3e64bf9dbf gnulib-hg +8728cf80b7d84b0ac401debac5b37217aac0d2e2 gnulib-hg diff --git a/libinterp/parse-tree/module.mk b/libinterp/parse-tree/module.mk --- a/libinterp/parse-tree/module.mk +++ b/libinterp/parse-tree/module.mk @@ -87,8 +87,22 @@ parse-tree/oct-parse.yy: parse-tree/oct-parse.in.yy case "$(BISON_API_PREFIX_DECL_STYLE)" in \ - *api*) api_prefix_decl='%define api.prefix "octave_"'; ;; \ - *name*) api_prefix_decl='%name-prefix="octave_"'; ;; \ + *api*) \ + case "$(BISON_API_PREFIX_DECL_STYLE)" in \ + *brace*) \ + api_prefix_decl='%define api.prefix {octave_}'; ;; \ + *) \ + api_prefix_decl='%define api.prefix "octave_"'; ;; \ + esac; \ + ;; \ + *name*) \ + case "$(BISON_API_PREFIX_DECL_STYLE)" in \ + *brace*) \ + api_prefix_decl='%name-prefix {octave_}'; ;; \ + *) \ + api_prefix_decl='%name-prefix="octave_"'; ;; \ + esac; \ + ;; \ esac; \ case "$(BISON_PUSH_PULL_DECL_STYLE)" in \ *quote*) quote='"' ;; \ diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -1838,26 +1838,38 @@ AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration], [octave_cv_bison_api_prefix_decl_style], [ style="api name" + quote="quote brace" for s in $style; do - if test $s = "api"; then - def='%define api.prefix "foo_"' - else - def='%name-prefix="foo_"' - fi - cat << EOF > conftest.yy + for q in $quote; do + if test $s = "api"; then + if test $q = "quote"; then + def='%define api.prefix "foo_"' + else + def='%define api.prefix {foo_}' + fi + else + if test $q = "quote"; then + def='%name-prefix="foo_"' + else + def='%name-prefix {foo_}' + fi + fi + cat << EOF > conftest.yy $def %start input %% input:; %% EOF - $YACC conftest.yy > /dev/null 2>&1 - ac_status=$? - if test $ac_status -eq 0; then - octave_cv_bison_api_prefix_decl_style="$s" - break - fi - if test $ac_status -eq 0; then + ## Older versions of bison only warn and exit with success. + octave_bison_output=`$YACC conftest.yy 2>&1` + ac_status=$? + if test $ac_status -eq 0 && test -z "$octave_bison_output"; then + octave_cv_bison_api_prefix_decl_style="$s $q" + break + fi + done + if test -n "$octave_cv_bison_api_prefix_decl_style"; then break fi done @@ -1868,7 +1880,7 @@ AC_SUBST(BISON_API_PREFIX_DECL_STYLE, $octave_cv_bison_api_prefix_decl_style) if test -z "$octave_cv_bison_api_prefix_decl_style"; then - YACC= + tmp_have_bison=no warn_bison_api_prefix_decl_style=" I wasn't able to find a suitable style for declaring the api prefix @@ -1901,9 +1913,9 @@ input:; %% EOF - $YACC conftest.yy > /dev/null 2>&1 + octave_bison_output=`$YACC conftest.yy 2>&1` ac_status=$? - if test $ac_status -eq 0; then + if test $ac_status -eq 0 && test -z "$octave_bison_output"; then if test $q = noquote; then q= fi @@ -1911,7 +1923,7 @@ break fi done - if test $ac_status -eq 0; then + if test -n "$octave_cv_bison_push_pull_decl_style"; then break fi done @@ -1922,7 +1934,7 @@ AC_SUBST(BISON_PUSH_PULL_DECL_STYLE, $octave_cv_bison_push_pull_decl_style) if test -z "$octave_cv_bison_push_pull_decl_style"; then - YACC= + tmp_have_bison=no warn_bison_push_pull_decl_style=" I wasn't able to find a suitable style for declaring a push-pull @@ -1935,9 +1947,10 @@ YACC='$(top_srcdir)/build-aux/missing bison' warn_bison=" -I didn't find bison, but it's only a problem if you need to -reconstruct parse.cc, which is the case if you're building from VCS -sources. +I didn't find bison, or the version of bison that I found does not +support all the features that are required, but it's only a problem +if you need to reconstruct parse.cc, which is the case if you're +building from VCS sources. " OCTAVE_CONFIGURE_WARNING([warn_bison]) fi