]> git.wh0rd.org Git - nano.git/commitdiff
check for a UTF-8-supporting version of slang
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Sun, 20 Mar 2005 02:50:31 +0000 (02:50 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Sun, 20 Mar 2005 02:50:31 +0000 (02:50 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2398 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
configure.ac

index c83230904e2eb6cc094e1ab7db8ea247e3d44105..c0bedf0647172b98f0febc76e88fc2edd87135b5 100644 (file)
--- 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
index 8aa6ad4bece5ea26aa4f1f5714596ee86a3d4cd1..eab13e9938fac2ad8912df881b27ae9cb6d41834 100644 (file)
@@ -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,12 +205,31 @@ 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,17 +244,37 @@ 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,14 +287,33 @@ 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