Re: [Bug-gnulib] AC_PROG_YACC

Bruno Haible <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs,gmane.comp.version-control.cvs.bugs,gmane.comp.lib.gnulib.bugs
Message-ID <[email protected]>
Mark D. Baushke wrote:
> I will also note that the current getdate.y assumes that a bison 1.35 or
> more recent is available.

OK, can we then replace gnulib's bison macro with the following:

AC_DEFUN([gl_BISON],
[
  # getdate.y works with bison only (because it uses bison specific features)
  # and actually requires bison >= 1.26.
  # bison is only needed for the maintainer (who touches getdate.y). But in
  # order to avoid separate Makefiles or --enable-maintainer-mode, we put
  # the rule in general Makefile. Now, some people carelessly touch the
  # files or have a broken "make" program, hence the getdate.c rule will
  # sometimes fire. To avoid an error, define GL_BISON to ":" if it is not
  # present or too old.
  AC_CHECK_PROGS([GL_BISON], [bison])
  if test -z "$GL_BISON"; then
    ac_verc_fail=yes
  else
    dnl Found it, now check the version.
    AC_MSG_CHECKING([version of bison])
changequote(<<,>>)dnl
    ac_prog_version=`$GL_BISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
    case $ac_prog_version in
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
changequote([,])dnl
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
    esac
    AC_MSG_RESULT([$ac_prog_version])
  fi
  if test $ac_verc_fail = yes; then
    GL_BISON=:
  fi
  YACC="$GL_BISON -y"
  AC_SUBST(YACC)
])

Bruno
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.