Check for term.h and include it on non-ncurses system to get a declaration
for tigetstr.
diff --git a/Include/py_curses.h b/Include/py_curses.h
index 62afb5e..b5f7e54 100644
--- a/Include/py_curses.h
+++ b/Include/py_curses.h
@@ -6,6 +6,10 @@
 #include <ncurses.h>
 #else
 #include <curses.h>
+#ifdef HAVE_TERM_H
+/* for tigetstr, which is not declared in SysV curses */
+#include <term.h>
+#endif
 #endif
 
 #ifdef __cplusplus
diff --git a/configure b/configure
index 639c73f..e2c0735 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# From configure.in Revision: 1.265 
+# From configure.in Revision: 1.266 
 
 # Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version 2.13 
@@ -1903,7 +1903,7 @@
 signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \
 sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \
 sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \
-sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
+sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \
 ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h netpacket/packet.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
diff --git a/configure.in b/configure.in
index f7f7ef7..8d77e7b 100644
--- a/configure.in
+++ b/configure.in
@@ -448,7 +448,7 @@
 signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \
 sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \
 sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \
-sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
+sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \
 ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h netpacket/packet.h)
 AC_HEADER_DIRENT
 
diff --git a/pyconfig.h.in b/pyconfig.h.in
index e3ce90c..749666f 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -699,6 +699,9 @@
 /* Define if you have the <sys/wait.h> header file.  */
 #undef HAVE_SYS_WAIT_H
 
+/* Define if you have the <term.h> header file.  */
+#undef HAVE_TERM_H
+
 /* Define if you have the <termios.h> header file.  */
 #undef HAVE_TERMIOS_H