Rewrite of configuration system to support "regular" curses as well as

eliminating the --with-ncurses option. Now, ncurses support will be
built in if a compatible library is detected.
This commit is contained in:
Joseph Pranevich 1999-01-03 16:14:34 +00:00 committed by Alexandre Julliard
parent e365a23341
commit e884f9ca0e
6 changed files with 330 additions and 203 deletions

467
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -43,10 +43,6 @@ AC_ARG_ENABLE(trace,
[ --disable-trace compile out TRACE messages],
[if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
AC_ARG_WITH(ncurses,
[ --with-ncurses compile in the ncurses terminal (EXPERIMENTAL)],
[if test "$withval" = "yes"; then LIBS="$LIBS -lncurses"; AC_DEFINE(WINE_NCURSES) fi])
AC_ARG_WITH(reentrant-x,
[ --without-reentrant-x compile for use with non-reentrant X libraries])
@ -116,6 +112,14 @@ else
X_LIBS=""
fi
dnl **** Check which curses lib to use ***
AC_CHECK_LIB(ncurses,waddch)
if test "$ac_cv_lib_ncurses_waddch" = "yes"
then :
else
AC_CHECK_LIB(curses,waddch)
fi
dnl **** Check for IPX (currently Linux only) ****
AC_CACHE_CHECK("for GNU style IPX support", ac_cv_c_ipx_gnu,
AC_TRY_COMPILE(

View File

@ -1,6 +1,7 @@
/* ncurses.c */
#include "config.h"
#include "console.h"
#ifdef WINE_NCURSES
@ -18,7 +19,6 @@
driver, it should make sure to perserve the old values.
*/
#include "console.h"
#include "debug.h"
#undef ERR /* Use ncurses's err() */
#include <curses.h>
@ -39,6 +39,7 @@ void NCURSES_Start()
driver.getCursorPosition = NCURSES_GetCursorPosition;
driver.getCharacterAtCursor = NCURSES_GetCharacterAtCursor;
driver.clearScreen = NCURSES_ClearScreen;
driver.notifyResizeScreen = NCURSES_NotifyResizeScreen;
driver.checkForKeystroke = NCURSES_CheckForKeystroke;
driver.getKeystroke = NCURSES_GetKeystroke;
@ -62,7 +63,8 @@ void NCURSES_Init()
void NCURSES_Write(char output, int fg, int bg, int attribute)
{
/* We can discard all extended information. */
waddch(stdscr, output);
if (waddch(stdscr, output) == ERR)
FIXME(console, "NCURSES: waddch() failed.\n");
}
void NCURSES_Close()
@ -101,7 +103,8 @@ int NCURSES_CheckForKeystroke(char *scan, char *ascii)
void NCURSES_MoveCursor(char row, char col)
{
wmove(stdscr, row, col);
if (wmove(stdscr, row, col) == ERR)
FIXME(console, "NCURSES: wmove() failed to %d, %d.\n", row, col);
}
void NCURSES_GetCursorPosition(char *row, char *col)
@ -134,4 +137,13 @@ void NCURSES_ClearScreen()
werase(stdscr);
}
void NCURSES_NotifyResizeScreen(int x, int y)
{
/* Note: This function gets called *after* another driver in the chain
calls ResizeScreen(). It is meant to resize the ncurses internal
data structures to know about the new window dimensions. */
resizeterm(y, x);
}
#endif /* WINE_NCURSES */

View File

@ -57,8 +57,14 @@
/* Define if the struct statfs is defined by <sys/mount.h> */
#undef STATFS_DEFINED_BY_SYS_MOUNT
/* Define if we want to use ncurses instead of the TTY terminal */
#undef WINE_NCURSES
/* Define if we can use ncurses for full-screen access */
#undef HAVE_LIBNCURSES
/* Define if we can use curses (if no ncurses) for full-screen access */
#undef HAVE_LIBCURSES
/* Define if we can a compatible xterm program */
#undef XTERM_PROGRAM
/* Define if IPX should use netipx/ipx.h from libc */
#undef HAVE_IPX_GNU

View File

@ -69,9 +69,6 @@
/* Define if the struct statfs is defined by <sys/mount.h> */
#undef STATFS_DEFINED_BY_SYS_MOUNT
/* Define if we want to use ncurses instead of the TTY terminal */
#undef WINE_NCURSES
/* Define if IPX should use netipx/ipx.h from libc */
#undef HAVE_IPX_GNU
@ -192,12 +189,18 @@
/* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
/* Define if you have the curses library (-lcurses). */
#undef HAVE_LIBCURSES
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Define if you have the i386 library (-li386). */
#undef HAVE_LIBI386
/* Define if you have the ncurses library (-lncurses). */
#undef HAVE_LIBNCURSES
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL

View File

@ -1,4 +1,5 @@
/* Console.H */
/* console.h */
/* Copyright 1998 - Joseph Pranevich */
/* Include file for definitions pertaining to Wine's text-console
interface.
@ -11,7 +12,18 @@
#include "config.h"
/* Which libs can be used for wine's curses implementation... */
#ifdef HAVE_LIBNCURSES
#define WINE_NCURSES
#else
#ifdef HAVE_LIBCURSES
#define WINE_NCURSES
#endif
#endif
#define CONSOLE_DEFAULT_DRIVER "tty"
/* If you have problems, try setting the next line to xterm */
#define CONSOLE_XTERM_PROG "nxterm" /* We should check for this first... */
typedef struct CONSOLE_DRIVER
{
@ -70,6 +82,7 @@ void CONSOLE_ClearScreen();
char CONSOLE_GetCharacter();
void CONSOLE_ResizeScreen();
void CONSOLE_NotifyResizeScreen();
void CONSOLE_WriteRawString(char *);
/* Generic Defines */
void GENERIC_Start();
@ -97,6 +110,7 @@ void NCURSES_GetCursorPosition(char *, char *);
void NCURSES_GetCharacterAtCursor(char *, int *, int *, int *);
void NCURSES_Refresh();
void NCURSES_ClearScreen();
void NCURSES_NotifyResizeScreen(int x, int y);
#endif /* WINE_NCURSES */
@ -104,5 +118,6 @@ void NCURSES_ClearScreen();
void XTERM_Start();
void XTERM_Close();
void XTERM_Init();
void XTERM_ResizeScreen(int x, int y);
#endif /* CONSOLE_H */