Index: b/configure.in
===================================================================
--- a/configure.in	2008-06-11 06:20:33.000000000 +0300
+++ b/configure.in	2008-06-11 06:22:56.000000000 +0300
@@ -73,7 +73,7 @@ CURSES_OBJS=
 
 case $with_curses in
 No|no|N|n) : ;;
-        *) if   test ${ac_cv_header_ncurses_h} = yes || 
+        *) if : || test ${ac_cv_header_ncurses_h} = yes ||
                 test ${ac_cv_header_ncurses_curses_h} = yes ||
                 test ${ac_cv_header_curses_h} = yes ; then
         CURSES_OBJS=lib/libcurses.o ; fi ;;
@@ -96,6 +96,7 @@ fi
 AC_CHECK_FUNCS(vsyslog syslog)
 AC_FUNC_ALLOCA
 
+if false; then		# we actually don't want -lcurses
 case $with_curses in
 No|no|N|n) SHARED_LIBS=-lc ;;
 *)
@@ -116,6 +117,7 @@ No|no|N|n) SHARED_LIBS=-lc ;;
     SHARED_LIBS="$LIBS $TERMLIBS -lc"
     LIBS="$LIBS $SAVELIBS" ;;
 esac    
+fi
 
 GPMXTERM=
 AC_SUBST(GPMXTERM)
Index: b/src/lib/libcurses.c
===================================================================
--- a/src/lib/libcurses.c	2008-06-11 06:20:54.000000000 +0300
+++ b/src/lib/libcurses.c	2008-06-11 06:22:56.000000000 +0300
@@ -29,6 +29,7 @@
 
 #include "headers/gpmInt.h"
 
+#if 0	/* hack - we do not want to depend on libcurses headers */
 #ifdef HAVE_NCURSES_H
 #include <ncurses.h>
 #else
@@ -40,8 +41,13 @@
 #endif /* HAVE_CURSES_H */
 #endif /* HAVE_NCURSES_CURSES_H */
 #endif /* HAVE_NCURSES_H */
-
+#else
+typedef struct _WINDOW WINDOW;
+extern int wgetch(WINDOW *) __attribute__((weak));
+extern WINDOW *stdscr __attribute__((weak));
+#define getch() wgetch(stdscr)
 #define GET(win) ((win) ? wgetch(win) : getch())
+#endif
 
 int Gpm_Wgetch(WINDOW *win)
 {
