Skip to contentSkip to conversation

package/ncurses: Fix GCC 5.x preprocessor failure

PATCH New Doug Kehn 3 participants 3 messages May 27, 2015 – May 31, 2015

lore
Share & tools
lore

Doug Kehn

author
#0 lore raw

PATCH 1/1 package/ncurses: Fix GCC 5.x preprocessor failure

Building ncurses 5.9 with GCC 5.x fails with a syntax error, caused by earlier preprocessing. This failure is more likely when building for host (e.g. host-ncurses) that recently updated to GCC 5.x.

This patch is taken from the following link (more information is also available here):
https://groups.google.com/forum/#!topic/sage-trac/U31shviuqzk

---
 package/ncurses/0002-gcc-5.x-MKlib_gen.patch | 33 ++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/ncurses/0002-gcc-5.x-MKlib_gen.patch
package/ncurses/0002-gcc-5.x-MKlib_gen.patch new file +33 -0
new file mode 100644
index 0000000..0771208
@@ -0,0 +1,33 @@
+Fix GCC 5.x preprocessor failure
+
+Building ncurses 5.9 with GCC 5.x fails with a syntax error, caused by
+earlier preprocessing. This failure is more likely when building for
+host (e.g. host-ncurses) that recently updated to GCC 5.x.
+
+This patch is taken from the following link (more information is also
+available here):
+https://groups.google.com/forum/#!topic/sage-trac/U31shviuqzk
+
+Signed-off-by: Doug Kehn <[email protected]>
+
+Index: b/ncurses/base/MKlib_gen.sh
+===================================================================
+--- a/ncurses/base/MKlib_gen.sh
++++ b/ncurses/base/MKlib_gen.sh
+@@ -62,7 +62,15 @@ if test "${LC_MESSAGES+set}" = set; then
+ if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+ if test "${LC_COLLATE+set}"  = set; then LC_COLLATE=C;  export LC_COLLATE;  fi
+ 
+-preprocessor="$1 -DNCURSES_INTERNALS -I../include"
++# Work around "unexpected" output of GCC 5.1.0's cpp w.r.t. #line directives
++# by simply suppressing them:
++case `$1 -dumpversion 2>/dev/null` in
++	5.[01].*)  # assume a "broken" one
++		preprocessor="$1 -P -DNCURSES_INTERNALS -I../include"
++		;;
++	*)
++		preprocessor="$1 -DNCURSES_INTERNALS -I../include"
++esac
+ AWK="$2"
+ USE="$3"
+ 
Signature · 1 line
2.4.1
#1 lore raw

PATCH 1/1 package/ncurses: Fix GCC 5.x preprocessor failure

Quoted 9 lines · Doug Kehn

Building ncurses 5.9 with GCC 5.x fails with a syntax error, caused by earlier preprocessing. This failure is more likely when building for host (e.g. host-ncurses) that recently updated to GCC 5.x.

This patch is taken from the following link (more information is also available here):
https://groups.google.com/forum/#!topic/sage-trac/U31shviuqzk

This patch works for me on my Archlinux updated system (gcc 5.1.0)

Regards,

Jaap Crezee

#2 lore raw

PATCH 1/1 package/ncurses: Fix GCC 5.x preprocessor failure

In reply to Doug Kehn
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Doug" == Doug Kehn <[email protected]> writes:

Building ncurses 5.9 with GCC 5.x fails with a syntax error, caused by earlier preprocessing. This failure is more likely when building for host (e.g. host-ncurses) that recently updated to GCC 5.x.

This patch is taken from the following link (more information is also available here):
https://groups.google.com/forum/#!topic/sage-trac/U31shviuqzk

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard