bison-patches
[Top][All Lists]
Advanced

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

Output directory


From: Akim Demaille
Subject: Output directory
Date: 18 Jun 2002 13:54:56 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

I have checked on the packages that require Bison (the other packages
are not affected, since they pass -y, in which case the behavior is
completely different), and they pass -o.  This includes CVS GCC, Bash
2.05a.

GCC was the most important, since it is my understanding that it does
not ship the output files.  As for hypothetical other packages that
might have depended on this feature, I suspect they all ship the
output files, so they are not affected on the user side.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * src/files.c (compute_base_names): When computing the output file
        names from the input file name, strip the directory part.

Index: NEWS
===================================================================
RCS file: /cvsroot/bison/bison/NEWS,v
retrieving revision 1.49
diff -u -u -r1.49 NEWS
--- NEWS 15 Jun 2002 18:23:12 -0000 1.49
+++ NEWS 18 Jun 2002 11:54:09 -0000
@@ -3,6 +3,11 @@
 
 Changes in version 1.49b:
 
+* Output Directory
+  When not in Yacc compatibility mode, when the output file was not
+  specified, runnning `bison foo/bar.y' created `foo/bar.c'.  It
+  now creates `bar.c'.
+
 * Undefined token
   The undefined token was systematically mapped to 2 which prevented
   the use of 2 from the user.  This is no longer the case.
Index: TODO
===================================================================
RCS file: /cvsroot/bison/bison/TODO,v
retrieving revision 1.68
diff -u -u -r1.68 TODO
--- TODO 17 Jun 2002 18:04:11 -0000 1.68
+++ TODO 18 Jun 2002 11:54:09 -0000
@@ -75,77 +75,6 @@
        PDP-10 ports :-) but they should probably be documented
        somewhere.
 
-* Output directory
-Akim:
-
-| I consider this to be a bug in bison:
-|
-| /tmp % mkdir src
-| /tmp % cp ~/src/bison/tests/calc.y src
-| /tmp % mkdir build && cd build
-| /tmp/build % bison ../src/calc.y
-| /tmp/build % cd ..
-| /tmp % ls -l build src
-| build:
-| total 0
-|
-| src:
-| total 32
-| -rw-r--r--    1 akim     lrde        27553 oct  2 16:31 calc.tab.c
-| -rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y
-|
-|
-| Would it be safe to change this behavior to something more reasonable?
-| Do you think some people depend upon this?
-
-Jim:
-
-Is it that behavior documented?
-If so, then it's probably not reasonable to change it.
-I've Cc'd the automake list, because some of automake's
-rules use bison through $(YACC) -- though I'll bet they
-all use it in yacc-compatible mode.
-
-Pavel:
-
-Hello, Jim and others!
-
-> Is it that behavior documented?
-> If so, then it's probably not reasonable to change it.
-> I've Cc'd the automake list, because some of automake's
-> rules use bison through $(YACC) -- though I'll bet they
-> all use it in yacc-compatible mode.
-
-Yes, Automake currently used bison in Automake-compatible mode, but it
-would be fair for Automake to switch to the native mode as long as the
-processed files are distributed and "missing" emulates bison.
-
-In any case, the makefiles should specify the output file explicitly
-instead of relying on weird defaults.
-
-> | src:
-> | total 32
-> | -rw-r--r--    1 akim     lrde        27553 oct  2 16:31 calc.tab.c
-> | -rw-r--r--    1 akim     lrde         3335 oct  2 16:31 calc.y
-
-This is not _that_ ugly as it seems - with Automake you want to put
-sources where they belong - to the source directory.
-
-> | This is not _that_ ugly as it seems - with Automake you want to put
-> | sources where they belong - to the source directory.
->
-> The difference source/build you are referring to is based on Automake
-> concepts.  They have no sense at all for tools such as bison or gcc
-> etc.  They have input and output.  I do not want them to try to grasp
-> source/build.  I want them to behave uniformly: output *here*.
-
-I realize that.
-
-It's unfortunate that the native mode of Bison behaves in a less uniform
-way than the yacc mode. I agree with your point. Bison maintainters may
-want to fix it along with the documentation.
-
-
 * Unit rules
 Maybe we could expand unit rules, i.e., transform
 
Index: src/files.c
===================================================================
RCS file: /cvsroot/bison/bison/src/files.c,v
retrieving revision 1.73
diff -u -u -r1.73 files.c
--- src/files.c 14 Jun 2002 17:36:24 -0000 1.73
+++ src/files.c 18 Jun 2002 11:54:09 -0000
@@ -384,11 +384,11 @@
       else
        {
          /* Otherwise, the short base name is computed from the input
-            grammar: `foo.yy' => `foo'.  */
+            grammar: `foo/bar.yy' => `bar'.  */
          filename_split (infile, &base, &tab, &ext);
          short_base_name =
-           xstrndup (infile,
-                     (strlen (infile) - (ext ? strlen (ext) : 0)));
+           xstrndup (base,
+                     (strlen (base) - (ext ? strlen (ext) : 0)));
        }
 
       /* In these cases, always append `.tab'. */



reply via email to

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