0002-gcc-5.x-MKlib_gen.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Fix gcc 5.x build failure
  2. Extracted from upstream commit
  3. http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commit;h=97bb4678dc03e753290b39bbff30ba2825df9517.
  4. + modify MKlib_gen.sh to work around change in development version of
  5. gcc introduced here:
  6. https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
  7. https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
  8. (reports by Marcus Shawcroft, Maohui Lei).
  9. Original author: Thomas E. Dickey <dickey@invisible-island.net>
  10. Signed-off-by: Mikhail Peselnik <bas@bmail.ru>
  11. --- a/ncurses/base/MKlib_gen.sh.orig 2015-07-23 21:52:32.239481505 +0300
  12. +++ b/ncurses/base/MKlib_gen.sh 2015-07-23 21:53:20.772966587 +0300
  13. @@ -437,11 +437,22 @@
  14. -e 's/gen_$//' \
  15. -e 's/ / /g' >>$TMP
  16. +cat >$ED1 <<EOF
  17. +s/ / /g
  18. +s/^ //
  19. +s/ $//
  20. +s/P_NCURSES_BOOL/NCURSES_BOOL/g
  21. +EOF
  22. +
  23. +# A patch discussed here:
  24. +# https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
  25. +# introduces spurious #line markers. Work around that by ignoring the system's
  26. +# attempt to define "bool" and using our own symbol here.
  27. +sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
  28. +cat $ED2 >$TMP
  29. +
  30. $preprocessor $TMP 2>/dev/null \
  31. -| sed \
  32. - -e 's/ / /g' \
  33. - -e 's/^ //' \
  34. - -e 's/_Bool/NCURSES_BOOL/g' \
  35. +| sed -f $ED1 \
  36. | $AWK -f $AW2 \
  37. | sed -f $ED3 \
  38. | sed \