Mercurial > octave
comparison m4/acinclude.m4 @ 26672:df42ea23502f stable
build: support GNU bison 3.3, silence POSIX compatibility warning (bug #55613)
* acinclude.m4 (OCTAVE_PROG_BISON): Define WARN_YFLAGS to include options to
silence POSIX compatibility warnings from GNU bison. Use it when testing for
required syntax support.
* Makefile.am (AM_YFLAGS): Include ${WARN_YFLAGS} in the list of options.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Thu, 31 Jan 2019 21:35:04 -0800 |
parents | 3e6d559c8756 |
children | 4af9840f9ce5 |
comparison
equal
deleted
inserted
replaced
26670:c3c657ba1e97 | 26672:df42ea23502f |
---|---|
3178 dnl | 3178 dnl |
3179 dnl Check for bison. | 3179 dnl Check for bison. |
3180 dnl | 3180 dnl |
3181 AC_DEFUN([OCTAVE_PROG_BISON], [ | 3181 AC_DEFUN([OCTAVE_PROG_BISON], [ |
3182 AC_PROG_YACC | 3182 AC_PROG_YACC |
3183 WARN_YFLAGS= | |
3183 | 3184 |
3184 case "`$YACC --version`" in | 3185 case "`$YACC --version`" in |
3185 *bison*) tmp_have_bison=yes ;; | 3186 *bison*) tmp_have_bison=yes ;; |
3186 *) tmp_have_bison=no ;; | 3187 *) tmp_have_bison=no ;; |
3187 esac | 3188 esac |
3188 | 3189 |
3189 if test $tmp_have_bison = yes; then | 3190 if test $tmp_have_bison = yes; then |
3191 dnl FIXME: Call GNU bison with the `-Wno-yacc` option, which works with | |
3192 dnl bison 2.5 and all later versions, as recommended by the bison NEWS. | |
3193 dnl This is needed as long as Octave supports Autoconf version 2.69 or | |
3194 dnl older. In Autoconf 2.70, AC_PROG_YACC no longer adds the `-y` | |
3195 dnl option to emulate POSIX yacc. | |
3196 WARN_YFLAGS="-Wno-yacc" | |
3197 | |
3190 AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration], | 3198 AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration], |
3191 [octave_cv_bison_api_prefix_decl_style], [ | 3199 [octave_cv_bison_api_prefix_decl_style], [ |
3192 style="api name" | 3200 style="api name" |
3193 quote="quote brace" | 3201 quote="quote brace" |
3194 for s in $style; do | 3202 for s in $style; do |
3212 %% | 3220 %% |
3213 input:; | 3221 input:; |
3214 %% | 3222 %% |
3215 EOF | 3223 EOF |
3216 ## Older versions of bison only warn and exit with success. | 3224 ## Older versions of bison only warn and exit with success. |
3217 octave_bison_output=`$YACC conftest.yy 2>&1` | 3225 octave_bison_output=`$YACC $WARN_YFLAGS conftest.yy 2>&1` |
3218 ac_status=$? | 3226 ac_status=$? |
3219 if test $ac_status -eq 0 && test -z "$octave_bison_output"; then | 3227 if test $ac_status -eq 0 && test -z "$octave_bison_output"; then |
3220 octave_cv_bison_api_prefix_decl_style="$s $q" | 3228 octave_cv_bison_api_prefix_decl_style="$s $q" |
3221 break | 3229 break |
3222 fi | 3230 fi |
3250 if you need to reconstruct parse.cc, which is the case if you're | 3258 if you need to reconstruct parse.cc, which is the case if you're |
3251 building from VCS sources. | 3259 building from VCS sources. |
3252 " | 3260 " |
3253 OCTAVE_CONFIGURE_WARNING([warn_bison]) | 3261 OCTAVE_CONFIGURE_WARNING([warn_bison]) |
3254 fi | 3262 fi |
3263 AC_SUBST(WARN_YFLAGS) | |
3255 ]) | 3264 ]) |
3256 dnl | 3265 dnl |
3257 dnl Find find program. | 3266 dnl Find find program. |
3258 dnl | 3267 dnl |
3259 ## Prefer GNU find if found. | 3268 ## Prefer GNU find if found. |