1 Fix GCC 5.x preprocessor failure
3 Building ncurses 5.9 with GCC 5.x fails with a syntax error, caused by
4 earlier preprocessing. This failure is more likely when building for
5 host (e.g. host-ncurses) that recently updated to GCC 5.x.
7 This patch is taken from the following link (more information is also
9 https://groups.google.com/forum/#!topic/sage-trac/U31shviuqzk
11 Signed-off-by: Doug Kehn <rdkehn@yahoo.com>
13 Index: b/ncurses/base/MKlib_gen.sh
14 ===================================================================
15 --- a/ncurses/base/MKlib_gen.sh
16 +++ b/ncurses/base/MKlib_gen.sh
17 @@ -62,7 +62,15 @@ if test "${LC_MESSAGES+set}" = set; then
18 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
19 if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi
21 -preprocessor="$1 -DNCURSES_INTERNALS -I../include"
22 +# Work around "unexpected" output of GCC 5.1.0's cpp w.r.t. #line directives
23 +# by simply suppressing them:
24 +case `$1 -dumpversion 2>/dev/null` in
25 + 5.[01].*) # assume a "broken" one
26 + preprocessor="$1 -P -DNCURSES_INTERNALS -I../include"
29 + preprocessor="$1 -DNCURSES_INTERNALS -I../include"