[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_PROG_YACC: use bison -o (was: [PATCH 0/6] api.value.type supp

From: Akim Demaille
Subject: AC_PROG_YACC: use bison -o (was: [PATCH 0/6] api.value.type support)
Date: Mon, 4 Mar 2013 18:48:41 +0100

Le 25 févr. 2013 à 14:26, Akim Demaille <address@hidden> a écrit :

> Actually I just found what could arguable called a bug in
> Bison:
>> $ ls f.y
>> f.y
>> $ bison -o -d -v f.y
>> $ ls y.*
>> y.output
> where I would have expected "".  Fortunately this
> is also what Automake/Autoconf expect.  So, if instead of -y
> Autoconf were using '-o', everybody would be happy.
> And then --yacc = '-Werror=yacc -o'.  I'd be happy
> to avoid making --fixed-output-file public again, it's
> useless.

Hi Autofolks,

The fact that Autoconf sets YACC to bison --yacc is troublesome,
as it emasculates the Bison down to a Yacc-calf (I wouldn't like
to be the vet performing the bollocksectomy of a Bison).

The appended patch addresses this concern by taking profit from
the aforementioned behavior.

FWIW, I have plenty of failures of the test suite on Mac OS 10.8.2.
They all look like:

> 25. testing autoupdating AU_ALIAS ...
> ../../../tests/ autoupdate 
> ../../../tests/ autoconf --force 
> ../../../tests/ /bin/sh -n configure
> stderr:
> ../../../tests/ ./configure $configure_options 
> --- /dev/null 2013-03-04 18:28:56.000000000 +0100
> +++ 
> /Users/akim/src/gnu/bison/submodules/autoconf/_build/48d-debug/tests/testsuite.dir/at-groups/25/stderr
>     2013-03-04 18:28:56.000000000 +0100
> @@ -0,0 +1,2 @@
> +rm: conftest.dSYM: is a directory
> +rm: conftest.dSYM: is a directory

(BTW, shouldn't the help notices such as the one for YACC
be converted to '' instead of `'?).

commit 63683577534eba689d05c0f4e392379c53e57549
Author: Akim Demaille <address@hidden>
Date:   Mon Mar 4 18:35:13 2013 +0100

    AC_PROG_YACC: don't force Bison to warn against its own features
    When invoked with -y/--yacc, Bison warns when its extensions over
    POSIX Yacc are used.  Yet many packages requiring GNU Bison use
    Autoconf/Automake's Yacc support, which passes -y to Bison.  It turns
    out that passing '-o' has exactly the desired effect:
    generating not only but also with -d and y.output with -v.
    * lib/autoconf/programs.m4 (AC_PROG_YACC): Use bison -o
    * NEWS, doc/autoconf.texi: Document this change.

diff --git a/NEWS b/NEWS
index 1780cb9..a429c7b 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,11 @@ GNU Autoconf NEWS - User visible changes.
 - AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 have been marked as obsolete.
   Applications should use AC_PROG_CC.
+- AC_PROG_YACC now uses 'bison -o' instead of 'bison -y'.  Both
+  properly generate '' and possibly '' and 'y.output', but
+  the latter also enable warnings for Bison extensions.  Add -Wyacc to
+  your YFLAGS to enable them.
 - AC_USE_SYSTEM_EXTENSIONS now enables more system extensions on HP-UX,
   MINIX 3, and OS X.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index bf4823d..ad22fc6 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -4219,7 +4219,7 @@ and is cached in the @code{ac_cv_path_SED} variable.
 @ovindex YACC
 @caindex prog_YACC
 If @code{bison} is found, set output variable @code{YACC} to @samp{bison
--y}.  Otherwise, if @code{byacc} is found, set @code{YACC} to
+-o}.  Otherwise, if @code{byacc} is found, set @code{YACC} to
 @samp{byacc}.  Otherwise set @code{YACC} to @samp{yacc}.
 The result of this test can be influenced by setting the variable
 @code{YACC} or the cache variable @code{ac_cv_prog_YACC}.
diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index f7af8b5..2057e78 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -892,10 +892,10 @@ AN_PROGRAM([yacc],  [AC_PROG_YACC])
-[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)dnl
+[AC_CHECK_PROGS(YACC, 'bison -o' byacc, yacc)dnl
 [The `Yet Another Compiler Compiler' implementation to use.  Defaults to
-the first program found out of: `bison -y', `byacc', `yacc'.])dnl
+the first program found out of: `bison -o', `byacc', `yacc'.])dnl
 [The list of arguments that will be passed by default to $YACC.  This script
 will default YFLAGS to the empty string to avoid a default value of `-d' given

reply via email to

[Prev in Thread] Current Thread [Next in Thread]