diff --git a/README.md b/README.md index 232ec0f..4c8375d 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Install these packages (or *ports*): Then build: - $ CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" LIBS="-lcurses" ./configure + $ CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure $ make #### Other UNIX diff --git a/configure b/configure index 0b1cb9b..e774e18 100755 --- a/configure +++ b/configure @@ -3467,6 +3467,62 @@ $as_echo "#define READLINE_GNU 1" >>confdefs.h else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetnum" >&5 +$as_echo_n "checking for library containing tgetnum... " >&6; } +if ${ac_cv_search_tgetnum+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetnum (); +int +main () +{ +return tgetnum (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ncursesw ncurses curses; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_tgetnum=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_tgetnum+:} false; then : + break +fi +done +if ${ac_cv_search_tgetnum+:} false; then : + +else + ac_cv_search_tgetnum=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetnum" >&5 +$as_echo "$ac_cv_search_tgetnum" >&6; } +ac_res=$ac_cv_search_tgetnum +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_set_prompt in -ledit" >&5 $as_echo_n "checking for rl_set_prompt in -ledit... " >&6; } if ${ac_cv_lib_edit_rl_set_prompt+:} false; then : diff --git a/configure.ac b/configure.ac index f17039d..f3cf689 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,7 @@ AC_CHECK_LIB([readline], [rl_save_prompt], [ EXTRA_LIBS="${EXTRA_LIBS} -lreadline" ; ] ], [ + AC_SEARCH_LIBS([tgetnum], [ncursesw ncurses curses]) AC_CHECK_LIB([edit], [rl_set_prompt]) AC_DEFINE([READLINE_EDIT], [1], [Use libedit]) [ EXTRA_LIBS="${EXTRA_LIBS} -ledit" ; ]