xref: /OK3568_Linux_fs/yocto/meta-qt5/recipes-qt/qt5/qtwebkit/0005-Fix-build-with-bison37.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom d92b11fea65364fefa700249bd3340e0cd4c5b31 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Dmitry Shachnev <mitya57@gmail.com>
3*4882a593SmuzhiyunDate: Tue, 4 Aug 2020 21:04:06 +0300
4*4882a593SmuzhiyunSubject: [PATCH] Let Bison generate the header directly, to fix build with
5*4882a593Smuzhiyun Bison 3.7
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunStarting with Bison 3.7, the generated C++ file #include's the header
8*4882a593Smuzhiyunby default, instead of duplicating it. So we should not delete it.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunRemove the code to add #ifdef guards to the header, since Bison adds
11*4882a593Smuzhiyunthem itself since version 2.6.3.
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunFound at [1]
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun[1] https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunUpstream-Status: Pending
18*4882a593SmuzhiyunSigned-off-by: Martin Jansa <Martin.Jansa@gmail.com>
19*4882a593Smuzhiyun---
20*4882a593Smuzhiyun Source/WebCore/css/makegrammar.pl | 21 +--------------------
21*4882a593Smuzhiyun 1 file changed, 1 insertion(+), 20 deletions(-)
22*4882a593Smuzhiyun
23*4882a593Smuzhiyundiff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
24*4882a593Smuzhiyunindex 5d63b08102eb..9435701c7061 100644
25*4882a593Smuzhiyun--- a/Source/WebCore/css/makegrammar.pl
26*4882a593Smuzhiyun+++ b/Source/WebCore/css/makegrammar.pl
27*4882a593Smuzhiyun@@ -73,25 +73,6 @@
28*4882a593Smuzhiyun }
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun my $fileBase = File::Spec->join($outputDir, $filename);
31*4882a593Smuzhiyun-my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
32*4882a593Smuzhiyun+my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
33*4882a593Smuzhiyun push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives.
34*4882a593Smuzhiyun system(@bisonCommand) == 0 or die;
35*4882a593Smuzhiyun-
36*4882a593Smuzhiyun-open HEADER, ">$fileBase.h" or die;
37*4882a593Smuzhiyun-print HEADER << "EOF";
38*4882a593Smuzhiyun-#ifndef CSSGRAMMAR_H
39*4882a593Smuzhiyun-#define CSSGRAMMAR_H
40*4882a593Smuzhiyun-EOF
41*4882a593Smuzhiyun-
42*4882a593Smuzhiyun-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
43*4882a593Smuzhiyun-while (<HPP>) {
44*4882a593Smuzhiyun-    print HEADER;
45*4882a593Smuzhiyun-}
46*4882a593Smuzhiyun-close HPP;
47*4882a593Smuzhiyun-
48*4882a593Smuzhiyun-print HEADER "#endif\n";
49*4882a593Smuzhiyun-close HEADER;
50*4882a593Smuzhiyun-
51*4882a593Smuzhiyun-unlink("$fileBase.cpp.h");
52*4882a593Smuzhiyun-unlink("$fileBase.hpp");
53*4882a593Smuzhiyun-
54