commit ba1ab86db5f90d1390f15fddd6a863fc68bd965c
parent 1fc55a268fa086bd3b8baf2731c65e8a1e4839a3
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sun, 20 Mar 2005 02:50:31 +0000
check for a UTF-8-supporting version of slang
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2398 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
M | ChangeLog | | | 6 | +++--- |
M | configure.ac | | | 75 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- |
2 files changed, 70 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -328,9 +328,9 @@ CVS code -
as Pico does. (DLR)
- configure.ac:
- Remove specific references to control key shortcuts. (DLR)
- - Check for the wide version of ncurses, without which multibyte
- strings don't seem to be displayed properly, and associated
- wide character functions. (DLR)
+ - Check for the wide versions of ncurses or slang, without which
+ multibyte strings don't seem to be displayed properly, and
+ associated multibyte/wide character functions. (DLR)
- Check for wchar.h, for those systems that need it for the
wcwidth() prototype. (DLR)
- Remove checks for all include files that we include
diff --git a/configure.ac b/configure.ac
@@ -59,9 +59,7 @@ int main(void)
AC_MSG_RESULT(no),
AC_MSG_RESULT(yes)
AC_DEFINE(BROKEN_REGEXEC, 1, [Define this if your regexec() function segfaults when passed an empty string under certain conditions.]),
- AC_MSG_RESULT([cross-compiling; assuming no])
- )
- )
+ AC_MSG_RESULT([cross-compiling; assuming no])))
dnl options
AC_ARG_ENABLE(debug,
@@ -207,13 +205,32 @@ AC_ARG_WITH(slang,
fi
AC_CHECK_HEADER(slcurses.h,
- AC_MSG_CHECKING([for SLtt_initialize in -lslang])
+ AC_MSG_CHECKING([for SLutf8_enable in -lslang])
_libs=$LIBS
LIBS="$LIBS -lslang"
AC_TRY_RUN([
#include <slcurses.h>
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;
}],
@@ -227,18 +244,38 @@ int main(void)
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])
+ AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap])
LIBS="$LIBS $tcap"
AC_TRY_RUN([
#include <slcurses.h>
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 $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;
}],
@@ -250,15 +287,34 @@ int main(void)
else
CURSES_LIB="-lslang $tcap"
fi
- CURSES_LIB_NAME=slang], [
- AC_MSG_RESULT(no)
+ CURSES_LIB_NAME=slang],
+ [AC_MSG_RESULT(no)
+
# We might need the math library
- AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
+ AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm])
LIBS="$LIBS -lm"
AC_TRY_RUN([
#include <slcurses.h>
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 $tcap -lm"
+ else
+ CURSES_LIB="-lslang $tcap -lm"
+ fi
+ CURSES_LIB_NAME=slang],
+ AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
+ AC_TRY_RUN([
+#include <slcurses.h>
+int main(void)
+{
SLtt_initialize(NULL);
return 0;
}],
@@ -274,6 +330,9 @@ int main(void)
[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_ERROR([
*** The header file slcurses.h was not found. If you wish to use