[Use PostgreSQL libpq library if available [[yes]]]))
: ${with_libpq='yes'}
+AC_ARG_WITH([termcap],
+ AS_HELP_STRING([--with-termcap],
+ [Use a termcap library if available [[yes]]]))
+: ${with_termcap='yes'}
+
dnl For reasons I don't understand, it is necessary to use
dnl quadigraphs here instead of [[ ... ]].
AC_ARG_WITH([macosx-version],
dnl by pretending we know the format -- without bringing in the local
dnl termcap reimplementation.
-AC_CHECK_LIB([ncurses], [tgetent], [have_ncurses=yes])
-AC_CHECK_LIB([ncurses], [tparm], [have_ncurses_tparm=yes])
-AC_CHECK_LIB([ncurses], [tparam], [have_ncurses_tparam=yes])
-AC_CHECK_LIB([curses], [tgetent], [have_curses=yes])
-AC_CHECK_LIB([curses], [tparm], [have_curses_tparm=yes])
-AC_CHECK_LIB([curses], [tparam], [have_curses_tparam=yes])
-AC_CHECK_LIB([termcap], [tgetent], [have_termcap=yes])
-AC_CHECK_LIB([termcap], [tparm], [have_termcap_tparm=yes])
-AC_CHECK_LIB([termcap], [tparam], [have_termcap_tparam=yes])
-
-if test "x${have_ncurses}" = xyes; then
- termcap_library=ncurses
-elif test "x${have_curses_tparm}" != xyes \
- || test "x${have_curses_tparam}" != xyes
-then
- if test "x${have_termcap}" = xyes; then
- termcap_library=termcap
+if test "x${with_termcap}" = xyes; then
+
+ AC_CHECK_LIB([ncurses], [tgetent], [have_ncurses=yes])
+ AC_CHECK_LIB([ncurses], [tparm], [have_ncurses_tparm=yes])
+ AC_CHECK_LIB([ncurses], [tparam], [have_ncurses_tparam=yes])
+ AC_CHECK_LIB([curses], [tgetent], [have_curses=yes])
+ AC_CHECK_LIB([curses], [tparm], [have_curses_tparm=yes])
+ AC_CHECK_LIB([curses], [tparam], [have_curses_tparam=yes])
+ AC_CHECK_LIB([termcap], [tgetent], [have_termcap=yes])
+ AC_CHECK_LIB([termcap], [tparm], [have_termcap_tparm=yes])
+ AC_CHECK_LIB([termcap], [tparam], [have_termcap_tparam=yes])
+
+ if test "x${have_ncurses}" = xyes; then
+ with_termcap=ncurses
+ elif test "x${have_curses_tparm}" != xyes \
+ || test "x${have_curses_tparam}" != xyes
+ then
+ if test "x${have_termcap}" = xyes; then
+ with_termcap=termcap
+ elif test "x${have_curses}" = xyes; then
+ with_termcap=curses
+ fi
+ dnl This is a little unusual (that we have either `tparm' or `tparam'
+ dnl from `-lcurses', but not `tgetent'), but we should check anyway.
elif test "x${have_curses}" = xyes; then
- termcap_library=curses
+ with_termcap=curses
+ elif test "x${have_termcap}" = xyes; then
+ with_termcap=termcap
+ fi
+
+elif test "x${with_termcap}" != xno; then
+
+ lib=${with_termcap}
+ AC_CHECK_LIB([${lib}], [tgetent], [eval have_${lib}=yes])
+ AC_CHECK_LIB([${lib}], [tparm], [eval have_${lib}_tparm=yes])
+ AC_CHECK_LIB([${lib}], [tparam], [eval have_${lib}_tparam=yes])
+
+ if eval test "\"x\${have_${lib}}\"" != xyes; then
+ AC_MSG_ERROR([No tgetent in termcap library: ${with_termcap}])
fi
-dnl This is a little unusual (that we have either `tparm' or `tparam'
-dnl from `-lcurses', but not `tgetent'), but we should check anyway.
-elif test "x${have_curses}" = xyes; then
- termcap_library=curses
-elif test "x${have_termcap}" = xyes; then
- termcap_library=termcap
+
fi
-case ${termcap_library} in
-curses)
- AC_CHECK_HEADERS([curses.h term.h])
- LIBS="-lcurses ${LIBS}"
- ;;
-ncurses)
- dnl ncurses sometimes uses ncurses.h and sometimes uses curses.h.
- dnl We use whichever one is available, preferring the more
- dnl specifically named one.
- AC_CHECK_HEADERS([ncurses.h curses.h term.h])
- LIBS="-lncurses ${LIBS}"
- ;;
-termcap)
- LIBS="-ltermcap ${LIBS}"
- ;;
-esac
+dnl Go for whatever header files we can.
+AC_CHECK_HEADERS([ncurses.h curses.h term.h])
-if test "x${termcap_library}" = xno; then
+case "${with_termcap}" in
+yes)
+ AC_MSG_WARN([No termcap library found; will emulate it])
OPTIONAL_BASES="${OPTIONAL_BASES} termcap tparam"
-else
- eval have_tparam=\$have_${termcap_library}_tparam
+ ;;
+no) ;;
+*)
+ LIBS="-l${with_termcap} ${LIBS}"
+ eval have_tparam=\$have_${with_termcap}_tparam
if test "x${have_tparam}" != xyes; then
- eval have_tparm=\$have_${termcap_library}_tparm
+ eval have_tparm=\$have_${with_termcap}_tparm
if test "x${have_tparm}" = xyes; then
+ AC_MSG_WARN([No tparam found; will emulate it from terminfo tparm])
OPTIONAL_BASES="${OPTIONAL_BASES} terminfo"
else
+ AC_MSG_WARN([No tparam found; will emulate it])
OPTIONAL_BASES="${OPTIONAL_BASES} tparam"
fi
fi
-fi
+esac
dnl The OpenSSL crypto library provides support for blowfish and MD5.
if test "${with_openssl}" != no; then