0007-Let-Bison-generate-the-header-directly-to-fix-build-.patch 1.6 KB

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