0003-Let-Bison-generate-the-header-directly-to-fix-build-.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. From d92b11fea65364fefa700249bd3340e0cd4c5b31 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. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
  11. [james.hilliard1@gmail.com: backport from upstream commit
  12. d92b11fea65364fefa700249bd3340e0cd4c5b31]
  13. ---
  14. Source/WebCore/css/makegrammar.pl | 21 +--------------------
  15. 1 file changed, 1 insertion(+), 20 deletions(-)
  16. diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
  17. index 5d63b08102eb..9435701c7061 100644
  18. --- a/Source/WebCore/css/makegrammar.pl
  19. +++ b/Source/WebCore/css/makegrammar.pl
  20. @@ -73,25 +73,6 @@ if ($suffix eq ".y.in") {
  21. }
  22. my $fileBase = File::Spec->join($outputDir, $filename);
  23. -my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
  24. +my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
  25. push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives.
  26. system(@bisonCommand) == 0 or die;
  27. -
  28. -open HEADER, ">$fileBase.h" or die;
  29. -print HEADER << "EOF";
  30. -#ifndef CSSGRAMMAR_H
  31. -#define CSSGRAMMAR_H
  32. -EOF
  33. -
  34. -open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
  35. -while (<HPP>) {
  36. - print HEADER;
  37. -}
  38. -close HPP;
  39. -
  40. -print HEADER "#endif\n";
  41. -close HEADER;
  42. -
  43. -unlink("$fileBase.cpp.h");
  44. -unlink("$fileBase.hpp");
  45. -
  46. --
  47. 2.25.1