Tweak sources for --with-x/--without-x option.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-10-30 13:07:46 +04:00
parent 0ac261de1b
commit 3f8e561e17
4 changed files with 10 additions and 10 deletions

View File

@ -17,8 +17,11 @@ TTY_SRC = \
key.c key.h keyxdef.c \ key.c key.h keyxdef.c \
mouse.c mouse.h \ mouse.c mouse.h \
tty.c tty.h tty-internal.h \ tty.c tty.h tty-internal.h \
win.c win.h \ win.c win.h
x11conn.c x11conn.h
if HAVE_TEXTMODE_X11_SUPPORT
TTY_SRC += x11conn.c x11conn.h
endif
libmctty_la_SOURCES = $(TTY_SRC) $(TTY_SCREEN_SRC) libmctty_la_SOURCES = $(TTY_SRC) $(TTY_SCREEN_SRC)

View File

@ -668,10 +668,10 @@ define_sequences (const key_define_t * kd)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#ifdef HAVE_TEXTMODE_X11_SUPPORT
static void static void
init_key_x11 (void) init_key_x11 (void)
{ {
#ifdef HAVE_TEXTMODE_X11_SUPPORT
if (getenv ("DISPLAY") != NULL && !mc_global.tty.disable_x11) if (getenv ("DISPLAY") != NULL && !mc_global.tty.disable_x11)
{ {
x11_display = mc_XOpenDisplay (0); x11_display = mc_XOpenDisplay (0);
@ -679,8 +679,8 @@ init_key_x11 (void)
if (x11_display != NULL) if (x11_display != NULL)
x11_window = DefaultRootWindow (x11_display); x11_window = DefaultRootWindow (x11_display);
} }
#endif /* HAVE_TEXTMODE_X11_SUPPORT */
} }
#endif /* HAVE_TEXTMODE_X11_SUPPORT */
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
/* Workaround for System V Curses vt100 bug */ /* Workaround for System V Curses vt100 bug */
@ -1437,7 +1437,9 @@ init_key (void)
} }
#endif /* __QNX__ */ #endif /* __QNX__ */
#ifdef HAVE_TEXTMODE_X11_SUPPORT
init_key_x11 (); init_key_x11 ();
#endif
/* Load the qansi-m key definitions /* Load the qansi-m key definitions
if we are running under the qansi-m terminal */ if we are running under the qansi-m terminal */

View File

@ -31,10 +31,6 @@
#include <config.h> #include <config.h>
#ifndef HAVE_TEXTMODE_X11_SUPPORT
typedef int dummy; /* C99 forbids empty compilation unit */
#else
#include <setjmp.h> #include <setjmp.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#ifdef HAVE_GMODULE #ifdef HAVE_GMODULE
@ -250,5 +246,3 @@ mc_XQueryPointer (Display * display, Window win, Window * root_return,
} }
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#endif /* HAVE_TEXTMODE_X11_SUPPORT */

View File

@ -19,4 +19,5 @@ AC_DEFUN([MC_WITH_X], [
fi fi
fi fi
AM_CONDITIONAL([HAVE_TEXTMODE_X11_SUPPORT], [test x"$textmode_x11_support" = x"yes"])
]) ])