in configure.ac, per Mike Frysinger's patch, add support for

--enable-utf8 and --disable-utf8 options, with slang support and a few
other tweaks added by me


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2426 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-03-25 22:25:24 +00:00
parent c8857a2c26
commit 8ac9087d75
2 changed files with 209 additions and 124 deletions

View File

@ -54,6 +54,13 @@ CVS code -
help_line_len() help_line_len()
- Make the text display more flexible, and closer to what nano - Make the text display more flexible, and closer to what nano
1.2.x does. (DLR) 1.2.x does. (DLR)
- configure.ac:
- Allow more flexible handling of UTF-8 support by allowing
the --enable-utf8 and --disable-utf8 options. (Mike
Frysinger) DLR: Extend these options to work with slang as
well as curses, consolidate the warning and error messages
dealing with UTF-8 support as much as possible, and add a few
minor consistency fixes.
GNU nano 1.3.6 - 2005.03.20 GNU nano 1.3.6 - 2005.03.20
- General: - General:

View File

@ -64,12 +64,12 @@ int main(void)
dnl options dnl options
AC_ARG_ENABLE(debug, AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging (disabled by default)], [ --enable-debug Enable debugging (disabled by default)],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.]) AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.])
debug_support=yes debug_support=yes
fi]) fi])
if test "$debug_support" != "yes"; then if test x$debug_support != xyes; then
AC_DEFINE(NDEBUG, 1, [Shut up the assert warnings :-)]) AC_DEFINE(NDEBUG, 1, [Shut up the assert warnings :-)])
fi fi
@ -78,7 +78,7 @@ AC_ARG_ENABLE(extra,
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
fi]) fi])
AC_ARG_ENABLE(tiny, AC_ARG_ENABLE(tiny,
[ --enable-tiny Disable features for the sake of size], [ --enable-tiny Disable features for the sake of size],
@ -91,61 +91,61 @@ AC_ARG_ENABLE(tiny,
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).]) AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).])
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the use(full|less) spelling functions.]) AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the use(full|less) spelling functions.])
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!]) AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!])
fi]) fi])
AC_ARG_ENABLE(browser, AC_ARG_ENABLE(browser,
[ --disable-browser Disable mini file browser], [ --disable-browser Disable mini file browser],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in (crappy) file browser.]) AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in (crappy) file browser.])
fi]) fi])
AC_ARG_ENABLE(help, AC_ARG_ENABLE(help,
[ --disable-help Disable help function], [ --disable-help Disable help function],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help menu.]) AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help menu.])
fi]) fi])
AC_ARG_ENABLE(justify, AC_ARG_ENABLE(justify,
[ --disable-justify Disable justify/unjustify function], [ --disable-justify Disable justify/unjustify function],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.]) AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
fi]) fi])
AC_ARG_ENABLE(mouse, AC_ARG_ENABLE(mouse,
[ --disable-mouse Disable mouse support (and -m flag)], [ --disable-mouse Disable mouse support (and -m flag)],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.]) AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.])
fi]) fi])
AC_ARG_ENABLE(operatingdir, AC_ARG_ENABLE(operatingdir,
[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)], [ --disable-operatingdir Disable setting of operating directory (chroot of sorts)],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).]) AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).])
fi]) fi])
AC_ARG_ENABLE(speller, AC_ARG_ENABLE(speller,
[ --disable-speller Disable spell checker function], [ --disable-speller Disable spell checker function],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the use(full|less) spelling functions.]) AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the use(full|less) spelling functions.])
fi]) fi])
AC_ARG_ENABLE(tabcomp, AC_ARG_ENABLE(tabcomp,
[ --disable-tabcomp Disable tab completion code for a smaller binary], [ --disable-tabcomp Disable tab completion code for a smaller binary],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!]) AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!])
fi]) fi])
AC_ARG_ENABLE(wrapping, AC_ARG_ENABLE(wrapping,
[ --disable-wrapping Disable all wrapping of text (and -w flag)], [ --disable-wrapping Disable all wrapping of text (and -w flag)],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable any and all text wrapping.]) AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable any and all text wrapping.])
fi]) fi])
AC_ARG_ENABLE(wrapping-as-root, AC_ARG_ENABLE(wrapping-as-root,
[ --disable-wrapping-as-root Disable wrapping of text as root by default], [ --disable-wrapping-as-root Disable wrapping of text as root by default],
[if test x$enableval != xyes; then [if test x$enableval != xyes; then
AC_DEFINE(DISABLE_ROOTWRAP, 1, [Define this to disable wrapping as root by default.]) AC_DEFINE(DISABLE_ROOTWRAP, 1, [Define this to disable wrapping as root by default.])
fi]) fi])
AC_ARG_ENABLE(color, AC_ARG_ENABLE(color,
[ --enable-color Enable color and syntax highlighting], [ --enable-color Enable color and syntax highlighting],
@ -164,13 +164,13 @@ AC_ARG_ENABLE(multibuffer,
[ --enable-multibuffer Enable multiple file buffers], [ --enable-multibuffer Enable multiple file buffers],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
fi]) fi])
AC_ARG_ENABLE(nanorc, AC_ARG_ENABLE(nanorc,
[ --enable-nanorc Enable use of .nanorc file], [ --enable-nanorc Enable use of .nanorc file],
[if test x$enableval = xyes; then [if test x$enableval = xyes; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
fi]) fi])
AC_ARG_ENABLE(all, AC_ARG_ENABLE(all,
[ --enable-all Enable ALL extra nano functionality (kitchen sink option)], [ --enable-all Enable ALL extra nano functionality (kitchen sink option)],
@ -184,9 +184,20 @@ AC_ARG_ENABLE(all,
*** WARNING: Color support is far from perfect, but functional. *** *** WARNING: Color support is far from perfect, but functional. ***
*** Be careful with syntax in your .nanorc or nano may malfunction. *** *** Be careful with syntax in your .nanorc or nano may malfunction. ***
*********************************************************************** ***********************************************************************
]) ])
fi]) fi])
AC_MSG_CHECKING([whether to enable UTF-8 support])
AC_ARG_ENABLE(utf8,
[ --enable-utf8 Enable UTF-8 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]) AC_MSG_CHECKING([whether to use slang])
CURSES_LIB_NAME="" CURSES_LIB_NAME=""
AC_ARG_WITH(slang, AC_ARG_WITH(slang,
@ -198,61 +209,18 @@ AC_ARG_WITH(slang,
*) *)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
if test "$with_slang" != "yes"; then if test x$with_slang != xyes; then
# Add additional search path # Add additional search path
LDFLAGS="-L$with_slang/lib $LDFLAGS" LDFLAGS="-L$with_slang/lib $LDFLAGS"
CPPFLAGS="-I$with_slang/include $CPPFLAGS" CPPFLAGS="-I$with_slang/include $CPPFLAGS"
fi fi
AC_CHECK_HEADER(slcurses.h, if test x$enable_utf8 != xno
AC_MSG_CHECKING([for SLutf8_enable in -lslang]) then
_libs=$LIBS AC_CHECK_HEADER(slcurses.h,
LIBS="$LIBS -lslang" AC_MSG_CHECKING([for SLutf8_enable in -lslang])
AC_TRY_RUN([ _libs=$LIBS
#include <slcurses.h> LIBS="$LIBS -lslang"
int main(void)
{
SLutf8_enable(TRUE);
return 0;
}],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes
CURSES_LIB_WIDE=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
return 0;
}],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
# We might need the term library
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([ AC_TRY_RUN([
#include <slcurses.h> #include <slcurses.h>
int main(void) int main(void)
@ -264,35 +232,22 @@ int main(void)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes slang_support=yes
CURSES_LIB_WIDE=yes CURSES_LIB_WIDE=yes
if test "$with_slang" != "yes"; then if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap" CURSES_LIB="-L${with_slang}/lib -lslang"
else else
CURSES_LIB="-lslang $tcap" CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
return 0;
}],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes
if test "$with_slang" != "yes"; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else
CURSES_LIB="-lslang $tcap"
fi fi
CURSES_LIB_NAME=slang], CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no) [AC_MSG_RESULT(no)
# We might need the math library # We might need the term library
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm]) for termlib in ncurses curses termcap terminfo termlib; do
LIBS="$LIBS -lm" AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([ AC_TRY_RUN([
#include <slcurses.h> #include <slcurses.h>
int main(void) int main(void)
@ -304,16 +259,81 @@ int main(void)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes slang_support=yes
CURSES_LIB_WIDE=yes CURSES_LIB_WIDE=yes
if test "$with_slang" != "yes"; then if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm" CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else else
CURSES_LIB="-lslang $tcap -lm" CURSES_LIB="-lslang $tcap"
fi fi
CURSES_LIB_NAME=slang], CURSES_LIB_NAME=slang],
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm]) [AC_MSG_RESULT(no)
# We might need the math library
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm])
LIBS="$LIBS -lm"
AC_TRY_RUN([ AC_TRY_RUN([
#include <slcurses.h> #include <slcurses.h>
int main(void) int main(void)
{
SLutf8_enable(TRUE);
return 0;
}],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
CURSES_LIB="-lslang $tcap -lm"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either
*** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang
]))
fi
if eval "test x$CURSES_LIB_NAME = x"
then
AC_CHECK_HEADER(slcurses.h,
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
return 0;
}],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
CURSES_LIB="-lslang"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)
# We might need the term library
for termlib in ncurses curses termcap terminfo termlib; do
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
test -n "$tcap" && break
done
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <slcurses.h>
int main(void)
{ {
SLtt_initialize(NULL); SLtt_initialize(NULL);
return 0; return 0;
@ -321,37 +341,62 @@ int main(void)
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes slang_support=yes
if test "$with_slang" != "yes"; then if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm" CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else else
CURSES_LIB="-lslang $tcap -lm" CURSES_LIB="-lslang $tcap"
fi fi
CURSES_LIB_NAME=slang], CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)], [AC_MSG_RESULT(no)
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))], # We might need the math library
AC_MSG_WARN([*** Can not use slang when cross-compiling]))], AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
AC_MSG_WARN([*** Can not use slang when cross-compiling]))], LIBS="$LIBS -lm"
AC_MSG_WARN([*** Can not use slang when cross-compiling])), AC_TRY_RUN([
AC_MSG_WARN([*** Can not use slang when cross-compiling])), #include <slcurses.h>
int main(void)
{
SLtt_initialize(NULL);
return 0;
}],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
slang_support=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
CURSES_LIB="-lslang $tcap -lm"
fi
CURSES_LIB_NAME=slang],
[AC_MSG_RESULT(no)],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
AC_MSG_ERROR([ AC_MSG_ERROR([
*** The header file slcurses.h was not found. If you wish to use *** The header file slcurses.h was not found. If you wish to use
*** slang support this header file is required. Please either *** slang support this header file is required. Please either
*** install a version of slang that includes the slcurses.h file or *** install a version of slang that includes the slcurses.h file or
*** do not call the configure script with --with-slang *** do not call the configure script with --with-slang
])) ]))
fi
test "${_libs+set}" = "set" && LIBS=$_libs test ${_libs+set} = set && LIBS=$_libs
if test "$with_slang" != "yes"; then if test x$with_slang != xyes; then
LDFLAGS=${_ldflags} LDFLAGS=${_ldflags}
fi fi
;; ;;
esac], [AC_MSG_RESULT(no)]) esac], [AC_MSG_RESULT(no)])
dnl Checks for functions 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$ac_cv_func_snprintf" = "xno" -o "x$ac_cv_func_vsnprintf" = "xno"
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 then
AM_PATH_GLIB_2_0(2.0.0,, AM_PATH_GLIB_2_0(2.0.0,,
AC_MSG_ERROR([ AC_MSG_ERROR([
@ -372,17 +417,27 @@ dnl Checks for libraries.
if eval "test x$CURSES_LIB_NAME = x" if eval "test x$CURSES_LIB_NAME = x"
then then
AC_CHECK_HEADERS(ncurses.h) 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" if eval "test x$CURSES_LIB_NAME = x"
then 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
fi fi
if eval "test x$CURSES_LIB_NAME = x" if eval "test x$CURSES_LIB_NAME = x"
then then
AC_CHECK_HEADERS(curses.h) 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" if eval "test x$CURSES_LIB_NAME = x"
then then
AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
@ -416,11 +471,34 @@ then
LDFLAGS="$LDFLAGS $GLIB_LIBS" LDFLAGS="$LDFLAGS $GLIB_LIBS"
fi 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 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()).]) 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 else
AC_MSG_WARN([Insufficient wide character support found. nano will not be able to support UTF-8.]) if test x$enable_utf8 = xyes
then
AC_MSG_ERROR([
*** UTF-8 support was requested, but insufficient UTF-8 support was
*** detected in your curses and/or C libraries. Please verify that your
*** slang was built with UTF-8 support or your curses was built with
*** wide character support, and that your C library was built with wide
*** character support.])
elif test x$enable_utf8 != xno
then
AC_MSG_WARN([
*** Insufficient UTF-8 support was detected in your curses and/or C
*** libraries. If you want UTF-8 support, please verify that your slang
*** was built with UTF-8 support or your curses was built with wide
*** character support, and that your C library was built with wide
*** character support.])
fi
fi fi
AC_CONFIG_FILES([ AC_CONFIG_FILES([