Detect ncursesw and use it in place of ncurses when possible. Allow people to control this explicitly by --with-ncursesw. Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx> --- diff --git a/configure.ac b/configure.ac index bf6787f..e2ec2c4 100644 --- a/configure.ac +++ b/configure.ac @@ -191,6 +191,20 @@ else ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu" fi +AC_ARG_WITH([ncursesw], + AS_HELP_STRING([--with-ncursesw], [build with wide ncurses]), + [], with_ncursesw=auto +) +if test "x$with_ncursesw" = xauto; then + UTIL_CHECK_LIB(ncursesw, tputs) + with_ncursesw=$have_ncursesw +fi +if test "x$with_ncursesw" = xyes; then + NCURSES_LIB="-lncursesw" +else + NCURSES_LIB="-lncurses" +fi +AC_SUBST(NCURSES_LIB) have_ncurses=no AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [have_ncurses=yes]) case $have_ncurses in diff --git a/fdisk/Makefile.am b/fdisk/Makefile.am index 3b9dec5..7d9cf36 100644 --- a/fdisk/Makefile.am +++ b/fdisk/Makefile.am @@ -42,7 +42,7 @@ if HAVE_NCURSES sbin_PROGRAMS += cfdisk dist_man_MANS += cfdisk.8 cfdisk_SOURCES = cfdisk.c $(fdisk_common) -cfdisk_LDADD = -lncurses +cfdisk_LDADD = @NCURSES_LIB@ endif endif diff --git a/misc-utils/Makefile.am b/misc-utils/Makefile.am index b799462..4b7eb5f 100644 --- a/misc-utils/Makefile.am +++ b/misc-utils/Makefile.am @@ -18,10 +18,10 @@ dist_man_MANS = cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \ namei.1 script.1 whereis.1 scriptreplay.1 if HAVE_TINFO -cal_LDADD = -ltinfo -lncurses +cal_LDADD = -ltinfo @NCURSES_LIB@ else if HAVE_NCURSES -cal_LDADD = -lncurses +cal_LDADD = @NCURSES_LIB@ else if HAVE_TERMCAP cal_LDADD = -ltermcap @@ -41,7 +41,7 @@ endif if HAVE_TINFO setterm_LDADD = -ltinfo else -setterm_LDADD = -lncurses +setterm_LDADD = @NCURSES_LIB@ endif endif diff --git a/text-utils/Makefile.am b/text-utils/Makefile.am index d93af72..29ef8ac 100644 --- a/text-utils/Makefile.am +++ b/text-utils/Makefile.am @@ -14,12 +14,12 @@ bin_PROGRAMS = more usrbinexec_PROGRAMS += ul pg if HAVE_TINFO more_LDADD = -ltinfo -pg_LDADD = -ltinfo -lncurses +pg_LDADD = -ltinfo @NCURSES_LIB@ ul_LDADD = -ltinfo else -more_LDADD = -lncurses -pg_LDADD = -lncurses -ul_LDADD = -lncurses +more_LDADD = @NCURSES_LIB@ +pg_LDADD = @NCURSES_LIB@ +ul_LDADD = @NCURSES_LIB@ endif dist_man_MANS += ul.1 more.1 pg.1 else -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html