--- configure.orig	2011-10-24 13:46:07.000000000 +0100
+++ configure	2011-10-24 13:47:04.000000000 +0100
@@ -7567,8 +7567,8 @@
 
 { $as_echo "$as_me:$LINENO: checking for a curses library containing mvchgat" >&5
 $as_echo_n "checking for a curses library containing mvchgat... " >&6; }
-oldLIBS=$LIBS
-for curseslib in ncursesw curses ncurses ; do
+oldLIBS="-L@@PREFIX@@ $LIBS"
+for curseslib in ncurses ; do
     LIBS="$oldLIBS -l$curseslib"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
