File gpm-weak-wgetch.patch of Package gpm
---
configure.ac.footer | 2 +-
src/lib/libcurses.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
Index: configure.ac.footer
===================================================================
--- configure.ac.footer.orig 2013-04-16 12:26:55.701393713 +0200
+++ configure.ac.footer 2013-04-16 12:29:05.441356326 +0200
@@ -148,7 +148,7 @@ No|no|N|n) SHARED_LIBS=-lc ;;
AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
else :; fi
done
- SHARED_LIBS="$LIBS $TERMLIBS -lc"
+ SHARED_LIBS="-lc"
LIBS=$SAVELIBS ;;
esac
Index: src/lib/libcurses.c
===================================================================
--- src/lib/libcurses.c.orig 2012-10-26 23:21:38.000000000 +0200
+++ src/lib/libcurses.c 2013-04-16 12:26:55.834390599 +0200
@@ -41,7 +41,16 @@
#endif /* HAVE_NCURSES_CURSES_H */
#endif /* HAVE_NCURSES_H */
-#define GET(win) ((win) ? wgetch(win) : getch())
+/* If win != NULL, it must have been created by ncurses anyway.
+ Avoid circular library dependencies. */
+#pragma weak wgetch
+#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR > 5)
+#pragma weak _nc_stdscr
+#else
+#pragma weak stdscr
+#endif
+
+#define GET(win) ((win && wgetch) ? wgetch(win) : getch())
int Gpm_Wgetch(WINDOW *win)
{