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-d3aeb78583b8master
parent
c8857a2c26
commit
8ac9087d75
|
@ -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:
|
||||||
|
|
186
configure.ac
186
configure.ac
|
@ -69,7 +69,7 @@ AC_ARG_ENABLE(debug,
|
||||||
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
|
||||||
|
|
||||||
|
@ -187,6 +187,17 @@ AC_ARG_ENABLE(all,
|
||||||
])
|
])
|
||||||
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,12 +209,14 @@ 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
|
||||||
|
|
||||||
|
if test x$enable_utf8 != xno
|
||||||
|
then
|
||||||
AC_CHECK_HEADER(slcurses.h,
|
AC_CHECK_HEADER(slcurses.h,
|
||||||
AC_MSG_CHECKING([for SLutf8_enable in -lslang])
|
AC_MSG_CHECKING([for SLutf8_enable in -lslang])
|
||||||
_libs=$LIBS
|
_libs=$LIBS
|
||||||
|
@ -219,25 +232,7 @@ 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"
|
|
||||||
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"
|
CURSES_LIB="-L${with_slang}/lib -lslang"
|
||||||
else
|
else
|
||||||
CURSES_LIB="-lslang"
|
CURSES_LIB="-lslang"
|
||||||
|
@ -264,25 +259,7 @@ 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"
|
|
||||||
else
|
|
||||||
CURSES_LIB="-lslang $tcap"
|
|
||||||
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"
|
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
|
||||||
else
|
else
|
||||||
CURSES_LIB="-lslang $tcap"
|
CURSES_LIB="-lslang $tcap"
|
||||||
|
@ -304,13 +281,30 @@ 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 -lm"
|
||||||
else
|
else
|
||||||
CURSES_LIB="-lslang $tcap -lm"
|
CURSES_LIB="-lslang $tcap -lm"
|
||||||
fi
|
fi
|
||||||
CURSES_LIB_NAME=slang],
|
CURSES_LIB_NAME=slang],
|
||||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
|
[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([
|
AC_TRY_RUN([
|
||||||
#include <slcurses.h>
|
#include <slcurses.h>
|
||||||
int main(void)
|
int main(void)
|
||||||
|
@ -321,7 +315,54 @@ 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"
|
||||||
|
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);
|
||||||
|
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"
|
||||||
|
else
|
||||||
|
CURSES_LIB="-lslang $tcap"
|
||||||
|
fi
|
||||||
|
CURSES_LIB_NAME=slang],
|
||||||
|
[AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
# We might need the math library
|
||||||
|
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
|
||||||
|
LIBS="$LIBS -lm"
|
||||||
|
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 $tcap -lm"
|
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
|
||||||
else
|
else
|
||||||
CURSES_LIB="-lslang $tcap -lm"
|
CURSES_LIB="-lslang $tcap -lm"
|
||||||
|
@ -330,9 +371,6 @@ int main(void)
|
||||||
[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]))],
|
||||||
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_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_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
|
||||||
|
@ -340,18 +378,25 @@ AC_MSG_WARN([*** Can not use slang when cross-compiling])),
|
||||||
*** 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,7 +417,12 @@ 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])
|
||||||
|
@ -382,7 +432,12 @@ 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([
|
||||||
|
|
Loading…
Reference in New Issue