> On 9 Apr 2018, at 20:15, Hans Åberg <haber...@telia.com> wrote:
>> On 9 Apr 2018, at 19:19, Frank Heckenbach <f.heckenb...@fh-soft.de> wrote:
>> Hans Åberg wrote:
>> You should apply the patch in /usr/share/bison (or your respective
>> Bison data directory), not in your build directory (where a stack.hh
>> exists, but is different, being generated from the stack.hh
>> template, so the patch fails; and location.cc won't exist, instead
>> position.hh and location.hh are generated from it).
>> So, try this:
>> cd /usr/share/bison
>> sudo patch < /path/to/extra-header-prefix.diff
>> cd /your/source/dir
>> rm -f stack.hh position.hh location.hh
>> make clean
>> make
> I wouldn't do that for two reasons: screwing up the installation, and 
> security reasons - one should do the changes while not root, and copy them to 
> the installation location.

One can though do:
$ cp -R /usr/local/share/bison/ data
$ cd data
$ patch < ../patch-c++.txt
patching file stack.hh
Hunk #1 succeeded at 129 (offset -1 lines).
Hunk #2 succeeded at 145 (offset -1 lines).
patching file location.cc
Hunk #1 succeeded at 290 (offset -4 lines).
Hunk #2 succeeded at 309 (offset -4 lines).
patching file lalr1.cc

Followed by (as root)
# cp c++17.m4 lalr1-c++17.cc stack-c++11.hh variant-c++17.hh 

But I get the same error as before:
$ make clean
rm -f calc-c++17-scanner.cc calc-c++17-parser.cc calc-c++17-parser.hh 
calc-c++17-position.hh calc-c++17-location.hh calc-c++17-stack.hh 
calc-c++17-scanner.o calc-c++17-parser.o calc-c++17-driver.o calc-c++17.o 
calc-c++17 input

$ ls
Makefile                calc-c++17-driver.hh    calc-c++17-scanner.ll   
calc-c++17.test         position.hh
calc-c++17-driver.cc    calc-c++17-parser.yy    calc-c++17.cc           
location.hh             test.txt

$ rm location.hh position.hh 

$ make
bison -Wall -o "calc-c++17-parser.cc" "calc-c++17-parser.yy"
flex -o "calc-c++17-scanner.cc" "calc-c++17-scanner.ll"
g++ --std=c++17   -c -o calc-c++17-scanner.o calc-c++17-scanner.cc
In file included from calc-c++17-driver.hh:5:0,
                 from calc-c++17-scanner.ll:6:
calc-c++17-parser.hh:61:11: fatal error: calc-c++17-location.hh: No such file 
or directory
 # include "calc-c++17-location.hh"
compilation terminated.
make: *** [calc-c++17-scanner.o] Error 1
rm calc-c++17-scanner.cc

Reply via email to