hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 894a5448ee8ce0f134845c877b4c0a2a660e4ab3 Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Tue, 4 Aug 2020 21:04:06 +0300
Subject: [PATCH] Let Bison generate the header directly, to fix build with
 Bison 3.7
 
Starting with Bison 3.7, the generated C++ file #include's the header
by default, instead of duplicating it. So we should not delete it.
 
Remove the code to add #ifdef guards to the header, since Bison adds
them itself since version 2.6.3.
 
[Original patch taken from
https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-bison-3.7.patch?id=69e618c88a9134f754264efc11aa0b1fdc028b88
ported to qtwebkit-opensource-src-5.9.1]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 Source/WebCore/css/makegrammar.pl | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)
 
diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
index 4e0452ed..9ef32963 100644
--- a/Source/WebCore/css/makegrammar.pl
+++ b/Source/WebCore/css/makegrammar.pl
@@ -73,23 +73,4 @@ if ($suffix eq ".y.in") {
 }
 
 my $fileBase = File::Spec->join($outputDir, $filename);
-system("$bison -d -p $symbolsPrefix $grammarFilePath -o $fileBase.cpp");
-
-open HEADER, ">$fileBase.h" or die;
-print HEADER << "EOF";
-#ifndef CSSGRAMMAR_H
-#define CSSGRAMMAR_H
-EOF
-
-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
-while (<HPP>) {
-    print HEADER;
-}
-close HPP;
-
-print HEADER "#endif\n";
-close HEADER;
-
-unlink("$fileBase.cpp.h");
-unlink("$fileBase.hpp");
-
+system("$bison --defines=$fileBase.h -p $symbolsPrefix $grammarFilePath -o $fileBase.cpp");
-- 
2.28.0