--- readline-7.0/aclocal.m4 +++ readline-7.0/aclocal.m4 @@ -958,11 +958,17 @@ fi AC_CACHE_VAL(bash_cv_termcap_lib, [AC_CHECK_FUNC(tgetent, bash_cv_termcap_lib=libc, - [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, - [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, - [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, - [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, - bash_cv_termcap_lib=gnutermcap)])])])])]) + [AS_IF(test $opt_unicode = yes, + [AC_CHECK_LIB(tinfow, tgetent, bash_cv_termcap_lib=libtinfow, + [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw, + [AC_MSG_ERROR(Cannot find unicode capable termcap)])])], + [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, + [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, + [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, + [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, + bash_cv_termcap_lib=gnutermcap)])])])] + )])]) + if test "X$_bash_needmsg" = "Xyes"; then AC_MSG_CHECKING(which library has the termcap functions) fi @@ -974,6 +980,12 @@ elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then TERMCAP_LIB=-ltermcap TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfow; then +TERMCAP_LIB=-ltinfow +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncursesw; then +TERMCAP_LIB=-lncursesw +TERMCAP_DEP= elif test $bash_cv_termcap_lib = libtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= --- readline-7.0/configure.ac +++ readline-7.0/configure.ac @@ -47,6 +47,8 @@ prefer_curses=yes fi +AC_ARG_WITH(unicode, AC_HELP_STRING([--with-unicode], [use unicode curses library]), opt_unicode=$withval, opt_unicode=yes) + dnl option parsing for optional features opt_multibyte=yes opt_static_libs=yes --- readline-7.0/configure +++ readline-7.0/configure @@ -721,6 +721,7 @@ ac_user_opts=' enable_option_checking with_curses +with_unicode enable_multibyte enable_shared enable_static @@ -1358,6 +1359,7 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-curses use the curses library instead of the termcap library + --with-unicode use unicode curses library Some influential environment variables: CC C compiler command @@ -2376,6 +2378,15 @@ prefer_curses=yes fi + +# Check whether --with-unicode was given. +if test "${with_unicode+set}" = set; then : + withval=$with_unicode; opt_unicode=$withval +else + opt_unicode=yes +fi + + opt_multibyte=yes opt_static_libs=yes opt_shared_libs=yes @@ -5905,6 +5916,91 @@ if test "x$ac_cv_func_tgetent" = xyes; then : bash_cv_termcap_lib=libc else + if test $opt_unicode = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfow" >&5 +$as_echo_n "checking for tgetent in -ltinfow... " >&6; } +if ${ac_cv_lib_tinfow_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltinfow $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 tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_tinfow_tgetent=yes +else + ac_cv_lib_tinfow_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfow_tgetent" >&5 +$as_echo "$ac_cv_lib_tinfow_tgetent" >&6; } +if test "x$ac_cv_lib_tinfow_tgetent" = xyes; then : + bash_cv_termcap_lib=libtinfow +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncursesw" >&5 +$as_echo_n "checking for tgetent in -lncursesw... " >&6; } +if ${ac_cv_lib_ncursesw_tgetent+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncursesw $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 tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ncursesw_tgetent=yes +else + ac_cv_lib_ncursesw_tgetent=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_tgetent" >&5 +$as_echo "$ac_cv_lib_ncursesw_tgetent" >&6; } +if test "x$ac_cv_lib_ncursesw_tgetent" = xyes; then : + bash_cv_termcap_lib=libncursesw +else + as_fn_error $? "Cannot find unicode capable termcap" "$LINENO" 5 +fi + +fi + +else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 $as_echo_n "checking for tgetent in -ltermcap... " >&6; } if ${ac_cv_lib_termcap_tgetent+:} false; then : @@ -6070,10 +6166,13 @@ fi + +fi fi fi + if test "X$_bash_needmsg" = "Xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking which library has the termcap functions" >&5 $as_echo_n "checking which library has the termcap functions... " >&6; } @@ -6087,6 +6186,12 @@ elif test $bash_cv_termcap_lib = libtermcap && test -z "$prefer_curses"; then TERMCAP_LIB=-ltermcap TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libtinfow; then +TERMCAP_LIB=-ltinfow +TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncursesw; then +TERMCAP_LIB=-lncursesw +TERMCAP_DEP= elif test $bash_cv_termcap_lib = libtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP=