--- gpm-1.20.5/src/lib/libcurses.c~ 2008-06-13 16:08:19.000000000 +0800 +++ gpm-1.20.5/src/lib/libcurses.c 2008-07-12 13:10:02.000000000 +0800 @@ -41,8 +41,12 @@ #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 +#pragma weak stdscr +#define GET(win) ((win && wgetch) ? wgetch(win) : getch()) int Gpm_Wgetch(WINDOW *win) { fd_set selSet; --- gpm-1.20.5/configure~ 2008-07-12 13:08:15.000000000 +0800 +++ gpm-1.20.5/configure 2008-07-12 13:08:59.000000000 +0800 @@ -5236,7 +5236,7 @@ else :; fi done - SHARED_LIBS="$LIBS $TERMLIBS -lc" + SHARED_LIBS="-lc" LIBS=$SAVELIBS ;; esac --- gpm-1.20.5/configure.ac~ 2008-06-13 16:08:18.000000000 +0800 +++ gpm-1.20.5/configure.ac 2008-07-12 13:11:44.000000000 +0800 @@ -126,7 +126,7 @@ AC_CHECK_LIB($i, wgetch,,,$TERMLIBS) else :; fi done - SHARED_LIBS="$LIBS $TERMLIBS -lc" + SHARED_LIBS="-lc" LIBS=$SAVELIBS ;; esac