From 37f10aaf8519c78fb8454a269c6d7d89e4733690 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 21 Jan 2022 22:25:36 -0600 Subject: [PATCH] cf: Restore AC_KRB_PROG_YACC to life Using `AC_PROG_YACC` means accepting that `bison` gets invoked in yacc compatibility mode (i.e., with the `-y` command-line option). In recent versions Bison has started to warn about use of Bison extensions when in yacc compatibility mode -- even for things yacc itself accepts but which it doesn't document. I've confirmed that `bison -d` and `byacc -d` both work for the ASN.1 compiler. --- cf/krb-prog-yacc.m4 | 12 +++++++++--- configure.ac | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cf/krb-prog-yacc.m4 b/cf/krb-prog-yacc.m4 index 380412ec7..4c0afd9b7 100644 --- a/cf/krb-prog-yacc.m4 +++ b/cf/krb-prog-yacc.m4 @@ -1,12 +1,18 @@ dnl $Id$ dnl dnl -dnl We prefer byacc or yacc because they do not use `alloca' +dnl OLD: We prefer byacc or yacc because they do not use `alloca' +dnl +dnl CURRENT: We don't mind `alloca', but we do mind `bison -y' because +dnl newer versions of `bison', with `-y' complain about %expect and +dnl anything that yacc didn't document. Because `bison' typically +dnl also installs a `yacc' link that acts like `bison y', we put +dnl `yacc' last in this list. dnl AC_DEFUN([AC_KRB_PROG_YACC], -[AC_CHECK_PROGS(YACC, byacc yacc 'bison -y') +[AC_CHECK_PROGS(YACC, 'bison -d' 'byacc -d' yacc) if test "$YACC" = ""; then - AC_MSG_WARN([yacc not found - some stuff will not build]) + AC_MSG_WARN([byacc and bison not found - some stuff will not build]) fi ]) diff --git a/configure.ac b/configure.ac index 8c4a6e2c3..6c0e50c86 100644 --- a/configure.ac +++ b/configure.ac @@ -59,8 +59,8 @@ if ! test -f "$srcdir/lib/asn1/der-protos.h" || AC_KRB_PERL_MOD(JSON) fi -dnl AC_KRB_PROG_YACC -AC_PROG_YACC +AC_KRB_PROG_YACC +dnl AC_PROG_YACC AM_PROG_LEX AS_IF([$LEX --nounput -V > /dev/null 2>&1 && test $? -eq 0], [AC_SUBST([FLEXNOUNPUTARGS], ["--nounput"])],