Index: configure.ac =================================================================== RCS file: /cvsroot/nano/nano/configure.ac,v retrieving revision 1.96 diff -u -r1.96 configure.ac --- configure.ac 20 Mar 2005 20:04:59 -0000 1.96 +++ configure.ac 25 Mar 2005 01:08:33 -0000 @@ -187,6 +187,17 @@ ]) fi]) +AC_MSG_CHECKING([whether to enable utf8 support]) +AC_ARG_ENABLE(utf8, +[ --enable-utf8 Enable utf8 support], +[if test x$enableval = xyes; then + enable_utf8=yes +else + enable_utf8=no +fi], +[enable_utf8=auto]) +AC_MSG_RESULT($enable_utf8) + AC_MSG_CHECKING([whether to use slang]) CURSES_LIB_NAME="" AC_ARG_WITH(slang, @@ -350,7 +361,11 @@ esac], [AC_MSG_RESULT(no)]) dnl Checks for functions -AC_CHECK_FUNCS(snprintf vsnprintf isblank iswalnum iswblank iswspace strcasecmp strncasecmp strcasestr strnlen getline getdelim mblen mbtowc wctomb wcwidth) +AC_CHECK_FUNCS(snprintf vsnprintf isblank strcasecmp strncasecmp strcasestr strnlen getline getdelim) +if test "x$enable_utf8" != "xno" +then + AC_CHECK_FUNCS(iswalnum mblen mbtowc wctomb wcwidth iswspace iswblank) +fi if test "x$ac_cv_func_snprintf" = "xno" -o "x$ac_cv_func_vsnprintf" = "xno" then AM_PATH_GLIB_2_0(2.0.0,, @@ -372,17 +387,23 @@ if eval "test x$CURSES_LIB_NAME = x" then AC_CHECK_HEADERS(ncurses.h) - AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE="yes"]) + if test x$enable_utf8 != xno + then + AC_CHECK_LIB(ncursesw, wget_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE="yes"]) + fi if eval "test x$CURSES_LIB_NAME = x" then - AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses]) + AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses]) fi fi if eval "test x$CURSES_LIB_NAME = x" then AC_CHECK_HEADERS(curses.h) - AC_CHECK_LIB(curses, wget_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE="yes"]) + if test x$enable_utf8 != xno + then + AC_CHECK_LIB(curses, wget_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE="yes"]) + fi if eval "test x$CURSES_LIB_NAME = x" then AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) @@ -416,11 +437,29 @@ LDFLAGS="$LDFLAGS $GLIB_LIBS" fi -if test "x$CURSES_LIB_WIDE" = "xyes" -a "x$ac_cv_func_iswalnum" = "xyes" -a "x$ac_cv_func_mblen" = "xyes" -a "x$ac_cv_func_mbtowc" = "xyes" -a "x$ac_cv_func_wctomb" = "xyes" -a "x$ac_cv_func_wcwidth" = "xyes" && test "x$ac_cv_func_iswspace" = "xyes" -o "x$ac_cv_func_iswblank" = "xyes" +if test "x$enable_utf8" != "xno" \ + && \ + test "x$CURSES_LIB_WIDE" = "xyes" -a \ + "x$ac_cv_func_iswalnum" = "xyes" -a \ + "x$ac_cv_func_mblen" = "xyes" -a \ + "x$ac_cv_func_mbtowc" = "xyes" -a \ + "x$ac_cv_func_wctomb" = "xyes" -a \ + "x$ac_cv_func_wcwidth" = "xyes" \ + && \ + test "x$ac_cv_func_iswspace" = "xyes" -o "x$ac_cv_func_iswblank" = "xyes" then AC_DEFINE(NANO_WIDE, 1, [Define this if your system has sufficient wide character support (a wide curses library, iswalnum(), iswspace() or iswblank(), mblen(), mbtowc(), wctomb(), and wcwidth()).]) else + if test "x$enable_utf8" = "xyes" + then + AC_MSG_ERROR([ +*** UTF8 support was requested but no UTF8 support was detected in +*** your curses library. Please verify that your slang was built +*** with UTF8 or your ncurses was built with wide char support.]) + elif test "x$enable_utf8" != "xno" + then AC_MSG_WARN([Insufficient wide character support found. nano will not be able to support UTF-8.]) + fi fi AC_CONFIG_FILES([