102-ncurses-5.9-gcc-5.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. https://bugs.gentoo.org/545114
  2. extracted from the upstream change (which had many unrelated commits in one)
  3. From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
  4. From: "Thomas E. Dickey" <dickey@invisible-island.net>
  5. Date: Sun, 7 Dec 2014 03:10:09 +0000
  6. Subject: [PATCH] ncurses 5.9 - patch 20141206
  7. + modify MKlib_gen.sh to work around change in development version of
  8. gcc introduced here:
  9. https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
  10. https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
  11. (reports by Marcus Shawcroft, Maohui Lei).
  12. diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
  13. index d8cc3c9..b91398c 100755
  14. --- a/ncurses/base/MKlib_gen.sh
  15. +++ b/ncurses/base/MKlib_gen.sh
  16. @@ -474,11 +474,22 @@ sed -n -f $ED1 \
  17. -e 's/gen_$//' \
  18. -e 's/ / /g' >>$TMP
  19. +cat >$ED1 <<EOF
  20. +s/ / /g
  21. +s/^ //
  22. +s/ $//
  23. +s/P_NCURSES_BOOL/NCURSES_BOOL/g
  24. +EOF
  25. +
  26. +# A patch discussed here:
  27. +# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
  28. +# introduces spurious #line markers. Work around that by ignoring the system's
  29. +# attempt to define "bool" and using our own symbol here.
  30. +sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
  31. +cat $ED2 >$TMP
  32. +
  33. $preprocessor $TMP 2>/dev/null \
  34. -| sed \
  35. - -e 's/ / /g' \
  36. - -e 's/^ //' \
  37. - -e 's/_Bool/NCURSES_BOOL/g' \
  38. +| sed -f $ED1 \
  39. | $AWK -f $AW2 \
  40. | sed -f $ED3 \
  41. | sed \