[Curses ttydrv configure] Add check for widechar ncurses (2/5)

Peter Berg Larsen pebl at math.ku.dk
Sat Nov 29 01:29:14 CST 2003


Changelog:
- Add check for ncursesw which supports widechar (unicode)

-------------- next part --------------
diff -ur wine-20031118/configure.ac wine-my/configure.ac
--- wine-20031118/configure.ac	2003-11-19 03:18:13.000000000 +0100
+++ wine-my/configure.ac	2003-11-29 00:13:03.000000000 +0100
@@ -362,14 +362,15 @@
 CURSESLIBS=""
 if test "x$with_curses" != "xno"
 then
-    AC_CHECK_HEADERS(ncurses.h,
-        [AC_CHECK_LIB(ncurses,waddch,
-            [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
-             CURSESLIBS="-lncurses"],
-             [AC_CHECK_HEADERS(curses.h,
-                 [AC_CHECK_LIB(curses,waddch,
-                     [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
-                      CURSESLIBS="-lcurses"])])])])
+     AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h curses.h)
+
+     AC_CHECK_LIB(curses  ,waddch,   [CURSESLIBS="-lcurses"
+                                      AC_DEFINE(HAVE_LIBCURSES,   1, [Define if you have the curses library (-lcurses)])])
+     AC_CHECK_LIB(ncurses ,waddch,   [CURSESLIBS="-lncurses"
+                                      AC_DEFINE(HAVE_LIBNCURSES,  1, [Define if you have the ncurses library (-lncurses)])])
+     AC_CHECK_LIB(ncursesw,waddnwstr,[CURSESLIBS="-lncursesw"
+                                      AC_DEFINE(HAVE_LIBNCURSESW, 1, [Define if you have the ncursesw library (-lncursesw)])])
+
     saved_libs="$LIBS"
     LIBS="$CURSESLIBS $LIBS"
     AC_CHECK_FUNCS(getbkgd resizeterm)
@@ -970,6 +971,7 @@
   WINE_GET_SONAME(fontconfig,FcInit)
   WINE_GET_SONAME(ssl,SSL_library_init)
   WINE_GET_SONAME(crypto,BIO_new_socket)
+  WINE_GET_SONAME(ncursesw,waddnwstr)
   WINE_GET_SONAME(ncurses,waddch)
   WINE_GET_SONAME(curses,waddch)
 fi
diff -ur wine-20031118/include/config.h.in wine-my/include/config.h.in
--- wine-20031118/include/config.h.in	2003-11-19 03:18:13.000000000 +0100
+++ wine-my/include/config.h.in	2003-11-19 14:33:26.000000000 +0100
@@ -242,6 +242,9 @@
 /* Define if you have the ncurses library (-lncurses) */
 #undef HAVE_LIBNCURSES
 
+/* Define if you have the ncursesw library (-lncursesw) */
+#undef HAVE_LIBNCURSESW
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
@@ -347,6 +350,9 @@
 /* Define to 1 if you have the <ncurses.h> header file. */
 #undef HAVE_NCURSES_H
 
+/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
+#undef HAVE_NCURSESW_NCURSES_H
+
 /* Define to 1 if you have the <netdb.h> header file. */
 #undef HAVE_NETDB_H
 
@@ -821,6 +827,9 @@
 /* Define to the soname of the libncurses library. */
 #undef SONAME_LIBNCURSES
 
+/* Define to the soname of the libncursesw library. */
+#undef SONAME_LIBNCURSESW
+
 /* Define to the soname of the libssl library. */
 #undef SONAME_LIBSSL
 
diff -ur wine-20031118/dlls/ttydrv/ttydrv.h wine-my/dlls/ttydrv/ttydrv.h
--- wine-20031118/dlls/ttydrv/ttydrv.h	2003-09-06 01:08:30.000000000 +0200
+++ wine-my/dlls/ttydrv/ttydrv.h	2003-11-29 01:44:49.000000000 +0100
@@ -26,8 +26,10 @@
 #endif
 
 #undef ERR
-#if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES)
-#ifdef HAVE_NCURSES_H
+#if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW)
+#ifdef HAVE_NCURSESW_NCURSES_H
+# include <ncursesw/ncurses.h> 
+#elif defined(HAVE_NCURSES_H)
 # include <ncurses.h>
 #elif defined(HAVE_CURSES_H)
 # include <curses.h>
@@ -42,7 +44,7 @@
 
 struct tagBITMAPOBJ;
 
-#if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES)
+#if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW)
 #define WINE_CURSES
 #endif
 
diff -ur wine-20031118/programs/wineconsole/curses.c wine-my/programs/wineconsole/curses.c
--- wine-20031118/programs/wineconsole/curses.c	2003-10-15 23:01:05.000000000 +0200
+++ wine-my/programs/wineconsole/curses.c	2003-11-14 05:20:46.000000000 +0100
@@ -35,15 +35,17 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
-#ifdef HAVE_CURSES_H
-#include <curses.h>
-#endif
-#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
+#ifdef HAVE_NCURSESW_NCURSES_H
+# define _XOPEN_SOURCE_EXTENDED 1 /* Add widechar support*/
+# include <ncursesw/ncurses.h>
+#elif defined(HAVE_NCURSES_H)
+# include <ncurses.h>
+#elif defined(HAVE_CURSES_H)
+# include <curses.h>
 #endif
 #undef KEY_EVENT  /* avoid redefinition warning */
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #include <windef.h>
 #include <winbase.h>
@@ -58,12 +60,14 @@
 
 #define PRIVATE(data)   ((struct inner_data_curse*)((data)->private))
 
-#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
+#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H) || defined(HAVE_NCURSESW_NCURSES_H)
 
-#ifdef HAVE_NCURSES_H
- #define CURSES_NAME "ncurses"
+#ifdef HAVE_NCURSESW_NCURSES_H
+# define CURSES_NAME "ncursesw"
+#elif defined(HAVE_NCURSES_H)
+# define CURSES_NAME "ncurses"
 #else
- #define CURSES_NAME "curses"
+# define CURSES_NAME "curses"
 #endif
 
 struct inner_data_curse 


More information about the wine-patches mailing list