Package: octave / 4.4.1-5

bison-3.3.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Description: support GNU bison 3.3, silence POSIX compatibility warning
 Adapted from upstream commit to include WARN_YFLAGS in second bison test.
Author: Mike Miller <mtmiller@debian.org>
Origin: upstream, https://hg.savannah.gnu.org/hgweb/octave/rev/df42ea23502f
Bug: https://savannah.gnu.org/bugs/?55613
Bug-Debian: https://bugs.debian.org/923442
Last-Update: 2019-02-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,7 +37,7 @@
 
 AM_LFLAGS = @LFLAGS@
 
-AM_YFLAGS = -dv
+AM_YFLAGS = -dv ${WARN_YFLAGS}
 
 # Fortran compiler flags.
 
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -3134,6 +3134,7 @@
 dnl
 AC_DEFUN([OCTAVE_PROG_BISON], [
   AC_PROG_YACC
+  WARN_YFLAGS=
 
   case "`$YACC --version`" in
     *bison*) tmp_have_bison=yes ;;
@@ -3141,6 +3142,13 @@
   esac
 
   if test $tmp_have_bison = yes; then
+    dnl FIXME: Call GNU bison with the `-Wno-yacc` option, which works with
+    dnl bison 2.5 and all later versions, as recommended by the bison NEWS.
+    dnl This is needed as long as Octave supports Autoconf version 2.69 or
+    dnl older.  In Autoconf 2.70, AC_PROG_YACC no longer adds the `-y`
+    dnl option to emulate POSIX yacc.
+    WARN_YFLAGS="-Wno-yacc"
+
     AC_CACHE_CHECK([syntax of bison api.prefix (or name-prefix) declaration],
                    [octave_cv_bison_api_prefix_decl_style], [
       style="api name"
@@ -3168,7 +3176,7 @@
 %%
 EOF
           ## Older versions of bison only warn and exit with success.
-          octave_bison_output=`$YACC conftest.yy 2>&1`
+          octave_bison_output=`$YACC $WARN_YFLAGS 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"
@@ -3219,7 +3227,7 @@
 input:;
 %%
 EOF
-          octave_bison_output=`$YACC conftest.yy 2>&1`
+          octave_bison_output=`$YACC $WARN_YFLAGS conftest.yy 2>&1`
           ac_status=$?
           if test $ac_status -eq 0 && test -z "$octave_bison_output"; then
             if test $q = noquote; then
@@ -3260,6 +3268,7 @@
 "
     OCTAVE_CONFIGURE_WARNING([warn_bison])
   fi
+  AC_SUBST(WARN_YFLAGS)
 ])
 dnl
 dnl Find find program.