When libncurses is configured with gpm support and gpm with ncurses support, libncurses.so depends on libgpm.so and libgpm.so depends on libncurses.so. Such loops should never happen. If Gpm_Wgetch is passed non-NULL win argument, it must have been created by ncurses anyway and so it should be already loaded. On the other side, if Gpm_Wgetch is never used or used just with NULL argument, libncurses is never needed. --- gpm-1.20.1/configure.in.jj Tue Jul 18 09:17:32 2000 +++ gpm-1.20.1/configure.in Mon Jun 16 10:51:16 2003 @@ -98,7 +98,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 --- gpm-1.20.1/configure.jj Tue Jul 18 09:18:10 2000 +++ gpm-1.20.1/configure Mon Jun 16 10:51:32 2003 @@ -1582,7 +1582,7 @@ fi else :; fi done - SHARED_LIBS="$LIBS $TERMLIBS -lc" + SHARED_LIBS="-lc" LIBS=$SAVELIBS ;; esac --- gpm-1.20.1/src/lib/libcurses.c.jj Mon Jan 17 16:34:00 2000 +++ gpm-1.20.1/src/lib/libcurses.c Mon Jun 16 10:55:52 2003 @@ -40,7 +40,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) {