+
+case ".$with_fallback" in
+(.|.no)
+ FALLBACK_LIST=
+ ;;
+(.yes)
+ AC_MSG_WARN(expected a list of terminal descriptions)
+ ;;
+(*)
+ FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'`
+ ;;
+esac
+
+# The fallback feature in ncurses relies upon tic/infocmp outside the build
+# tree for generating the terminal descriptions that will be compiled into the
+# library. If your toolchain is old, it may not handle current terminal
+# databases. Use configure-options to point to the tools which will be used,
+# rather than the first ones found on the $PATH.
+AC_CHECK_TOOL(TIC, tic)
+AC_CHECK_TOOL(INFOCMP, infocmp)
+if test -n "$FALLBACK_LIST"
+then
+ CF_WITH_PATH_PROG(TIC, tic, [for fallbacks], $PATH:/usr/local/ncurses/bin)
+ CF_WITH_PATH_PROG(INFOCMP, infocmp, [for fallbacks], $PATH:/usr/local/ncurses/bin)
+ test -z "$TIC" && FALLBACK_LIST=
+ test -z "$INFOCMP" && FALLBACK_LIST=
+ if test -z "$FALLBACK_LIST"
+ then
+ AC_MSG_WARN(ignoring fallback option because tic/infocmp are not available)
+ fi
+fi
+AC_SUBST(TIC)
+AC_SUBST(INFOCMP)
+
+USE_FALLBACKS=
+test -z "$FALLBACK_LIST" && USE_FALLBACKS="#"