--- libraries/terminfo/configure.ac.sav	2009-08-28 08:46:45.000000000 -0400
+++ libraries/terminfo/configure.ac	2009-08-28 08:47:27.000000000 -0400
@@ -40,9 +40,9 @@
 fi
 
 AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,
-  AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
-    AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
-      HaveLibCurses=NO; LibCurses=not-installed)))
+  [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
+    [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
+      HaveLibCurses=NO; LibCurses=not-installed)])])
 
 if test "x$HaveLibCurses" = "xNO" ; then
     AC_MSG_FAILURE([curses library not found, so this package cannot be built])
